public override void Destroy() { base.Destroy(); this.emitterProto = null; this.emitterPool.Destroy(); this.emitterPool = null; }
void Start() { shotRendererPool = GameObject.FindObjectOfType <ShotRendererPool>(); playerHand = GameObject.FindObjectOfType <PlayerHand>(); shootingMask = LayerMask.NameToLayer("Shootable"); particlePool = GameObject.FindObjectOfType <ParticleSystemPool>(); }
private ParticleSystem CreateEmitterPoolObject(ParticleSystemPool objectPool) { GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.emitterProto.gameObject); ParticleSystem component = gameObject.GetComponent <ParticleSystem>(); this.ActivateEmitterPoolObject(component); return(component); }
// Use this for initialization void Start() { particleSystemPool = GameObject.FindGameObjectWithTag("MapLoader").GetComponent <ParticleSystemPool>(); numberGenerator = new PseudoRandomNumberGenerator(StaticGameStats.Seed); Initialize(); HuntAndKillMazeAlgorithm ma = new HuntAndKillMazeAlgorithm(cells, StaticGameStats.Seed); ma.CreateMap(); }
void Awake() { if (instance == null) { instance = this; } else { Debug.LogError("Just one Instance of Definitions allowed!"); } }
// Use this for initialization void Start() { foreach (GameObject GO in ParticleSystemTypes) { ParticleSystemPool Pool = new ParticleSystemPool(); for (int i = 0; i < MaxParticleSystems; ++i) { Pool.AddParticleSystem(Instantiate(GO) as GameObject); } m_ParticlePools.Add(GO.name, Pool); } }
void Start() { particleSystemPool = GameObject.FindGameObjectWithTag("GameController").GetComponent <ParticleSystemPool>(); audioSource = GetComponent <AudioSource>(); mainCamera = GameObject.FindGameObjectWithTag("MainCamera"); enemiesSituation = GameObject.FindGameObjectWithTag("EnemyHandler").GetComponent <EnemiesSituation>(); animatorModel = playerModel.GetComponent <Animator> (); if (isLocalPlayer) { spawnPoints = FindObjectsOfType <NetworkStartPosition>(); } }
public SingleEmitterPool(ParticleSystem emitter, EmitterReturnedToPool emitterReturnedToPool) : base(emitterReturnedToPool) { this.emitterProto = emitter; this.emitterPool = new ParticleSystemPool(new ParticleSystemPool.CreatePoolObjectDelegate(this.CreateEmitterPoolObject), new ParticleSystemPool.DestroyPoolObjectDelegate(this.DestroyEmitterPoolObject), new ParticleSystemPool.ActivatePoolObjectDelegate(this.ActivateEmitterPoolObject), new ParticleSystemPool.DeactivatePoolObjectDelegate(this.DeactivateEmitterPoolObject)); }