Пример #1
0
 void Start()
 {
     if (move != null)
     {
         move = gameObject.GetComponent <MoveToPlayer>();
     }
     else if (randMove != null)
     {
         randMove = gameObject.GetComponent <RandomWalking>();
     }
 }
Пример #2
0
 void Start()
 {
     _audio     = gameObject.GetComponent <AudioSource> ();
     _enemyData = gameObject.GetComponent <EnemyData> ();
     if (gameObject.GetComponent <RandomWalking> () != null)
     {
         _enemyMovement = gameObject.GetComponent <RandomWalking> ();
     }
     else
     {
         _moveToPlayer = gameObject.GetComponent <MoveToPlayer>();
     }
 }