-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SceneManagerPatcher Fix Stuff for it to work correctly - Add CueHolder Up Version Number
- Loading branch information
Showing
13 changed files
with
746 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using HutongGames.PlayMaker.Actions; | ||
using SFCore.Utils; | ||
using UnityEngine; | ||
using UnityEngine.Audio; | ||
|
||
namespace SFCore.MonoBehaviours | ||
{ | ||
internal static class CueHolder | ||
{ | ||
public static Dictionary<string, MusicCue> MusicCues = new Dictionary<string, MusicCue>(); | ||
public static Dictionary<string, AtmosCue> AtmosCues = new Dictionary<string, AtmosCue>(); | ||
|
||
public static MusicCue GetMusicCue(string set, AudioMixerSnapshot snapshot, AudioClip[] clips, SceneManagerPatcher.MusicChannelSync[] syncs) | ||
{ | ||
if (!MusicCues.ContainsKey(set)) | ||
{ | ||
var tmpMC = ScriptableObject.CreateInstance<MusicCue>(); | ||
tmpMC.SetAttr<MusicCue, string>("originalMusicEventName", "CROSSROADS"); | ||
tmpMC.SetAttr<MusicCue, int>("originalMusicTrackNumber", 2); | ||
tmpMC.SetAttr<MusicCue, AudioMixerSnapshot>("snapshot", snapshot); | ||
tmpMC.SetAttr<MusicCue, MusicCue.Alternative[]>("alternatives", null); | ||
MusicCue.MusicChannelInfo[] musicChannelInfos = new MusicCue.MusicChannelInfo[] | ||
{ | ||
new MusicCue.MusicChannelInfo(), new MusicCue.MusicChannelInfo(), | ||
new MusicCue.MusicChannelInfo(), new MusicCue.MusicChannelInfo(), | ||
new MusicCue.MusicChannelInfo(), new MusicCue.MusicChannelInfo() | ||
}; | ||
musicChannelInfos[(int) MusicChannels.Main].SetAttr("clip", clips[(int) MusicChannels.Main]); | ||
musicChannelInfos[(int) MusicChannels.Action].SetAttr("clip", clips[(int) MusicChannels.Action]); | ||
musicChannelInfos[(int) MusicChannels.Sub].SetAttr("clip", clips[(int) MusicChannels.Sub]); | ||
musicChannelInfos[(int) MusicChannels.Tension].SetAttr("clip", clips[(int) MusicChannels.Tension]); | ||
musicChannelInfos[(int) MusicChannels.MainAlt].SetAttr("clip", clips[(int) MusicChannels.MainAlt]); | ||
musicChannelInfos[(int) MusicChannels.Extra].SetAttr("clip", clips[(int) MusicChannels.Extra]); | ||
musicChannelInfos[(int) MusicChannels.Main].SetAttr("sync", (MusicChannelSync) syncs[(int) MusicChannels.Main]); | ||
musicChannelInfos[(int) MusicChannels.Action].SetAttr("sync", (MusicChannelSync) syncs[(int) MusicChannels.Action]); | ||
musicChannelInfos[(int) MusicChannels.Sub].SetAttr("sync", (MusicChannelSync) syncs[(int) MusicChannels.Sub]); | ||
musicChannelInfos[(int) MusicChannels.Tension].SetAttr("sync", (MusicChannelSync) syncs[(int) MusicChannels.Tension]); | ||
musicChannelInfos[(int) MusicChannels.MainAlt].SetAttr("sync", (MusicChannelSync) syncs[(int) MusicChannels.MainAlt]); | ||
musicChannelInfos[(int) MusicChannels.Extra].SetAttr("sync", (MusicChannelSync) syncs[(int) MusicChannels.Extra]); | ||
tmpMC.SetAttr<MusicCue, MusicCue.MusicChannelInfo[]>("channelInfos", musicChannelInfos); | ||
MusicCues.Add(set, tmpMC); | ||
} | ||
return MusicCues[set]; | ||
} | ||
public static AtmosCue GetAtmosCue(string set, AudioMixerSnapshot snapshot, bool[] isChannelEnabled) | ||
{ | ||
if (!AtmosCues.ContainsKey(set)) | ||
{ | ||
var tmpAC = ScriptableObject.CreateInstance<AtmosCue>(); | ||
tmpAC.SetAttr("snapshot", snapshot); | ||
tmpAC.SetAttr("isChannelEnabled", isChannelEnabled); | ||
AtmosCues.Add(set, tmpAC); | ||
} | ||
return AtmosCues[set]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.