Пример #1
0
        public static RailgunEffectComp Spawn(Map map)
        {
            var spawned = EffectPool <RailgunEffectComp> .Get(() => Object.Instantiate(Prefab).AddComponent <RailgunEffectComp>());

            Object.DontDestroyOnLoad(spawned.gameObject);
            spawned.Setup(map);

            return(spawned);
        }
        public void Stop()
        {
            ParticleSystem.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
            gameObject.SetActive(false);

            Despawn?.Invoke(this);
            Despawn = null;
            EffectPool <ExplosionEffect> .Return(this);
        }
Пример #3
0
        public static ExplosionEffect Spawn(Map map, Vector3 pos, float size)
        {
            var spawned = EffectPool <ExplosionEffect> .Get(() => Object.Instantiate(Prefab).AddComponent <ExplosionEffect>());

            Object.DontDestroyOnLoad(spawned.gameObject);
            spawned.Time     = 0.7f;
            spawned.Despawn += (s) =>
            {
                list.Remove(s);
            };

            list.Add(spawned);

            spawned.Play(map, pos, size);

            return(spawned);
        }