public AgentState GetState() { if (_state==null) _state=_agent.GetComponent<AgentAI>()._state; return _state; }
void Start() { _state = GetComponent<AgentAI>()._state; _cooldown = Time.time; if (_state != null && _state.CanHeal) { healingSphere=GameObject.CreatePrimitive(PrimitiveType.Sphere); healingSphere.transform.parent = gameObject.transform; healingSphere.transform.localPosition = Vector3.zero; healingSphere.transform.localScale = new Vector3(_state.HealRange, _state.HealRange); _col=healingSphere.GetComponent<SphereCollider>(); healingSphere.renderer.enabled = false; } }
// Use this for initialization void Start() { _state=GetComponent<AgentAI>()._state; }
// Use this for initialization void Start() { agentState=GetComponent<AgentAI>()._state; seek = GetComponent<Seeker>(); movementController = GetComponent<CharacterController>(); // StartupNode(); /*if (agentState.MovementTarget != null){ movementTarget = agentState.MovementTarget.transform; } /*else { GameObject o = new GameObject(); Vector3 pos=Random.insideUnitSphere * 25f; pos.y = 0f; o.transform.position=pos; movementTarget = o.transform; }*/ RecalculatePath(); }