void FightStateUpdate() { if (m_Target == null) { m_Target = FindTargetInRadius(); } else { bool moveToTarget = false; } }
void FightStateUpdate() { if (m_Target == null) { m_Target = FindTargetInRadius(); } else { bool moveToTarget = false; TryAttack(out moveToTarget); if (moveToTarget) { MoveToTarget(); } } }
public SkillTest FindTargetInRadius() { Collider[] colliders = Physics.OverlapSphere(transform.position, 100, 1 << LayerMask.NameToLayer("Warrior")); foreach (Collider collider in colliders) { SkillTest unit = collider.gameObject.GetComponent <SkillTest>(); if (unit == null) { continue; } if (unit == this) { continue; } return(unit); } return(null); }
private void Awake() { SkillTest.ins = this; UnityEngine.Object.DontDestroyOnLoad(base.gameObject); }