public void RegisterFish(WhaleBehaviour whale) { Health hlth = whale.GetComponent <Health>(); hlth.onDie.AddListener(FishTakenAway); hlth.onHealed.AddListener(FishSaved); remainingFishes++; Debug.Log("Fishes total " + remainingFishes); }
private void Update() { if (!returnToBase) { if (Trgtwhale == null) { Trgtwhale = WhaleTargeter.singleton.getNextTarget(); } if (Trgtwhale) { ai.SetDestination(Trgtwhale.transform.position); } } else { ReturnToBase(); } }
private void Start() { base.Start(); harpoon = GetComponent <HarpoonLauncher>(); harpoon.GotEnoughFishes.AddListener(EnoughFish); GameManager.instance.RegisterWhaler(); Health mHlth = GetComponent <Health>(); mHlth.onDie.AddListener(GameManager.instance.WhalerDestroyed); WorldUI.instance.CreateShipPointer(transform); mHlth.onDie.AddListener(ReleaseFish); Trgtwhale = WhaleTargeter.singleton.getNextTarget(); if (!Trgtwhale) { Destroy(gameObject); } harpoon.SetTarget(Trgtwhale); }
public void WhaleDead(WhaleBehaviour whale) { whales.Remove(whale); }
public void SetTarget(WhaleBehaviour trgt) { targetWhale = trgt; }