Beispiel #1
0
        public void RegisterFish(WhaleBehaviour whale)
        {
            Health hlth = whale.GetComponent <Health>();

            hlth.onDie.AddListener(FishTakenAway);
            hlth.onHealed.AddListener(FishSaved);
            remainingFishes++;
            Debug.Log("Fishes total " + remainingFishes);
        }
Beispiel #2
0
 private void Update()
 {
     if (!returnToBase)
     {
         if (Trgtwhale == null)
         {
             Trgtwhale = WhaleTargeter.singleton.getNextTarget();
         }
         if (Trgtwhale)
         {
             ai.SetDestination(Trgtwhale.transform.position);
         }
     }
     else
     {
         ReturnToBase();
     }
 }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 public void WhaleDead(WhaleBehaviour whale)
 {
     whales.Remove(whale);
 }
Beispiel #5
0
 public void SetTarget(WhaleBehaviour trgt)
 {
     targetWhale = trgt;
 }