Exemple #1
0
 // Use this for initialization
 void Start()
 {
     if (eggSpawner == null)
     {
         eggSpawner = GameObject.Find("SpawnPoint").GetComponent <EggSpawner>();
     }
     audio = GetComponent <AudioSource>();
 }
    // Start is called before the first frame update
    void Start( )
    {
        eggSpawner = FindObjectOfType <EggSpawner>( );

        transform.position = new Vector3(0, 0, 10);
        transform.rotation = new Quaternion(0, 0, 0, 0);

        _speed         = startSpeed;
        _rotationSpeed = rotationDegrees / rotationTime;
    }
Exemple #3
0
 public void EjectSpawnEgg()
 {
     if (enemyCount < maxAttackCount)
     {
         if (gameObject.activeInHierarchy && aSource)
         {
             aSource.Play();
         }
         EggSpawner egg           = ObjectPoolManager.Spawn(eggSpawnerPrefab, transform.position, Quaternion.identity);
         Vector2    randDirection = EssoUtility.GetVectorFromAngle(Random.Range(0f, 360f));
         egg.EjectEgg(ejectForce, randDirection);
         egg.SetUpEgg(playerTransform, GetRandomEnemyFromList(), this);
     }
 }
Exemple #4
0
 private void Awake()
 {
     Instance = this;
 }
 private void Start()
 {
     _instance = this;
     Init();
 }