diff --git a/.gitignore b/.gitignore index efc542a..844dbe5 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,8 @@ sysinfo.txt *.apk *.unitypackage -# End of https://www.gitignore.io/api/unity \ No newline at end of file +# End of https://www.gitignore.io/api/unity +IronToad_UnityProject/Library/ +IronToad_UnityProject/Temp/ProcessJobs/e9a6970f79cd12d8b075e7d72f1b07cb.bakert +IronToad_UnityProject/Temp/UnityLockfile +IronToad_UnityProject/Temp/ diff --git a/IronToad_UnityProject/Assets/Materials/Test_BoatMat.mat b/IronToad_UnityProject/Assets/Materials/Test_BoatMat.mat new file mode 100644 index 0000000..1ae5549 Binary files /dev/null and b/IronToad_UnityProject/Assets/Materials/Test_BoatMat.mat differ diff --git a/IronToad_UnityProject/Assets/Materials/Test_BoatMat.mat.meta b/IronToad_UnityProject/Assets/Materials/Test_BoatMat.mat.meta new file mode 100644 index 0000000..b43f8fa --- /dev/null +++ b/IronToad_UnityProject/Assets/Materials/Test_BoatMat.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0dc735b44f9a698438f584c02c7555c6 +timeCreated: 1484910089 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Scripts/BoatController.cs b/IronToad_UnityProject/Assets/Scripts/BoatController.cs new file mode 100644 index 0000000..4a0e386 --- /dev/null +++ b/IronToad_UnityProject/Assets/Scripts/BoatController.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class BoatController : WaterObject { + + public override void OnWaterEnter() { + throw new NotImplementedException(); + } + + public override void OnWaterStay() { + throw new NotImplementedException(); + } + + public override void OnWaterExit() { + throw new NotImplementedException(); + } + + + // Use this for initialization + void Start () { + + } + + // Update is called once per frame + void Update () { + + } +} diff --git a/IronToad_UnityProject/Assets/Scripts/BoatController.cs.meta b/IronToad_UnityProject/Assets/Scripts/BoatController.cs.meta new file mode 100644 index 0000000..1fdb2ea --- /dev/null +++ b/IronToad_UnityProject/Assets/Scripts/BoatController.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f3cdb8edf7874ca4b9c189bec10bf8f7 +timeCreated: 1484910428 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Scripts/BuoyantObject.cs b/IronToad_UnityProject/Assets/Scripts/BuoyantObject.cs new file mode 100644 index 0000000..e88b12e --- /dev/null +++ b/IronToad_UnityProject/Assets/Scripts/BuoyantObject.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[RequireComponent (typeof(Rigidbody))] +public class BuoyantObject : WaterObject { + + + [Tooltip ("How fast object will raise into the ")] + public float BouancyValue = 5; + + //rigidbody attached to GameObject + private Rigidbody rb; + + #region Unity Functions + void Awake() { + rb = GetComponent(); + } + + + + #endregion Unity Functions + + + public override void OnWaterStay() { + + + + + + } + + public override void OnWaterEnter() { + throw new NotImplementedException(); + } + + public override void OnWaterExit() { + throw new NotImplementedException(); + } + + /// + /// + /// + public void BuoyancyCalc() { + + + + + + } + + + + +} diff --git a/IronToad_UnityProject/Assets/Scripts/BuoyantObject.cs.meta b/IronToad_UnityProject/Assets/Scripts/BuoyantObject.cs.meta new file mode 100644 index 0000000..b7c0c80 --- /dev/null +++ b/IronToad_UnityProject/Assets/Scripts/BuoyantObject.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bf1065d694a5ecb4d911457e68bf2c0a +timeCreated: 1484911019 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Scripts/PlayerController.cs b/IronToad_UnityProject/Assets/Scripts/PlayerController.cs new file mode 100644 index 0000000..90e2946 --- /dev/null +++ b/IronToad_UnityProject/Assets/Scripts/PlayerController.cs @@ -0,0 +1,16 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class PlayerController : MonoBehaviour { + + // Use this for initialization + void Start () { + + } + + // Update is called once per frame + void Update () { + + } +} diff --git a/IronToad_UnityProject/Assets/Scripts/PlayerController.cs.meta b/IronToad_UnityProject/Assets/Scripts/PlayerController.cs.meta new file mode 100644 index 0000000..87e9098 --- /dev/null +++ b/IronToad_UnityProject/Assets/Scripts/PlayerController.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8a828132c9a87134089c2a7e23e0c299 +timeCreated: 1484911651 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Scripts/WaterController.cs b/IronToad_UnityProject/Assets/Scripts/WaterController.cs new file mode 100644 index 0000000..9f855ed --- /dev/null +++ b/IronToad_UnityProject/Assets/Scripts/WaterController.cs @@ -0,0 +1,75 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class WaterController : MonoBehaviour { + + #region Unity Functions + // Use this for initialization + void Start() { + + } + + // Update is called once per frame + void Update() { + + } + #endregion Unity Fucntions + + + #region Interaction Functions + + /// + /// Pushes any objects in water away from this point + /// + /// point where water is createds + /// radius of effected object + /// power with chich the objects are pushed + public void CreateWave(Vector3 point, float radius, float power){ + + //find all colliders within the wave distance + Collider[] colliders = Physics.OverlapSphere(point, radius); + foreach (Collider hit in colliders) { + Rigidbody rb = hit.GetComponent(); + + if (rb != null) + rb.AddExplosionForce(power, point, radius, 0.0f); + } + + + #endregion Interaction Functions + + } + + #region Collision Functions + void OnTriggerEnter(Collider other) { + //calls appropriate function if the object should interact with the water on enter + WaterObject waterInteraction = other.gameObject.GetComponent(); + if (waterInteraction != null) { + waterInteraction.OnWaterEnter(); + } + + } + + void OnTriggerStay(Collider other) { + + //calls appropriate function if the object should interact with the water on stay + WaterObject waterInteraction = other.gameObject.GetComponent(); + if (waterInteraction != null) { + waterInteraction.OnWaterStay(); + } + + } + + void OnTriggerExit(Collider other) { + //calls appropriate function if the object should interact with the water on exit + WaterObject waterInteraction = other.gameObject.GetComponent(); + if (waterInteraction != null) { + waterInteraction.OnWaterExit(); + } + + } + #endregion Collision Functions + + +} diff --git a/IronToad_UnityProject/Assets/Scripts/WaterController.cs.meta b/IronToad_UnityProject/Assets/Scripts/WaterController.cs.meta new file mode 100644 index 0000000..b10bb21 --- /dev/null +++ b/IronToad_UnityProject/Assets/Scripts/WaterController.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d88731800dd7c774dbc4075ca3b78a2b +timeCreated: 1484911290 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Scripts/WaterObject.cs b/IronToad_UnityProject/Assets/Scripts/WaterObject.cs new file mode 100644 index 0000000..2ea5ecf --- /dev/null +++ b/IronToad_UnityProject/Assets/Scripts/WaterObject.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public abstract class WaterObject : MonoBehaviour { + + /// + /// Called when object intersects water plane + /// + public abstract void OnWaterEnter(); + + /// + /// Called while objects stays in water + /// + public abstract void OnWaterStay(); + + /// + /// Called when object leaves water + /// + public abstract void OnWaterExit(); + + +} diff --git a/IronToad_UnityProject/Assets/Scripts/WaterObject.cs.meta b/IronToad_UnityProject/Assets/Scripts/WaterObject.cs.meta new file mode 100644 index 0000000..3f95f28 --- /dev/null +++ b/IronToad_UnityProject/Assets/Scripts/WaterObject.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b04e4b09361f56941bbf228e6175152d +timeCreated: 1484910555 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/_Scenes/PhysicsTestScene.unity b/IronToad_UnityProject/Assets/_Scenes/PhysicsTestScene.unity new file mode 100644 index 0000000..ec4f2e3 Binary files /dev/null and b/IronToad_UnityProject/Assets/_Scenes/PhysicsTestScene.unity differ diff --git a/IronToad_UnityProject/Assets/_Scenes/PhysicsTestScene.unity.meta b/IronToad_UnityProject/Assets/_Scenes/PhysicsTestScene.unity.meta new file mode 100644 index 0000000..9ca7f3e --- /dev/null +++ b/IronToad_UnityProject/Assets/_Scenes/PhysicsTestScene.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2d7edb9bb9e70704db16665451d9f60e +timeCreated: 1484909912 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Library/assetDatabase3 b/IronToad_UnityProject/Library/assetDatabase3 index 8828648..dae8b0e 100644 Binary files a/IronToad_UnityProject/Library/assetDatabase3 and b/IronToad_UnityProject/Library/assetDatabase3 differ