Ejemplo n.º 1
0
        // Token: 0x0600280C RID: 10252 RVA: 0x000F27F0 File Offset: 0x000F0BF0
        public static Transform createUIEffect(ushort id, short key)
        {
            EffectAsset effectAsset = (EffectAsset)Assets.find(EAssetType.EFFECT, id);

            if (effectAsset == null)
            {
                return(null);
            }
            Transform transform = UnityEngine.Object.Instantiate <GameObject>(effectAsset.effect).transform;

            transform.name = id.ToString();
            transform.SetParent(Level.effects);
            if (key == -1)
            {
                if (effectAsset.lifetime > 1.401298E-45f)
                {
                    EffectManager.Destroy(transform.gameObject, effectAsset.lifetime + UnityEngine.Random.Range(-effectAsset.lifetimeSpread, effectAsset.lifetimeSpread));
                }
            }
            else
            {
                GameObject element;
                if (EffectManager.indexedUIEffects.TryGetValue(key, out element))
                {
                    EffectManager.Destroy(element);
                    EffectManager.indexedUIEffects.Remove(key);
                }
                EffectManager.indexedUIEffects.Add(key, transform.gameObject);
            }
            return(transform);
        }
Ejemplo n.º 2
0
 public void tellEffectClearAll(CSteamID steamID)
 {
     if (base.channel.checkServer(steamID))
     {
         for (int i = 0; i < Level.effects.childCount; i++)
         {
             Transform child = Level.effects.GetChild(i);
             if (child.gameObject.activeSelf)
             {
                 if (!(child.name == "System"))
                 {
                     EffectManager.Destroy(child.gameObject);
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
 public void tellEffectClearByID(CSteamID steamID, ushort id)
 {
     if (base.channel.checkServer(steamID))
     {
         string b = id.ToString();
         for (int i = 0; i < Level.effects.childCount; i++)
         {
             Transform child = Level.effects.GetChild(i);
             if (child.gameObject.activeSelf)
             {
                 if (!(child.name != b))
                 {
                     EffectManager.Destroy(child.gameObject);
                 }
             }
         }
     }
 }
Ejemplo n.º 4
0
 private void destroyEffects()
 {
     if (this.tracerEmitter != null)
     {
         EffectManager.Destroy(this.tracerEmitter.gameObject);
         this.tracerEmitter = null;
     }
     if (this.muzzleEmitter != null)
     {
         EffectManager.Destroy(this.muzzleEmitter.gameObject);
         this.muzzleEmitter = null;
     }
     if (this.shellEmitter != null)
     {
         EffectManager.Destroy(this.shellEmitter.gameObject);
         this.shellEmitter = null;
     }
 }