/// <summary> If the Animal has a IMountAI component it can be called</summary> public virtual void CallAnimal(bool call) { if (!CanCallAnimal) { return; } if (MountStored) //Call the animal Stored { MonturaAI = MountStored.GetComponent <IAIControl>(); if (MonturaAI != null) { ToggleCall = call; if (ToggleCall) { MonturaAI.SetTarget(transform); //Set the Rider as the Target to follow if (CallAnimalA) { RiderAudio.PlayOneShot(CallAnimalA); } } else { StopMountAI(); if (StopAnimalA) { RiderAudio.PlayOneShot(StopAnimalA); } } } } }
public virtual void StopMountAI() { if (Montura.MountInput != null && MonturaAI != null) { MonturaAI.Stop(); MonturaAI.SetTarget(null); } }