protected override void Awake() { base.Awake(); rotate = GetComponentInChildren <EnemyRotate>(); if (path.Length > 0) { transform.position = path[0]; if (path.Length > 1) { canPatrol = true; pathIndex = 1; Patrol(); } } }
private void Start() { enemyRotate = GetComponent <EnemyRotate>(); if (SceneManager.GetActiveScene().buildIndex == 0) { moveSpeed = initialMoveSpeed; rotationSpeed = initialRotationSpeed; return; } if (AllEnemies.instance.isInAlert || AllEnemies.instance.isInWarning) { return; } moveSpeed = initialMoveSpeed; rotationSpeed = initialRotationSpeed; }
public void Start() { pathable = GetComponentInParent <PathableObject>(); rotate = GetComponent <EnemyRotate>(); }