public override void OnSpawn() { base.OnSpawn(); if (RightHand is ProjectileWeapon) _brain = new RangedAI(this); else _brain = new CombatAI(this); }
private void Awake() { ai = GetComponent <RangedAI>(); Target = ai.target; MaxHealth = health; enemyRenderer = GetComponentInChildren <Renderer>(); originalMaterial = enemyRenderer.material; attackTimer = timeBetweenAttacks * 0.5f; TimeBetweenAttacks = timeBetweenAttacks; EnemyAudioSource = GetComponent <AudioSource>(); GamesManager = GameObject.FindWithTag("GameManagement").GetComponent <GameManagement>(); }
/// <inheritdoc/> public override void OnSpawn() { base.OnSpawn(); if (_brain != null) { return; } if (RightHand is ProjectileWeapon) { _brain = new RangedAI(this); } else { _brain = new CombatAI(this); } }
public void Release() { owner = null; }
public void Claim(RangedAI ai) { owner = ai; }