protected void StartBegin() { anim = GetComponent <Animator>(); playerObj = FindObjectOfType <SpaceShipMove>(); enemyRB = GetComponent <Rigidbody>(); enemyBattleAI = GetComponent <EnemyShipBattleAI>(); myHealth = GetComponent <Damagable>(); myHealth.enemyChHlth = OnHealthChange; myHealth.deathDel = OnDeath; LPP = FindObjectOfType <ListPathPoints>(); waypoints = LPP.GetPath(indexOfPath); waypointsCoord = new List <Vector3>(); foreach (Transform tr in waypoints) { waypointsCoord.Add(tr.position); } currWayIndex = 0; currWayPoint = waypointsCoord[currWayIndex]; addedWayIndex = -1; increment = 1; isUnderAttack = false; obstacleRunawayState = false; }
// Start is called before the first frame update void Start() { fixedLeftCannonPos = leftCannon.transform.localPosition; fixedRightCannonPos = rightCannon.transform.localPosition; anim = gameObject.GetComponent <Animator>(); enemyBattleAI = gameObject.GetComponent <EnemyShipBattleAI>(); Damagable myHealth = GetComponent <Damagable>(); myHealth.enemyChHlth = OnHealthChange; myHealth.deathDel = OnMyDeath; timer = timeToLookForPlayer; }