diff --git a/SurvivalIsland/Assets/Scripts/CoconutThrower.cs b/SurvivalIsland/Assets/Scripts/CoconutThrower.cs index 20b8164..4748302 100644 --- a/SurvivalIsland/Assets/Scripts/CoconutThrower.cs +++ b/SurvivalIsland/Assets/Scripts/CoconutThrower.cs @@ -1,8 +1,9 @@ using UnityEngine; using System.Collections; -[RequireComponent (typeof (AudioSource))] -public class CoconutThrower : MonoBehaviour { +[RequireComponent(typeof(AudioSource))] +public class CoconutThrower : MonoBehaviour +{ public AudioClip throwSound; public Rigidbody coconutPrefab; @@ -10,21 +11,24 @@ public class CoconutThrower : MonoBehaviour { public static bool canThrow = false; // Use this for initialization - void Start () { - + void Start() + { + } - + // Update is called once per frame - void Update () { - if (Input.GetButtonDown ("Fire1") && canThrow) { + void Update() + { + if (Input.GetButtonDown("Fire1") && canThrow) + { audio.PlayOneShot(throwSound); Rigidbody newCoconut = Instantiate(coconutPrefab, - transform.position, transform.rotation) as Rigidbody; + transform.position, transform.rotation) as Rigidbody; newCoconut.name = "coconut"; newCoconut.velocity = transform.forward * throwSpeed; Physics.IgnoreCollision(transform.root.collider, - newCoconut.collider, true); - } + newCoconut.collider, true); + } } diff --git a/SurvivalIsland/Assets/Scripts/CoconutThrower.cs.meta b/SurvivalIsland/Assets/Scripts/CoconutThrower.cs.meta deleted file mode 100644 index 9120320..0000000 --- a/SurvivalIsland/Assets/Scripts/CoconutThrower.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 85cba2d465ac9ab4d8064e0b99aaa7dd -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/SurvivalIsland/Assets/Scripts/CoconutWin.cs b/SurvivalIsland/Assets/Scripts/CoconutWin.cs index daafcc5..fb6571e 100644 --- a/SurvivalIsland/Assets/Scripts/CoconutWin.cs +++ b/SurvivalIsland/Assets/Scripts/CoconutWin.cs @@ -1,30 +1,34 @@ using UnityEngine; using System.Collections; -[RequireComponent (typeof (AudioSource))] -public class CoconutWin : MonoBehaviour { +[RequireComponent(typeof(AudioSource))] +public class CoconutWin : MonoBehaviour +{ public static int targets = 0; public static bool haveWon = false; public AudioClip winSound; public GameObject cellPrefab; - + // Use this for initialization - void Start () { - + void Start() + { + } - + // Update is called once per frame - void Update () { - if (targets == 3 && haveWon == false) { + void Update() + { + if (targets == 3 && haveWon == false) + { targets = 0; audio.PlayOneShot(winSound); - GameObject winCell = transform.Find ("powerCell"). + GameObject winCell = transform.Find("powerCell"). gameObject; winCell.transform.Translate(-1, 0, 0); Instantiate(cellPrefab, winCell.transform.position, - transform.rotation); - Destroy (winCell); + transform.rotation); + Destroy(winCell); haveWon = true; } diff --git a/SurvivalIsland/Assets/Scripts/CoconutWin.cs.meta b/SurvivalIsland/Assets/Scripts/CoconutWin.cs.meta deleted file mode 100644 index 599883c..0000000 --- a/SurvivalIsland/Assets/Scripts/CoconutWin.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e4ccbd406b9ee9a4dbf41adad9400abe -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/SurvivalIsland/Assets/Scripts/DoorManager.cs b/SurvivalIsland/Assets/Scripts/DoorManager.cs index 3ec3d6a..1303fae 100644 --- a/SurvivalIsland/Assets/Scripts/DoorManager.cs +++ b/SurvivalIsland/Assets/Scripts/DoorManager.cs @@ -1,42 +1,50 @@ using UnityEngine; using System.Collections; -public class DoorManager : MonoBehaviour { +public class DoorManager : MonoBehaviour +{ bool doorIsOpen = false; - float doorTimer= 0.0f; + float doorTimer = 0.0f; public float doorOpenTime = 3.0f; public AudioClip doorOpenSound; public AudioClip doorShutSound; - - + + // Use this for initialization - void Start () { + void Start() + { doorTimer = 0.0f; } - + // Update is called once per frame - void Update () { - if (doorIsOpen) { - doorTimer +=Time.deltaTime; - - if(doorTimer > doorOpenTime){ - Door(doorShutSound,false,"doorshut"); - doorTimer =0.0f; + void Update() + { + if (doorIsOpen) + { + doorTimer += Time.deltaTime; + + if (doorTimer > doorOpenTime) + { + Door(doorShutSound, false, "doorshut"); + doorTimer = 0.0f; } } } - - void DoorCheck(){ - if (!doorIsOpen) { - Door (doorOpenSound,true,"dooropen"); + + void DoorCheck() + { + if (!doorIsOpen) + { + Door(doorOpenSound, true, "dooropen"); } } - - void Door(AudioClip aClip,bool openCheck, string animName){ - audio.PlayOneShot (aClip); + + void Door(AudioClip aClip, bool openCheck, string animName) + { + audio.PlayOneShot(aClip); doorIsOpen = openCheck; - transform.parent.animation.Play (animName); - + transform.parent.animation.Play(animName); + } } diff --git a/SurvivalIsland/Assets/Scripts/DoorManager.cs.meta b/SurvivalIsland/Assets/Scripts/DoorManager.cs.meta deleted file mode 100644 index 877a1cd..0000000 --- a/SurvivalIsland/Assets/Scripts/DoorManager.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 80af9609c13cf5648aa46809aaec8e8c -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/SurvivalIsland/Assets/Scripts/Inventory.cs b/SurvivalIsland/Assets/Scripts/Inventory.cs index 95d38b6..8a939e4 100644 --- a/SurvivalIsland/Assets/Scripts/Inventory.cs +++ b/SurvivalIsland/Assets/Scripts/Inventory.cs @@ -1,9 +1,10 @@ using UnityEngine; using System.Collections; -public class Inventory : MonoBehaviour { +public class Inventory : MonoBehaviour +{ - public static int charge=0; + public static int charge = 0; public AudioClip collectSound; public Texture2D[] hudCharge; public GUITexture chargeHudGUI; @@ -18,58 +19,71 @@ public class Inventory : MonoBehaviour { bool fireIsLit = false; // Use this for initialization - void Start () { + void Start() + { charge = 0; } - + // Update is called once per frame - void Update () { - + void Update() + { + } - void CellPickup(){ - HUDon (); - AudioSource .PlayClipAtPoint (collectSound, transform.position); + void CellPickup() + { + HUDon(); + AudioSource.PlayClipAtPoint(collectSound, transform.position); charge++; - chargeHudGUI.texture = hudCharge [charge]; - meter.material.mainTexture = meterCharge [charge]; + chargeHudGUI.texture = hudCharge[charge]; + meter.material.mainTexture = meterCharge[charge]; } - void HUDon(){ - if (!chargeHudGUI.enabled) { - chargeHudGUI.enabled =true; + void HUDon() + { + if (!chargeHudGUI.enabled) + { + chargeHudGUI.enabled = true; } } - void MatchPickup() { + void MatchPickup() + { haveMatches = true; //AudioSource.PlayClipAtPoint (collectSound, transform.position); - GUITexture matchHUD = Instantiate (matchGUIprefab, - new Vector3 (0.15f, 0.1f, 0), transform.rotation) as GUITexture; + GUITexture matchHUD = Instantiate(matchGUIprefab, + new Vector3(0.15f, 0.1f, 0), transform.rotation) as GUITexture; matchGUI = matchHUD; } - void OnControllerColliderHit(ControllerColliderHit col) { - if (col.gameObject.name == "campfire") { - if (haveMatches && !fireIsLit) { + void OnControllerColliderHit(ControllerColliderHit col) + { + if (col.gameObject.name == "campfire") + { + if (haveMatches && !fireIsLit) + { LightFire(col.gameObject); - } else if (!haveMatches && !fireIsLit) { + } + else if (!haveMatches && !fireIsLit) + { textHints.SendMessage("ShowHint", - "I could use this campfire to signal for help... " + - "if only I could light it..."); + "I could use this campfire to signal for help... " + + "if only I could light it..."); } } } - void LightFire(GameObject campfire) { + void LightFire(GameObject campfire) + { ParticleSystem[] pSystems; - pSystems = campfire.GetComponentsInChildren (); - foreach (ParticleSystem pSystem in pSystems) { + pSystems = campfire.GetComponentsInChildren(); + foreach (ParticleSystem pSystem in pSystems) + { pSystem.Play(); } //campfire.audio.Play (); - Destroy (matchGUI); + Destroy(matchGUI); haveMatches = false; fireIsLit = true; } diff --git a/SurvivalIsland/Assets/Scripts/Inventory.cs.meta b/SurvivalIsland/Assets/Scripts/Inventory.cs.meta deleted file mode 100644 index b8550b8..0000000 --- a/SurvivalIsland/Assets/Scripts/Inventory.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 41ee0d51a80bc614cbc4c2fc637cb996 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/SurvivalIsland/Assets/Scripts/MainMenuBtns.cs b/SurvivalIsland/Assets/Scripts/MainMenuBtns.cs index 7ac6ff4..f8d6b50 100644 --- a/SurvivalIsland/Assets/Scripts/MainMenuBtns.cs +++ b/SurvivalIsland/Assets/Scripts/MainMenuBtns.cs @@ -1,8 +1,9 @@ using UnityEngine; using System.Collections; -[RequireComponent (typeof (AudioSource))] -public class MainMenuBtns : MonoBehaviour { +[RequireComponent(typeof(AudioSource))] +public class MainMenuBtns : MonoBehaviour +{ public string levelToLoad; public Texture2D normalTexture; @@ -13,35 +14,44 @@ public class MainMenuBtns : MonoBehaviour { public GUIText textHints; // Use this for initialization - void Start () { - - } - - // Update is called once per frame - void Update () { - + void Start() + { + } - void OnMouseEnter() { + // Update is called once per frame + void Update() + { + + } + + void OnMouseEnter() + { guiTexture.texture = rollOverTexture; } - void OnMouseExit() { + void OnMouseExit() + { guiTexture.texture = normalTexture; } - IEnumerator OnMouseUp() { - audio.PlayOneShot (beep); + IEnumerator OnMouseUp() + { + audio.PlayOneShot(beep); yield return new WaitForSeconds(0.35f); - if (quitButton) { - Application.Quit (); - } else if (instructionsButton) { - textHints.SendMessage("ShowHint", - "You awake on a mysterious island..." + - "Find a way to signal for help or face certain doom!"); + if (quitButton) + { + Application.Quit(); } - else { - Application.LoadLevel (levelToLoad); + else if (instructionsButton) + { + textHints.SendMessage("ShowHint", + "You awake on a mysterious island..." + + "Find a way to signal for help or face certain doom!"); + } + else + { + Application.LoadLevel(levelToLoad); } } diff --git a/SurvivalIsland/Assets/Scripts/MainMenuBtns.cs.meta b/SurvivalIsland/Assets/Scripts/MainMenuBtns.cs.meta deleted file mode 100644 index 375f43d..0000000 --- a/SurvivalIsland/Assets/Scripts/MainMenuBtns.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 782d7955bf27e2244acf3aa18fa8d58e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/SurvivalIsland/Assets/Scripts/Matches.cs b/SurvivalIsland/Assets/Scripts/Matches.cs index 43823d7..4e45681 100644 --- a/SurvivalIsland/Assets/Scripts/Matches.cs +++ b/SurvivalIsland/Assets/Scripts/Matches.cs @@ -1,22 +1,27 @@ using UnityEngine; using System.Collections; -public class Matches : MonoBehaviour { +public class Matches : MonoBehaviour +{ // Use this for initialization - void Start () { - - } - - // Update is called once per frame - void Update () { - + void Start() + { + } - void OnTriggerEnter(Collider col) { - if (col.gameObject.tag == "Player") { + // Update is called once per frame + void Update() + { + + } + + void OnTriggerEnter(Collider col) + { + if (col.gameObject.tag == "Player") + { col.gameObject.SendMessage("MatchPickup"); - Destroy (gameObject); + Destroy(gameObject); } } } diff --git a/SurvivalIsland/Assets/Scripts/Matches.cs.meta b/SurvivalIsland/Assets/Scripts/Matches.cs.meta deleted file mode 100644 index 2a61e56..0000000 --- a/SurvivalIsland/Assets/Scripts/Matches.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 3ff7e1803b15b4f4c8c16b28071afc58 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/SurvivalIsland/Assets/Scripts/PlayerCollisions.cs b/SurvivalIsland/Assets/Scripts/PlayerCollisions.cs index 9f88349..243af17 100644 --- a/SurvivalIsland/Assets/Scripts/PlayerCollisions.cs +++ b/SurvivalIsland/Assets/Scripts/PlayerCollisions.cs @@ -1,28 +1,33 @@ using UnityEngine; using System.Collections; -public class PlayerCollisions : MonoBehaviour { +public class PlayerCollisions : MonoBehaviour +{ //bool doorIsOpen = false; //float doorTimer= 0.0f; //public float doorOpenTime = 3.0f; //public AudioClip doorOpenSound; //public AudioClip doorShutSound; - + GameObject currentDoor; - + // Use this for initialization - void Start () { - + void Start() + { + } - + // Update is called once per frame - void Update () { + void Update() + { RaycastHit hit; - if (Physics.Raycast (transform.position, transform.forward, out hit, 3)) { - if(hit.collider.gameObject.tag=="playerDoor"){ - currentDoor =hit.collider.gameObject; - currentDoor.SendMessage ("DoorCheck"); + if (Physics.Raycast(transform.position, transform.forward, out hit, 3)) + { + if (hit.collider.gameObject.tag == "playerDoor") + { + currentDoor = hit.collider.gameObject; + currentDoor.SendMessage("DoorCheck"); } } /*if (doorIsOpen) { @@ -37,7 +42,7 @@ public class PlayerCollisions : MonoBehaviour { }*/ } - + /*void OnControllerColliderHit(ControllerColliderHit hit){ if (hit.gameObject.tag == "playerDoor" && doorIsOpen == false) { currentDoor =hit.gameObject; @@ -45,14 +50,14 @@ public class PlayerCollisions : MonoBehaviour { //OpenDoor(hit.gameObject); } }*/ - + /*void Door(AudioClip aClip,bool openCheck, string animName,GameObject thisDoor){ thisDoor.audio.PlayOneShot (aClip); doorIsOpen = openCheck; thisDoor.transform.parent.animation.Play (animName); }*/ - + /*void OpenDoor(GameObject door){ doorIsOpen = true; door.audio.PlayOneShot (doorOpenSound); @@ -66,5 +71,5 @@ public class PlayerCollisions : MonoBehaviour { door.audio.PlayOneShot (doorShutSound); door.transform.parent.animation.Play ("doorshut"); }*/ - + } diff --git a/SurvivalIsland/Assets/Scripts/PlayerCollisions.cs.meta b/SurvivalIsland/Assets/Scripts/PlayerCollisions.cs.meta deleted file mode 100644 index f0ba61c..0000000 --- a/SurvivalIsland/Assets/Scripts/PlayerCollisions.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e4996adab0d5ae548ae6ef51830da0f2 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/SurvivalIsland/Assets/Scripts/PowerCell.cs b/SurvivalIsland/Assets/Scripts/PowerCell.cs index 6c41f9d..00d469a 100644 --- a/SurvivalIsland/Assets/Scripts/PowerCell.cs +++ b/SurvivalIsland/Assets/Scripts/PowerCell.cs @@ -1,25 +1,30 @@ using UnityEngine; using System.Collections; -public class PowerCell : MonoBehaviour { +public class PowerCell : MonoBehaviour +{ - public float rotationSpeed=100.0f; + public float rotationSpeed = 100.0f; // Use this for initialization - void Start () { + void Start() + { } - void OnTriggerEnter(Collider col){ - if (col.gameObject .tag == "Player") { - col.gameObject .SendMessage ("CellPickup"); - Destroy (gameObject ); + void OnTriggerEnter(Collider col) + { + if (col.gameObject.tag == "Player") + { + col.gameObject.SendMessage("CellPickup"); + Destroy(gameObject); } } // Update is called once per frame - void Update () { - transform.Rotate ( - new Vector3 (0, rotationSpeed * Time .deltaTime, 0)); + void Update() + { + transform.Rotate( + new Vector3(0, rotationSpeed * Time.deltaTime, 0)); } } diff --git a/SurvivalIsland/Assets/Scripts/PowerCell.cs.meta b/SurvivalIsland/Assets/Scripts/PowerCell.cs.meta deleted file mode 100644 index e6fb9dd..0000000 --- a/SurvivalIsland/Assets/Scripts/PowerCell.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e564b3f50537083478ebea99a84920c0 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/SurvivalIsland/Assets/Scripts/TargetCollision.cs b/SurvivalIsland/Assets/Scripts/TargetCollision.cs index 1ea8d0f..6de18d9 100644 --- a/SurvivalIsland/Assets/Scripts/TargetCollision.cs +++ b/SurvivalIsland/Assets/Scripts/TargetCollision.cs @@ -1,8 +1,9 @@ using UnityEngine; using System.Collections; -[RequireComponent (typeof (AudioSource))] -public class TargetCollision : MonoBehaviour { +[RequireComponent(typeof(AudioSource))] +public class TargetCollision : MonoBehaviour +{ bool beenHit = false; Animation targetRoot; @@ -11,35 +12,40 @@ public class TargetCollision : MonoBehaviour { public float resetTime = 3.0f; // Use this for initialization - void Start () { + void Start() + { targetRoot = transform.parent.transform.parent.animation; } - void OnCollisionEnter(Collision col) { + void OnCollisionEnter(Collision col) + { if (beenHit == false && - col.gameObject.name == "coconut") { + col.gameObject.name == "coconut") + { StartCoroutine("targetHit"); } } - IEnumerator targetHit() { - audio.PlayOneShot (hitSound); - targetRoot.Play ("down"); + IEnumerator targetHit() + { + audio.PlayOneShot(hitSound); + targetRoot.Play("down"); beenHit = true; CoconutWin.targets++; yield return new WaitForSeconds(resetTime); - audio.PlayOneShot (resetSound); - targetRoot.Play ("up"); + audio.PlayOneShot(resetSound); + targetRoot.Play("up"); beenHit = false; CoconutWin.targets--; } // Update is called once per frame - void Update () { - + void Update() + { + } } diff --git a/SurvivalIsland/Assets/Scripts/TargetCollision.cs.meta b/SurvivalIsland/Assets/Scripts/TargetCollision.cs.meta deleted file mode 100644 index bd350fe..0000000 --- a/SurvivalIsland/Assets/Scripts/TargetCollision.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 81348036fe326a44aabe9dd92dad9412 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/SurvivalIsland/Assets/Scripts/TextHints.cs b/SurvivalIsland/Assets/Scripts/TextHints.cs index 789b330..053aa3b 100644 --- a/SurvivalIsland/Assets/Scripts/TextHints.cs +++ b/SurvivalIsland/Assets/Scripts/TextHints.cs @@ -1,30 +1,37 @@ using UnityEngine; using System.Collections; -public class TextHints : MonoBehaviour { +public class TextHints : MonoBehaviour +{ - float timer =0.0f; + float timer = 0.0f; // Use this for initialization - void Start () { - + void Start() + { + } - + // Update is called once per frame - void Update () { - if (guiText.enabled) { - timer+=Time.deltaTime; - if(timer>=4){ - guiText.enabled=false; - timer=0.0f; + void Update() + { + if (guiText.enabled) + { + timer += Time.deltaTime; + if (timer >= 4) + { + guiText.enabled = false; + timer = 0.0f; } } } - void ShowHint(string message){ + void ShowHint(string message) + { guiText.text = message; - if (!guiText.enabled) { - guiText.enabled=true; + if (!guiText.enabled) + { + guiText.enabled = true; } } } diff --git a/SurvivalIsland/Assets/Scripts/TextHints.cs.meta b/SurvivalIsland/Assets/Scripts/TextHints.cs.meta deleted file mode 100644 index 21169ed..0000000 --- a/SurvivalIsland/Assets/Scripts/TextHints.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ce0e2ee8905a73d4ca6006d8924194e6 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/SurvivalIsland/Assets/Scripts/ThrowTrigger.cs b/SurvivalIsland/Assets/Scripts/ThrowTrigger.cs index 40f3aac..7427232 100644 --- a/SurvivalIsland/Assets/Scripts/ThrowTrigger.cs +++ b/SurvivalIsland/Assets/Scripts/ThrowTrigger.cs @@ -1,37 +1,45 @@ using UnityEngine; using System.Collections; -public class ThrowTrigger : MonoBehaviour { - public GUITexture crosshair; +public class ThrowTrigger : MonoBehaviour +{ + public GUITexture crosshair; public GUIText textHints; // Use this for initialization - void Start () { - - } - - // Update is called once per frame - void Update () { - + void Start() + { + } - void OnTriggerEnter(Collider col) { - if (col.gameObject.tag == "Player") { - crosshair.enabled = true; - if (!CoconutWin.haveWon) { + // Update is called once per frame + void Update() + { + + } + + void OnTriggerEnter(Collider col) + { + if (col.gameObject.tag == "Player") + { + crosshair.enabled = true; + if (!CoconutWin.haveWon) + { textHints.SendMessage("ShowHint", "\n\n\n\n\n There's a power cell attached to this game, \n" + "maybe I'll win it if I can knock down all the targets..."); } CoconutThrower.canThrow = true; - } + } } - void OnTriggerExit(Collider col) { - if (col.gameObject.tag == "Player") { - crosshair.enabled = false; + void OnTriggerExit(Collider col) + { + if (col.gameObject.tag == "Player") + { + crosshair.enabled = false; CoconutThrower.canThrow = false; - } + } } } diff --git a/SurvivalIsland/Assets/Scripts/ThrowTrigger.cs.meta b/SurvivalIsland/Assets/Scripts/ThrowTrigger.cs.meta deleted file mode 100644 index 4bfd6e0..0000000 --- a/SurvivalIsland/Assets/Scripts/ThrowTrigger.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 3ef851c593da8cd4d8fbf46996e72817 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/SurvivalIsland/Assets/Scripts/TidyObject.cs b/SurvivalIsland/Assets/Scripts/TidyObject.cs index 452c3b5..31ed4d0 100644 --- a/SurvivalIsland/Assets/Scripts/TidyObject.cs +++ b/SurvivalIsland/Assets/Scripts/TidyObject.cs @@ -1,16 +1,19 @@ using UnityEngine; using System.Collections; -public class TidyObject : MonoBehaviour { +public class TidyObject : MonoBehaviour +{ public float removeTime = 3.0f; // Use this for initialization - void Start () { - Destroy (gameObject, removeTime); + void Start() + { + Destroy(gameObject, removeTime); } - + // Update is called once per frame - void Update () { - + void Update() + { + } } diff --git a/SurvivalIsland/Assets/Scripts/TidyObject.cs.meta b/SurvivalIsland/Assets/Scripts/TidyObject.cs.meta deleted file mode 100644 index 790aac0..0000000 --- a/SurvivalIsland/Assets/Scripts/TidyObject.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 59dcc2d1f955c094fbee06fc38a0f423 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/SurvivalIsland/Assets/Scripts/TriggerZone.cs b/SurvivalIsland/Assets/Scripts/TriggerZone.cs index 0c1d7c6..cc4a844 100644 --- a/SurvivalIsland/Assets/Scripts/TriggerZone.cs +++ b/SurvivalIsland/Assets/Scripts/TriggerZone.cs @@ -1,30 +1,39 @@ using UnityEngine; using System.Collections; -public class TriggerZone : MonoBehaviour { +public class TriggerZone : MonoBehaviour +{ public AudioClip lockedSound; public Light doorLight; public GUIText textHints; - void OnTriggerEnter(Collider col){ - if (col.gameObject.tag == "Player") { - if(Inventory .charge ==4){ - transform.FindChild("door").SendMessage ("DoorCheck"); - if(GameObject.Find ("PowerGUI")){ - Destroy (GameObject .Find ("PowerGUI")); - doorLight.color=Color.green; + void OnTriggerEnter(Collider col) + { + if (col.gameObject.tag == "Player") + { + if (Inventory.charge == 4) + { + transform.FindChild("door").SendMessage("DoorCheck"); + if (GameObject.Find("PowerGUI")) + { + Destroy(GameObject.Find("PowerGUI")); + doorLight.color = Color.green; } - }else if(Inventory.charge>0&&Inventory.charge<4){ - textHints.SendMessage ("ShowHint","This door won't budge.. "+ - "guess it needs fully charging - "+ - "maybe more power cells will help"); - transform.FindChild("door").audio .PlayOneShot (lockedSound); - }else{ - transform.FindChild("door").audio .PlayOneShot (lockedSound); - col.gameObject .SendMessage ("HUDon"); - textHints.SendMessage ("ShowHint","This door seems locked.. maybe that "+ - "generator needs power..."); + } + else if (Inventory.charge > 0 && Inventory.charge < 4) + { + textHints.SendMessage("ShowHint", "This door won't budge.. " + + "guess it needs fully charging - " + + "maybe more power cells will help"); + transform.FindChild("door").audio.PlayOneShot(lockedSound); + } + else + { + transform.FindChild("door").audio.PlayOneShot(lockedSound); + col.gameObject.SendMessage("HUDon"); + textHints.SendMessage("ShowHint", "This door seems locked.. maybe that " + + "generator needs power..."); } } } @@ -32,12 +41,14 @@ public class TriggerZone : MonoBehaviour { // Use this for initialization - void Start () { - + void Start() + { + } - + // Update is called once per frame - void Update () { - + void Update() + { + } } diff --git a/SurvivalIsland/Assets/Scripts/TriggerZone.cs.meta b/SurvivalIsland/Assets/Scripts/TriggerZone.cs.meta deleted file mode 100644 index 12f1167..0000000 --- a/SurvivalIsland/Assets/Scripts/TriggerZone.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 749d278a94f759c4bb676c433e07044e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: