Ejemplo n.º 1
0
        public void GivePlayerFlipToken()
        {
            UnitDeathEvent deathEvent = new UnitDeathEvent
            {
                UnitGameObject   = gameObject,
                EventDescription = "Unit " + gameObject.name + " has died."
            };

            SoundEvent soundEvent = new SoundEvent
            {
                EventDescription = "Noise " + deathNoise + " is playing.",
                UnitGameObject   = this.gameObject,
                audioSource      = audioSource,
                sound            = deathNoise
            };

            ParticleEvent particleEvent = new ParticleEvent
            {
                EventDescription = "Particles " + deathParticles + " is playing.",
                UnitGameObject   = this.gameObject,
                particles        = deathParticles
            };

            events.Add(soundEvent);
            events.Add(particleEvent);
            events.Add(deathEvent);

            canGiveToken = true;
        }
Ejemplo n.º 2
0
        void OnUnitDied(ParticleEvent particleEvent)
        {
            Debug.Log("Particles: " + particleEvent.particles);

            if (particleEvent.particles != null)
            {
                Instantiate(particleEvent.particles, particleEvent.UnitGameObject.transform.position,
                            particleEvent.UnitGameObject.transform.rotation);
            }
        }