Example #1
0
 static bool ProfileIsActive(PostProcessProfile profile, out ImageSpaceModifier mod)
 {
     for (int i = 0; i < activeModifiers.Count; i++)
     {
         if (activeModifiers[i].profile == profile)
         {
             mod = activeModifiers[i];
             return(true);
         }
     }
     mod = null;
     return(false);
 }
Example #2
0
        public static bool AddImageSpaceModifier(PostProcessProfile profile, float fadeIn, float duration, float fadeOut, AnimationCurve anim, float animCycle)
        {
            if (profile == null)
            {
                Debug.LogWarning("Add: Post Prcess profile is null");
                return(false);
            }

            if (ProfileIsActive(profile, out _))
            {
                Debug.LogWarning("Add: Post Prcess profile: " + profile.name + " is already active in an image space modifier");
                return(false);
            }


            ImageSpaceModifier mod = pool.GetAvailable(null, true);

            activeModifiers.Add(mod);
            mod.InitializeModifier(profile, fadeIn, duration, fadeOut, anim, animCycle, activeModifiers.Count);
            // Debug.Log("Adding profile: " + profile.name);
            return(true);
        }
 protected override bool OnEffectStart(DynamicObject caster, DynamicObject target, float magnitude, float duration)
 {
     // if we're keeping in the effects list, let the game effect handle duration....
     return(ImageSpaceModifier.AddImageSpaceModifier(mod.profile, mod.fadeIn, keepInEffectsList ? 0 : mod.duration, mod.fadeOut, mod.anim, mod.animCycle));
 }
 public override void OnEffectRemove(DynamicObject caster, DynamicObject target, float magnitude, float duration)
 {
     ImageSpaceModifier.RemoveImageSpaceModifier(mod.profile, mod.fadeOut);
 }