// Update is called once per frame
    void Update()
    {
        //find nearest target
        if (m_target == null)
        {
            m_target = this.FindNearestHuman();
            DynamicEvade evade = m_target.GetComponent <DynamicEvade> ();
            if (evade != null)
            {
                evade.SetTarget(gameObject);
            }
        }

        if (m_target == null)
        {
            return;
        }
        this.Pursue();
        this.Arrive();
    }
Пример #2
0
 void Awake()
 {
     dynamicEvade = new DynamicEvade(GetComponent <Rigidbody>(), getTargetPosition(), getTargetVelocity(), magnitude);
 }