public override void Enter(AnimalAgent agent) //Do Upon Start of Action { _target = agent.GetTarget(); if (_target) { _supply = _target.GetComponent <ResourceManager>(); } }
public override void UpdateAction(AnimalAgent agents) { if (_target != null && _supply.GetSupply()) { agents.NavMeshAgent.SetDestination(_target.transform.position); } else if (_supply.GetSupply() == false) { _target = agents.GetTarget(); _supply = _target.GetComponent <ResourceManager>(); } if (_target.transform.position.magnitude - agents.transform.position.magnitude < 1f) { _supply.SetSupply(false); agents.Hunger = 0; } }