diff --git a/IronToad_UnityProject/Assets/Scripts/Boulder.cs b/IronToad_UnityProject/Assets/Scripts/Boulder.cs index 7ac707f..38f72d8 100644 --- a/IronToad_UnityProject/Assets/Scripts/Boulder.cs +++ b/IronToad_UnityProject/Assets/Scripts/Boulder.cs @@ -41,7 +41,7 @@ public class Boulder : HeavyObject NotificationServer.notify("play sfx", "runAground:1"); Destroy(Instantiate(Explosion, transform.position, Quaternion.identity), 6); } - NotificationServer.notify("BoulderHit"); + NotificationServer.notify("BoulderHit", gameObject); } diff --git a/IronToad_UnityProject/Assets/Scripts/Catapult.cs b/IronToad_UnityProject/Assets/Scripts/Catapult.cs index e47d900..0a5b4ef 100644 --- a/IronToad_UnityProject/Assets/Scripts/Catapult.cs +++ b/IronToad_UnityProject/Assets/Scripts/Catapult.cs @@ -43,7 +43,7 @@ public class Catapult : MonoBehaviour NotificationServer.register("statechange Searchlight", searchlightStateChanged); NotificationServer.register("BoulderHit", boulderHit); - NotificationServer.register("restart scene", boulderHit); + NotificationServer.register("restart scene", restartScene); } void Update() @@ -61,8 +61,16 @@ public class Catapult : MonoBehaviour launchBoulder(); } - public void boulderHit() + public void boulderHit(object boulderObj) { + GameObject go = boulderObj as GameObject; + if (go == splineObjectTranslate.ObjectToManipulate.gameObject) + LeanTween.cancel(splineObjectTranslate.ObjectToManipulate.gameObject, true); + } + + public void restartScene() + { + searchState = Searchlight.SearchState.Spline; LeanTween.cancel(splineObjectTranslate.ObjectToManipulate.gameObject, true); } diff --git a/IronToad_UnityProject/Assets/_Scenes/IGDA_Lighthouse.unity b/IronToad_UnityProject/Assets/_Scenes/IGDA_Lighthouse.unity index 5964585..49a9009 100644 Binary files a/IronToad_UnityProject/Assets/_Scenes/IGDA_Lighthouse.unity and b/IronToad_UnityProject/Assets/_Scenes/IGDA_Lighthouse.unity differ