Beispiel #1
0
        public AgentState GetState()
        {
            if (_state==null)
                _state=_agent.GetComponent<AgentAI>()._state;

            return _state;
        }
Beispiel #2
0
        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;

            }
        }
Beispiel #3
0
 // 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();
        }