Beispiel #1
0
        public static AudioSource PlayClip(ExtendedAudioClip clip, float fadeDuration, Vector3 position)
        {
            AudioSource source = pool.GetAvailable(null, true, position, Quaternion.identity).source;

            if (source.Play(clip, fadeDuration))
            {
                return(source);
            }
            return(null);
        }
Beispiel #2
0
        public static AudioSource PlayClip(ExtendedAudioClip clip, float fadeDuration, Vector3 position)
        {
            AudioSource source = pool.GetAvailable().source;

            source.transform.position = position;
            if (source.Play(clip, fadeDuration))
            {
                return(source);
            }
            return(null);
        }
Beispiel #3
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);
        }