Ejemplo n.º 1
0
        /**
         * <summary>Creates a new instance of the 'Sound: Set Mixer snapshot' Action, set to play a single snapshot</summary>
         * <param name = "snapshot">The snapshot to play</param>
         * <param name = "transitionTime">The time, in seconds, to take when transitioning</param>
         * <param name = "waitUntilFinish">If True, then the Action will wait until the transition is complete</param>
         * <returns>The generated Action</returns>
         */
        public static ActionMixerSnapshot CreateNew_Single(AudioMixerSnapshot snapshot, float transitionTime = 0f, bool waitUntilFinish = false)
        {
            ActionMixerSnapshot newAction = (ActionMixerSnapshot)CreateInstance <ActionMixerSnapshot>();

            newAction.numSnapshots = 1;
            newAction.snapshot     = snapshot;
            newAction.changeTime   = transitionTime;
            newAction.willWait     = waitUntilFinish;
            return(newAction);
        }
Ejemplo n.º 2
0
        /**
         * <summary>Creates a new instance of the 'Sound: Set Mixer snapshot' Action, set to mix multiple snapshots together</summary>
         * <param name = "snapshotMixData">A list of data related to the snapshots to mix</param>
         * <param name = "audioMixer">The AudioMixer to play the snapshots on</param>
         * <param name = "transitionTime">The time, in seconds, to take when transitioning</param>
         * <param name = "waitUntilFinish">If True, then the Action will wait until the transition is complete</param>
         * <returns>The generated Action</returns>
         */
        public static ActionMixerSnapshot CreateNew_Mix(List <SnapshotMix> snapshotMixData, AudioMixer audioMixer, float transitionTime = 0f, bool waitUntilFinish = false)
        {
            ActionMixerSnapshot newAction = (ActionMixerSnapshot)CreateInstance <ActionMixerSnapshot>();

            newAction.numSnapshots  = 0;
            newAction.audioMixer    = audioMixer;
            newAction.snapshotMixes = snapshotMixData;
            newAction.changeTime    = transitionTime;
            newAction.willWait      = waitUntilFinish;
            return(newAction);
        }