// Start is called before the first frame update void Start() { controller = GetComponent <EnemyFunctions>(); corePos = GameObject.Find("Core").transform; targetPos = null; aiState = AiStates.GoToAndAttackCore; }
protected virtual void setUpBPandFUNCS() { bp = new EnemyBulletPatterns(trans); funcs = new EnemyFunctions(trans); shootingCoroutines = new Coroutine[bp.getCount()]; functionCoroutines = new Coroutine[funcs.getCount()]; }
public void EnemyStart() { foreach (Transform enemy in gameObject.transform) { EnemyFunctions tempenemy = enemy.gameObject.GetComponent <EnemyFunctions>(); tempenemy.EnemyPrepare(); } }
// Update is called once per frame void Update() { if (!CanFire()) { return; } Vector3 direction = (target.position - transform.position).normalized; if (EnemyFunctions.CanSeeTarget(transform, target, "Player", maxRange))// CanSeeTarget()) { gun.Fire(direction); timeSinceFiring = 0.0f; } }
// Update is called once per frame protected override void Update() { if (EnemyFunctions.CanSeeTarget(transform, chaseTarget, "Player", 100)) { destination = chaseTarget.position; } else { Vector2 moveDirection = agent.velocity.normalized; if (moveDirection == Vector2.zero || agent.pathStatus == UnityEngine.AI.NavMeshPathStatus.PathInvalid) { destination = EnemyFunctions.RandomNavSphere(transform.position, maxRoamRange, -1); } } base.Update(); }
public IEnumerator ProceedEnemyActions() { //foreach(GameObject enemy in enemyList) //{ // enemy.GetComponent<BasicEnemy>().EnemyAct(); // yield return new WaitForSeconds(.2f); //} foreach (Transform enemy in enemyHolder.transform) { //enemy.gameObject.GetComponent<EnemyActionsLogic>().EnemyAct(); //yield return new WaitForSeconds(.5f); EnemyFunctions enemyFunctions = enemy.gameObject.GetComponent <EnemyFunctions>(); enemyFunctions.EnemyAct(); yield return(new WaitForSeconds(.5f)); } //player.GetComponent<BaseUnitFunctions>().RemoveBlock(); Debug.Log("Losing block"); yield return(new WaitForSeconds(1f)); //delegate for startTurn Event d_StartTurn(); }