Beispiel #1
0
        public IEnumerator AddPropertyEffect(AttachableEffect attachableEffect, PropertyId propertyId)
        {
            VisualEffect visualEffect = attachableEffect.InstantiateMainEffect(m_attachableEffectsContainer, this);

            if (null != visualEffect)
            {
                m_propertyEffects.Add(propertyId, visualEffect);
                visualEffect.Play();
            }
            yield return((object)new WaitForTime(attachableEffect.mainEffectDelay));
        }
Beispiel #2
0
        public IEnumerator RemovePropertyEffect(AttachableEffect attachableEffect, PropertyId propertyId)
        {
            if (m_propertyEffects.TryGetValue(propertyId, out VisualEffect value))
            {
                if (null != value)
                {
                    value.Stop();
                }
                m_propertyEffects.Remove(propertyId);
            }
            VisualEffect visualEffect = attachableEffect.InstantiateStopEffect(m_attachableEffectsContainer, this);

            if (null != visualEffect)
            {
                visualEffect.Play();
            }
            yield return((object)new WaitForTime(attachableEffect.stopEffectDelay));
        }
 public static bool TryGetPropertyEffect(PropertyId propertyId, out AttachableEffect attachableEffect)
 {
     return(s_propertyEffectCache.TryGetValue(propertyId, out attachableEffect));
 }