Beispiel #1
0
        /// <summary>
        /// Update is called once per frame
        /// </summary>
        void Update()
        {
            m_timeSinceLastAttack += Time.deltaTime;

            //If no target or target is dead then return and don't do anything.
            if (m_Target == null)
            {
                return;
            }
            if (m_Target.IsDead())
            {
                return;
            }

            if (!InWeaponRange(m_Target.transform))
            {
                m_Mover.MoveTo(m_Target.transform.position);
            }
            else
            {
                m_Mover.Cancel();
                AttackBehavoir();
            }
        }