Beispiel #1
0
 public override void Destroy()
 {
     base.Destroy();
     this.emitterProto = null;
     this.emitterPool.Destroy();
     this.emitterPool = null;
 }
Beispiel #2
0
    void Start()
    {
        shotRendererPool = GameObject.FindObjectOfType <ShotRendererPool>();

        playerHand   = GameObject.FindObjectOfType <PlayerHand>();
        shootingMask = LayerMask.NameToLayer("Shootable");
        particlePool = GameObject.FindObjectOfType <ParticleSystemPool>();
    }
Beispiel #3
0
        private ParticleSystem CreateEmitterPoolObject(ParticleSystemPool objectPool)
        {
            GameObject     gameObject = UnityEngine.Object.Instantiate <GameObject>(this.emitterProto.gameObject);
            ParticleSystem component  = gameObject.GetComponent <ParticleSystem>();

            this.ActivateEmitterPoolObject(component);
            return(component);
        }
Beispiel #4
0
    // 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);
        }
    }
Beispiel #7
0
    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>();
        }
    }
Beispiel #8
0
 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));
 }