Browse Source

fixed catapult behaviour, and added another catapult in lvl 2 (one per lighthouse, so can turn off)

master
KG 7 years ago
parent
commit
7c88fac33c
3 changed files with 11 additions and 3 deletions
  1. +1
    -1
      IronToad_UnityProject/Assets/Scripts/Boulder.cs
  2. +10
    -2
      IronToad_UnityProject/Assets/Scripts/Catapult.cs
  3. BIN
      IronToad_UnityProject/Assets/_Scenes/IGDA_Lighthouse.unity

+ 1
- 1
IronToad_UnityProject/Assets/Scripts/Boulder.cs View File

@ -41,7 +41,7 @@ public class Boulder : HeavyObject
NotificationServer.notify("play sfx", "runAground:1"); NotificationServer.notify("play sfx", "runAground:1");
Destroy(Instantiate(Explosion, transform.position, Quaternion.identity), 6); Destroy(Instantiate(Explosion, transform.position, Quaternion.identity), 6);
} }
NotificationServer.notify("BoulderHit");
NotificationServer.notify("BoulderHit", gameObject);
} }

+ 10
- 2
IronToad_UnityProject/Assets/Scripts/Catapult.cs View File

@ -43,7 +43,7 @@ public class Catapult : MonoBehaviour
NotificationServer.register("statechange Searchlight", searchlightStateChanged); NotificationServer.register("statechange Searchlight", searchlightStateChanged);
NotificationServer.register("BoulderHit", boulderHit); NotificationServer.register("BoulderHit", boulderHit);
NotificationServer.register("restart scene", boulderHit);
NotificationServer.register("restart scene", restartScene);
} }
void Update() void Update()
@ -61,8 +61,16 @@ public class Catapult : MonoBehaviour
launchBoulder(); 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); LeanTween.cancel(splineObjectTranslate.ObjectToManipulate.gameObject, true);
} }

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


Loading…
Cancel
Save