Insta Trig Fixed

This commit is contained in:
max 2019-12-06 11:25:38 +01:00
parent 324816de02
commit 2955f202a7
2 changed files with 26 additions and 27 deletions

View file

@ -195,7 +195,6 @@ MonoBehaviour:
oneBarLoopButton: 86 oneBarLoopButton: 86
fourBarLoopButton: 94 fourBarLoopButton: 94
playableDirector: {fileID: 65620552} playableDirector: {fileID: 65620552}
lastSelectedScene: 0
currentSelectedScene: 0 currentSelectedScene: 0
nextSelectedScene: 0 nextSelectedScene: 0
channel: 3 channel: 3
@ -1242,9 +1241,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 41f237c64f02a2241a30c5c0b5c087e6, type: 3} m_Script: {fileID: 11500000, guid: 41f237c64f02a2241a30c5c0b5c087e6, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
logAll: 1 logAll: 0
logFiltered: 0 logFiltered: 1
filterStatusByte: 128 filterStatusByte: 178
--- !u!1 &859452785 --- !u!1 &859452785
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View file

@ -13,17 +13,16 @@ namespace cylvester
private int oneBarLoop = 96; private int oneBarLoop = 96;
private int fourBarLoop = 384; private int fourBarLoop = 384;
private int instaTrig = 2; private const int cmd_instaTrig = 2;
private int nextSelectedSceneOutput = 18; private const int cmd_nextSelectedScene = 18;
private int lastSelectedSceneOutput = 17; private const int cmd_currentSelectedScene = 17;
private bool instaChangeActive; private bool instaChangeActive;
private int currentTick; private int currentTick;
private float transitionLength = 16; //sets the duration in Seconds, how long a transition has to be in "TimeLine" to be played back correctly when CYLVESTER is hooked up correctly private float transitionLength = 16; //sets the duration in Seconds, how long a transition has to be in "TimeLine" to be played back correctly when CYLVESTER is hooked up correctly
private float restTimeS = 1f; //init transTime is 1 Second private float restTimeS = 1f; //init transTime is 1 Second
[SerializeField] private int lastSelectedScene = 0; [SerializeField] private int currentSelectedScene;
[SerializeField] private int currentSelectedScene = 0;
[SerializeField] private int nextSelectedScene; [SerializeField] private int nextSelectedScene;
[SerializeField, Range(1, 16)] private int channel = 1; [SerializeField, Range(1, 16)] private int channel = 1;
@ -41,13 +40,29 @@ namespace cylvester
if (mes.Status - 176 == channel - 1) //Which Channel if (mes.Status - 176 == channel - 1) //Which Channel
{ {
if (mes.Data1 == nextSelectedSceneOutput) if (mes.Data1 == cmd_nextSelectedScene)
{ {
nextSelectedScene = mes.Data2; //Get next Schene Update nextSelectedScene = mes.Data2; //Get next Schene Update
} }
if (mes.Data1 == lastSelectedSceneOutput) if (mes.Data1 == cmd_instaTrig)
lastSelectedScene = mes.Data2; //Get current selected Scene {
instaChangeActive = true;
}
if (mes.Data1 == cmd_currentSelectedScene)
{
currentSelectedScene = mes.Data2; //Get current selected Scene
if (instaChangeActive)
{
stateManager.SelectedState = currentSelectedScene;
playableDirector.playableGraph.GetRootPlayable(0).SetSpeed(10);
// Debug.Log("Instatrig " + currentSelectedScene);
// Debug.Log("Last selected Scene new " + lastSelectedScene);
instaChangeActive = false;
}
}
if (mes.Data1 == oneBarLoopButton) //Button fourBarLoop if (mes.Data1 == oneBarLoopButton) //Button fourBarLoop
{ {
@ -63,21 +78,6 @@ namespace cylvester
stateManager.SelectedState = nextSelectedScene; stateManager.SelectedState = nextSelectedScene;
} }
if (mes.Data1 == instaTrig)
{
instaChangeActive = true;
if (instaChangeActive && (currentSelectedScene != lastSelectedScene))
{
currentSelectedScene = lastSelectedScene;
stateManager.SelectedState = lastSelectedScene;
playableDirector.playableGraph.GetRootPlayable(0).SetSpeed(10);
Debug.Log("Instatrig " + currentSelectedScene);
Debug.Log("Last selected Scene new " + lastSelectedScene);
instaChangeActive = false;
}
}
} }
} }