void Start() { if (move != null) { move = gameObject.GetComponent <MoveToPlayer>(); } else if (randMove != null) { randMove = gameObject.GetComponent <RandomWalking>(); } }
void Start() { _audio = gameObject.GetComponent <AudioSource> (); _enemyData = gameObject.GetComponent <EnemyData> (); if (gameObject.GetComponent <RandomWalking> () != null) { _enemyMovement = gameObject.GetComponent <RandomWalking> (); } else { _moveToPlayer = gameObject.GetComponent <MoveToPlayer>(); } }