Beispiel #1
0
 private void Awake()
 {
     _poolingAgent       = _poolingAgent.SetUpPoolingAgent(GetComponents <PoolingAgent>(), PoolingID.Weapons);
     _audioSource        = GetComponent <AudioSource>();
     _audioSource.clip   = _laserSFX;
     _audioSource.volume = _volume;
 }
Beispiel #2
0
 private void Awake()
 {
     _partOfWave   = GetComponentInParent <IEnemyWave>();
     _mySprite     = GetComponentInChildren <SpriteRenderer>();
     _collider2D   = GetComponentInChildren <Collider2D>();
     _poolingAgent = _poolingAgent.SetUpPoolingAgent(GetComponents <PoolingAgent>(), PoolingID.FX);
 }
Beispiel #3
0
 private void Awake()
 {
     _startingHealth = _health;
     _poolingAgent   = _poolingAgent.SetUpPoolingAgent(GetComponents <PoolingAgent>(), PoolingID.FX);
     _myDamage       = GetComponent <IShowDamage>();
     _myAudioSource  = GetComponent <AudioSource>();
     if (cheat)
     {
         Debug.Log("Cheat ON");
     }
 }
    //Pooling Agent

    public static PoolingAgent SetUpPoolingAgent(this PoolingAgent agentToSet, PoolingAgent[] array, PoolingID poolingID)
    {
        foreach (var item in array)
        {
            if (item._poolType == poolingID)
            {
                return(item);
            }
        }
        return(null);
    }
Beispiel #5
0
    private void Awake()
    {
        _poolingAgent = _poolingAgent.SetUpPoolingAgent(GetComponents <PoolingAgent>(), PoolingID.UIElement);
        _mainCamera   = Camera.main;
        int index = 0;

        numberOfEnemiesInWave = transform.childCount;
        enemiesLeft           = numberOfEnemiesInWave;
        enemies = new GameObject[enemiesLeft];
        foreach (Transform child in transform)
        {
            enemies[index] = child.gameObject;
            index++;
        }
    }
Beispiel #6
0
 private void Awake()
 {
     _audioSource  = GetComponent <AudioSource>();
     _poolingAgent = _poolingAgent.SetUpPoolingAgent(GetComponents <PoolingAgent>(), PoolingID.Weapons);
 }
Beispiel #7
0
 private void Awake()
 {
     _poolingAgent = GetComponent <PoolingAgent>();
     ActiveTargets = new List <GameObject>();
 }
Beispiel #8
0
 private void Awake()
 {
     _poolingAgent = _poolingAgent.SetUpPoolingAgent(GetComponents <PoolingAgent>(), PoolingID.FX);
     _startingPos  = transform.localPosition;
 }