From 4dc44205d41ab697039660061470b5816237ab96 Mon Sep 17 00:00:00 2001 From: Joshua Reason Date: Sun, 22 Jan 2017 04:36:36 +1100 Subject: [PATCH] Can hit walls. also controls lockable --- ...ed804786939978fb1.meta => Animations.meta} | 5 +- .../Assets/Art/Models/lightHouse_LOW.obj.meta | 82 ------------------- .../Assets/Art/Models/pier.obj.meta | 82 ------------------- .../Assets/Scripts/BoatController.cs | 17 ++-- .../Assets/Scripts/PlayerController.cs | 14 +++- IronToad_UnityProject/Assets/Sound/Music.meta | 9 ++ IronToad_UnityProject/Assets/Sound/SFX.meta | 9 ++ IronToad_UnityProject/Assets/Textures.meta | 9 ++ .../Assets/_Scenes/GreyBox_Prototype.meta | 9 ++ 9 files changed, 62 insertions(+), 174 deletions(-) rename IronToad_UnityProject/Assets/{Sound.meta~33da7c3282ca6f5c80ab157e88e7a3f2b299d2eb.meta~5def2651a9a68039ca23aa6ed804786939978fb1.meta => Animations.meta} (58%) delete mode 100644 IronToad_UnityProject/Assets/Art/Models/lightHouse_LOW.obj.meta delete mode 100644 IronToad_UnityProject/Assets/Art/Models/pier.obj.meta create mode 100644 IronToad_UnityProject/Assets/Sound/Music.meta create mode 100644 IronToad_UnityProject/Assets/Sound/SFX.meta create mode 100644 IronToad_UnityProject/Assets/Textures.meta create mode 100644 IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.meta diff --git a/IronToad_UnityProject/Assets/Sound.meta~33da7c3282ca6f5c80ab157e88e7a3f2b299d2eb.meta~5def2651a9a68039ca23aa6ed804786939978fb1.meta b/IronToad_UnityProject/Assets/Animations.meta similarity index 58% rename from IronToad_UnityProject/Assets/Sound.meta~33da7c3282ca6f5c80ab157e88e7a3f2b299d2eb.meta~5def2651a9a68039ca23aa6ed804786939978fb1.meta rename to IronToad_UnityProject/Assets/Animations.meta index aac971b..b2e446b 100644 --- a/IronToad_UnityProject/Assets/Sound.meta~33da7c3282ca6f5c80ab157e88e7a3f2b299d2eb.meta~5def2651a9a68039ca23aa6ed804786939978fb1.meta +++ b/IronToad_UnityProject/Assets/Animations.meta @@ -1,6 +1,7 @@ fileFormatVersion: 2 -guid: 8fe9694a87e3fd545b420671f19f0beb -timeCreated: 1485009964 +guid: 653e5549e4b277c4facae79f936bb3e6 +folderAsset: yes +timeCreated: 1484972317 licenseType: Free DefaultImporter: userData: diff --git a/IronToad_UnityProject/Assets/Art/Models/lightHouse_LOW.obj.meta b/IronToad_UnityProject/Assets/Art/Models/lightHouse_LOW.obj.meta deleted file mode 100644 index d94fc60..0000000 --- a/IronToad_UnityProject/Assets/Art/Models/lightHouse_LOW.obj.meta +++ /dev/null @@ -1,82 +0,0 @@ -fileFormatVersion: 2 -guid: 919eb0dba9aa0da44aec3a80f1cf98ea -timeCreated: 1485000000 -licenseType: Free -ModelImporter: - serializedVersion: 19 - fileIDToRecycleName: - 100000: lighthouse - 100002: //RootNode - 400000: lighthouse - 400002: //RootNode - 2300000: lighthouse - 3300000: lighthouse - 4300000: lighthouse - materials: - importMaterials: 1 - materialName: 0 - materialSearch: 1 - animations: - legacyGenerateAnimations: 4 - bakeSimulation: 0 - resampleCurves: 1 - optimizeGameObjects: 0 - motionNodeName: - animationImportErrors: - animationImportWarnings: - animationRetargetingWarnings: - animationDoRetargetingWarnings: 0 - animationCompression: 1 - animationRotationError: 0.5 - animationPositionError: 0.5 - animationScaleError: 0.5 - animationWrapMode: 0 - extraExposedTransformPaths: [] - clipAnimations: [] - isReadable: 1 - meshes: - lODScreenPercentages: [] - globalScale: 1 - meshCompression: 0 - addColliders: 0 - importBlendShapes: 1 - swapUVChannels: 0 - generateSecondaryUV: 0 - useFileUnits: 1 - optimizeMeshForGPU: 1 - keepQuads: 0 - weldVertices: 1 - secondaryUVAngleDistortion: 8 - secondaryUVAreaDistortion: 15.000001 - secondaryUVHardAngle: 88 - secondaryUVPackMargin: 4 - useFileScale: 1 - tangentSpace: - normalSmoothAngle: 60 - normalImportMode: 0 - tangentImportMode: 3 - importAnimation: 1 - copyAvatar: 0 - humanDescription: - serializedVersion: 2 - human: [] - skeleton: [] - armTwist: 0.5 - foreArmTwist: 0.5 - upperLegTwist: 0.5 - legTwist: 0.5 - armStretch: 0.05 - legStretch: 0.05 - feetSpacing: 0 - rootMotionBoneName: - rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} - hasTranslationDoF: 0 - hasExtraRoot: 0 - skeletonHasParents: 1 - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 0 - humanoidOversampling: 1 - additionalBone: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Art/Models/pier.obj.meta b/IronToad_UnityProject/Assets/Art/Models/pier.obj.meta deleted file mode 100644 index 92a0183..0000000 --- a/IronToad_UnityProject/Assets/Art/Models/pier.obj.meta +++ /dev/null @@ -1,82 +0,0 @@ -fileFormatVersion: 2 -guid: 37549450629db464abffe54861590cf3 -timeCreated: 1485008673 -licenseType: Free -ModelImporter: - serializedVersion: 19 - fileIDToRecycleName: - 100000: pCylinder3 - 100002: //RootNode - 400000: pCylinder3 - 400002: //RootNode - 2300000: pCylinder3 - 3300000: pCylinder3 - 4300000: pCylinder3 - materials: - importMaterials: 1 - materialName: 0 - materialSearch: 1 - animations: - legacyGenerateAnimations: 4 - bakeSimulation: 0 - resampleCurves: 1 - optimizeGameObjects: 0 - motionNodeName: - animationImportErrors: - animationImportWarnings: - animationRetargetingWarnings: - animationDoRetargetingWarnings: 0 - animationCompression: 1 - animationRotationError: 0.5 - animationPositionError: 0.5 - animationScaleError: 0.5 - animationWrapMode: 0 - extraExposedTransformPaths: [] - clipAnimations: [] - isReadable: 1 - meshes: - lODScreenPercentages: [] - globalScale: 1 - meshCompression: 0 - addColliders: 0 - importBlendShapes: 1 - swapUVChannels: 0 - generateSecondaryUV: 0 - useFileUnits: 1 - optimizeMeshForGPU: 1 - keepQuads: 0 - weldVertices: 1 - secondaryUVAngleDistortion: 8 - secondaryUVAreaDistortion: 15.000001 - secondaryUVHardAngle: 88 - secondaryUVPackMargin: 4 - useFileScale: 1 - tangentSpace: - normalSmoothAngle: 60 - normalImportMode: 0 - tangentImportMode: 3 - importAnimation: 1 - copyAvatar: 0 - humanDescription: - serializedVersion: 2 - human: [] - skeleton: [] - armTwist: 0.5 - foreArmTwist: 0.5 - upperLegTwist: 0.5 - legTwist: 0.5 - armStretch: 0.05 - legStretch: 0.05 - feetSpacing: 0 - rootMotionBoneName: - rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} - hasTranslationDoF: 0 - hasExtraRoot: 0 - skeletonHasParents: 1 - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 0 - humanoidOversampling: 1 - additionalBone: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Scripts/BoatController.cs b/IronToad_UnityProject/Assets/Scripts/BoatController.cs index 593e77e..3a6a134 100644 --- a/IronToad_UnityProject/Assets/Scripts/BoatController.cs +++ b/IronToad_UnityProject/Assets/Scripts/BoatController.cs @@ -9,10 +9,10 @@ public class BoatController : BuoyantObject { // Use this for initialization - void Start () { - - } - + void Start() { + + } + void Update() { lookAtDir(Vector3.ProjectOnPlane(rb.velocity, Vector3.up)); } @@ -20,8 +20,15 @@ public class BoatController : BuoyantObject { // Update is called once per frame void lookAtDir(Vector3 inputDir) { - Quaternion targetRotation = Quaternion.LookRotation(inputDir,Vector3.up); + Quaternion targetRotation = Quaternion.LookRotation(inputDir, Vector3.up); float str = Mathf.Min(trunSpeed * Time.deltaTime, 1); transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, str); } + + void OnCollisionEnter(Collision collision) { + if (collision.gameObject.CompareTag("Rock")) + NotificationServer.notify("show GameOverPanel"); + } + + } diff --git a/IronToad_UnityProject/Assets/Scripts/PlayerController.cs b/IronToad_UnityProject/Assets/Scripts/PlayerController.cs index 1b8d74c..696fa74 100644 --- a/IronToad_UnityProject/Assets/Scripts/PlayerController.cs +++ b/IronToad_UnityProject/Assets/Scripts/PlayerController.cs @@ -4,6 +4,8 @@ using UnityEngine; public class PlayerController : MonoBehaviour { + private static bool isLocked = false; + public float power; public float radius; public float time; @@ -13,7 +15,7 @@ public class PlayerController : MonoBehaviour { // Update is called once per frame void Update () { - if (Input.GetButtonDown("Fire1")) { + if (Input.GetButtonDown("Fire1") && !isLocked) { Debug.Log("Click"); RaycastHit hit; Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); @@ -44,8 +46,14 @@ public class PlayerController : MonoBehaviour { } + } - - + /// + /// if true stops player from being able to click on water + /// + /// + public static void lockControls(bool input) { + isLocked = input; } + } diff --git a/IronToad_UnityProject/Assets/Sound/Music.meta b/IronToad_UnityProject/Assets/Sound/Music.meta new file mode 100644 index 0000000..5559b43 --- /dev/null +++ b/IronToad_UnityProject/Assets/Sound/Music.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1715d56e0d2b68246a82993db31014ab +folderAsset: yes +timeCreated: 1485006712 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Sound/SFX.meta b/IronToad_UnityProject/Assets/Sound/SFX.meta new file mode 100644 index 0000000..5548a6b --- /dev/null +++ b/IronToad_UnityProject/Assets/Sound/SFX.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: de5a3adcedb96f64183518ac89622ade +folderAsset: yes +timeCreated: 1485006712 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Textures.meta b/IronToad_UnityProject/Assets/Textures.meta new file mode 100644 index 0000000..ffdd440 --- /dev/null +++ b/IronToad_UnityProject/Assets/Textures.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2a6e699820a38a544acfc0015eb679a2 +folderAsset: yes +timeCreated: 1484972317 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.meta b/IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.meta new file mode 100644 index 0000000..47507ca --- /dev/null +++ b/IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 338533d5d159c00478a9fb5321b7d922 +folderAsset: yes +timeCreated: 1485007190 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: