public static UtilityBehaviourAI Initialize(TurrelEnemy enemy) { MovementController ctr = new TurrelEnemyController(enemy); instance.AddController(ctr); return(instance); }
/* --------------------------------------------------------------------------------------------*/ /* --------------------------------------------------------------------------------------------*/ /* --------------------------------------------------------------------------------------------*/ /* ------------------------------------ ACTIONS FUNCTIONS -------------------------------------*/ /* --------------------------------------------------------------------------------------------*/ /* --------------------------------------------------------------------------------------------*/ /* --------------------------------------------------------------------------------------------*/ public override IEnumerator Attack(MovementController ctr, UtilityAction act) { act.isStoppable = false; TurrelEnemyController enemy = ctr as TurrelEnemyController; Vector3 target = player.position + player.up * 0.5f; yield return(StartCoroutine(enemy.ShootAt(target))); act.isRunning = false; }