예제 #1
0
        void Awake()
        {
            if (!_instance)
            {
                _instance = this;
            }

            if (maxParticleCount <= 0)
            {
                Debug.LogError("maxParticleCount must be greater than zero");
            }

            _pauseStatus   = GameObject.FindObjectOfType <PauseHandler>();
            _particleArray = new CircularArray <CustomParticle> (maxParticleCount);

            for (int i = 0; i < _particleArray.Capacity; i++)
            {
                var particle = Instantiate(particlePrefab);
                particle.transform.SetParent(transform);
                particle.SetActive(false);
                _particleArray [i] = particle.GetComponent <CustomParticle> ();
            }

            CustomParticle.UpdateEffectorList();
        }
예제 #2
0
		void Awake ()
		{
			if (!_instance) {
				_instance = this;
			}

			if (maxParticleCount <= 0) {
				Debug.LogError ("maxParticleCount must be greater than zero");
			}

			_particleArray = new CircularArray<CustomParticle> (maxParticleCount);
			
			for (int i = 0; i < _particleArray.Capacity; i++) {
				var particle = Instantiate (particlePrefab);
				particle.transform.SetParent (transform);
				particle.SetActive (false);
				_particleArray [i] = particle.GetComponent<CustomParticle> ();
			}

			CustomParticle.UpdateEffectorList ();
		}