Browse Source

Updated .gitignore + started to add base classes

master
Joshua Reason 7 years ago
parent
commit
89d6833555
16 changed files with 281 additions and 1 deletions
  1. +5
    -1
      .gitignore
  2. BIN
      IronToad_UnityProject/Assets/Materials/Test_BoatMat.mat
  3. +8
    -0
      IronToad_UnityProject/Assets/Materials/Test_BoatMat.mat.meta
  4. +30
    -0
      IronToad_UnityProject/Assets/Scripts/BoatController.cs
  5. +12
    -0
      IronToad_UnityProject/Assets/Scripts/BoatController.cs.meta
  6. +56
    -0
      IronToad_UnityProject/Assets/Scripts/BuoyantObject.cs
  7. +12
    -0
      IronToad_UnityProject/Assets/Scripts/BuoyantObject.cs.meta
  8. +16
    -0
      IronToad_UnityProject/Assets/Scripts/PlayerController.cs
  9. +12
    -0
      IronToad_UnityProject/Assets/Scripts/PlayerController.cs.meta
  10. +75
    -0
      IronToad_UnityProject/Assets/Scripts/WaterController.cs
  11. +12
    -0
      IronToad_UnityProject/Assets/Scripts/WaterController.cs.meta
  12. +23
    -0
      IronToad_UnityProject/Assets/Scripts/WaterObject.cs
  13. +12
    -0
      IronToad_UnityProject/Assets/Scripts/WaterObject.cs.meta
  14. BIN
      IronToad_UnityProject/Assets/_Scenes/PhysicsTestScene.unity
  15. +8
    -0
      IronToad_UnityProject/Assets/_Scenes/PhysicsTestScene.unity.meta
  16. BIN
      IronToad_UnityProject/Library/assetDatabase3

+ 5
- 1
.gitignore View File

@ -35,4 +35,8 @@ sysinfo.txt
*.apk
*.unitypackage
# End of https://www.gitignore.io/api/unity
# End of https://www.gitignore.io/api/unity
IronToad_UnityProject/Library/
IronToad_UnityProject/Temp/ProcessJobs/e9a6970f79cd12d8b075e7d72f1b07cb.bakert
IronToad_UnityProject/Temp/UnityLockfile
IronToad_UnityProject/Temp/

BIN
IronToad_UnityProject/Assets/Materials/Test_BoatMat.mat View File


+ 8
- 0
IronToad_UnityProject/Assets/Materials/Test_BoatMat.mat.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0dc735b44f9a698438f584c02c7555c6
timeCreated: 1484910089
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

+ 30
- 0
IronToad_UnityProject/Assets/Scripts/BoatController.cs View File

@ -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 () {
}
}

+ 12
- 0
IronToad_UnityProject/Assets/Scripts/BoatController.cs.meta View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f3cdb8edf7874ca4b9c189bec10bf8f7
timeCreated: 1484910428
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 56
- 0
IronToad_UnityProject/Assets/Scripts/BuoyantObject.cs View File

@ -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<Rigidbody>();
}
#endregion Unity Functions
public override void OnWaterStay() {
}
public override void OnWaterEnter() {
throw new NotImplementedException();
}
public override void OnWaterExit() {
throw new NotImplementedException();
}
/// <summary>
///
/// </summary>
public void BuoyancyCalc() {
}
}

+ 12
- 0
IronToad_UnityProject/Assets/Scripts/BuoyantObject.cs.meta View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: bf1065d694a5ecb4d911457e68bf2c0a
timeCreated: 1484911019
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 16
- 0
IronToad_UnityProject/Assets/Scripts/PlayerController.cs View File

@ -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 () {
}
}

+ 12
- 0
IronToad_UnityProject/Assets/Scripts/PlayerController.cs.meta View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8a828132c9a87134089c2a7e23e0c299
timeCreated: 1484911651
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 75
- 0
IronToad_UnityProject/Assets/Scripts/WaterController.cs View File

@ -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
/// <summary>
/// Pushes any objects in water away from this point
/// </summary>
/// <param name="point"> point where water is createds</param>
/// <param name="radius"> radius of effected object</param>
/// <param name="power"> power with chich the objects are pushed</param>
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<Rigidbody>();
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<WaterObject>();
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<WaterObject>();
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<WaterObject>();
if (waterInteraction != null) {
waterInteraction.OnWaterExit();
}
}
#endregion Collision Functions
}

+ 12
- 0
IronToad_UnityProject/Assets/Scripts/WaterController.cs.meta View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d88731800dd7c774dbc4075ca3b78a2b
timeCreated: 1484911290
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 23
- 0
IronToad_UnityProject/Assets/Scripts/WaterObject.cs View File

@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class WaterObject : MonoBehaviour {
/// <summary>
/// Called when object intersects water plane
/// </summary>
public abstract void OnWaterEnter();
/// <summary>
/// Called while objects stays in water
/// </summary>
public abstract void OnWaterStay();
/// <summary>
/// Called when object leaves water
/// </summary>
public abstract void OnWaterExit();
}

+ 12
- 0
IronToad_UnityProject/Assets/Scripts/WaterObject.cs.meta View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b04e4b09361f56941bbf228e6175152d
timeCreated: 1484910555
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

BIN
IronToad_UnityProject/Assets/_Scenes/PhysicsTestScene.unity View File


+ 8
- 0
IronToad_UnityProject/Assets/_Scenes/PhysicsTestScene.unity.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2d7edb9bb9e70704db16665451d9f60e
timeCreated: 1484909912
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

BIN
IronToad_UnityProject/Library/assetDatabase3 View File


Loading…
Cancel
Save