public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { this.prey = animator.gameObject; this.preyAi = prey.GetComponent <PreyAi>(); this.player = preyAi.player; this.wayPoints = preyAi.wayPoints; this.currentWayPoint = preyAi.currentWayPoint; this.agent = preyAi.GetNavMeshAgent(); }
private void OnTriggerEnter(Collider other) { Debug.Log(other.gameObject.name); if (other.GetComponent <PreyAi>() != null) { this.preyAi = other.GetComponent <PreyAi>(); this.preyAi.Respawn(); this.preyAi = null; popUpAnimator.SetTrigger(Captured); } }
// Start is called before the first frame update new void Start() { base.Start(); Ai = new PreyAi(this); this.Diet.Add("plant"); //this.Diet.Add("tree"); this.Predetors.Add("wolf"); this.Predetors.Add("bear"); Speed = 105.0f; ChaseSpeed = 160.0f; nutrition = 38f; }
//public GameObject preyDieParticle; // Start is called before the first frame update new void Start() { base.Start(); Ai = new PreyAi(this); this.Diet.Add("tree"); this.Predetors.Add("wolf"); this.Predetors.Add("bear"); //GetComponent<Renderer>().material.SetColor("_Color", Color.green); Speed = 105.0f; ChaseSpeed = 128.0f; nutrition = 35f; //this.particle = preyDieParticle; }