// 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; }
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); } }
private void Awake() { Instance = this; }
private void Start() { _instance = this; Init(); }