diff --git a/IronToad_UnityProject/Assets/Scripts/LightBeam.cs b/IronToad_UnityProject/Assets/Scripts/LightBeam.cs index 6340672..3138f02 100644 --- a/IronToad_UnityProject/Assets/Scripts/LightBeam.cs +++ b/IronToad_UnityProject/Assets/Scripts/LightBeam.cs @@ -10,6 +10,7 @@ public class LightBeam : MonoBehaviour { // Use this for initialization void Start () { NotificationServer.register("statechange Searchlight", toggleState); + NotificationServer.register("switch off", switchOff); } // Update is called once per frame @@ -26,4 +27,9 @@ public class LightBeam : MonoBehaviour { private void toggleState() { GetComponent().SetBool("isSeen", (Searchlight.state == Searchlight.SearchState.Chasing)); } + + private void switchOff() { + lightBeam.gameObject.SetActive(false); + target.gameObject.SetActive(false); + } } diff --git a/IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs b/IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs index 80827a0..2ae4601 100644 --- a/IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs +++ b/IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs @@ -57,5 +57,6 @@ public class LighthouseLanding : MonoBehaviour switchedOff = true; NotificationServer.notify("hide TakeoverButton"); NotificationServer.notify("play sfx", "assassination"); - } + NotificationServer.notify("switch off"); + } } diff --git a/IronToad_UnityProject/Assets/Scripts/PlayerController.cs b/IronToad_UnityProject/Assets/Scripts/PlayerController.cs index 4327d9a..fc0a178 100644 --- a/IronToad_UnityProject/Assets/Scripts/PlayerController.cs +++ b/IronToad_UnityProject/Assets/Scripts/PlayerController.cs @@ -19,12 +19,17 @@ public class PlayerController : MonoBehaviour { public GameObject[] lifeHearts; + private Vector3 startPoint; + public GameObject boat; + + void Start() { NotificationServer.register("show GameUI", showGameUI); NotificationServer.register("hide GameUI", hideGameUI); instance = this; + startPoint = boat.transform.position; } @@ -83,4 +88,10 @@ public class PlayerController : MonoBehaviour { isLocked = true; } + public void restartScene() { + setLife(3); + boat.transform.position = startPoint; + boat.GetComponent().velocity = Vector3.zero; + } + } diff --git a/IronToad_UnityProject/Assets/Sound.meta~HEAD_0 b/IronToad_UnityProject/Assets/Sound.meta~HEAD_0 new file mode 100644 index 0000000..9d54175 --- /dev/null +++ b/IronToad_UnityProject/Assets/Sound.meta~HEAD_0 @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e3b0c439ea6f28c4fb3ce6bc58682b6b +folderAsset: yes +timeCreated: 1485052873 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Sound/Music.meta b/IronToad_UnityProject/Assets/Sound/Music.meta index 44ebcac..57e02b3 100644 --- a/IronToad_UnityProject/Assets/Sound/Music.meta +++ b/IronToad_UnityProject/Assets/Sound/Music.meta @@ -1,8 +1,15 @@ fileFormatVersion: 2 +<<<<<<< HEAD +guid: f58a00a3100922d4288203443c54d1a5 +folderAsset: yes +timeCreated: 1485052873 +licenseType: Pro +======= guid: be2c14b0c562c483bbe057367939b479 folderAsset: yes timeCreated: 1485052376 licenseType: Free +>>>>>>> 497ca195525b3f1160bab1491e71a9a013e118fb DefaultImporter: userData: assetBundleName: diff --git a/IronToad_UnityProject/Assets/Sound/SFX.meta b/IronToad_UnityProject/Assets/Sound/SFX.meta index 2d35fa0..fd92b5d 100644 --- a/IronToad_UnityProject/Assets/Sound/SFX.meta +++ b/IronToad_UnityProject/Assets/Sound/SFX.meta @@ -1,8 +1,15 @@ fileFormatVersion: 2 +<<<<<<< HEAD +guid: d96f9b1229b84cb41b71f2332674b8e1 +folderAsset: yes +timeCreated: 1485052873 +licenseType: Pro +======= guid: bb5698073b8d847298f0287fcfbdd0de folderAsset: yes timeCreated: 1485052376 licenseType: Free +>>>>>>> 497ca195525b3f1160bab1491e71a9a013e118fb DefaultImporter: userData: assetBundleName: