Coding Test

i did a dum dum and forgot to put the script in the prefab, another bummer.
This commit is contained in:
KrispyDotlessI 2022-08-28 08:45:55 +08:00
parent fd4e2140da
commit 1c42d7150a
2 changed files with 60 additions and 12 deletions

View file

@ -1106,6 +1106,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 4161079182365989534}
- component: {fileID: -355020381370293803}
m_Layer: 0
m_Name: marchingOrders
m_TagString: Untagged
@ -1134,6 +1135,27 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &-355020381370293803
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7932591990038472721}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 88781b295be0fe245b61208a9de66199, type: 3}
m_Name:
m_EditorClassIdentifier:
EligibleHits: []
scheduledInputs: []
firstEnable: 0
Sarge: {fileID: 2588778952987738506}
Cadet1: {fileID: 0}
Cadet2: {fileID: 0}
Cadet3: {fileID: 0}
CadetPlayer: {fileID: 0}
Player: {fileID: 8848288323294350469}
--- !u!1 &8579906743383480424
GameObject:
m_ObjectHideFlags: 0
@ -1269,7 +1291,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5783637365262278501, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3}
propertyPath: m_Name
value: Cadets1
value: Cadet1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3}
@ -1331,7 +1353,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5783637365262278501, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3}
propertyPath: m_Name
value: Cadets3
value: Cadet3
objectReference: {fileID: 0}
- target: {fileID: 5783637365262278501, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3}
propertyPath: m_IsActive
@ -1397,7 +1419,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5783637365262278501, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3}
propertyPath: m_Name
value: Cadets2
value: Cadet2
objectReference: {fileID: 0}
- target: {fileID: 5783637365262278501, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3}
propertyPath: m_IsActive
@ -1463,7 +1485,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5783637365262278501, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3}
propertyPath: m_Name
value: CadetsPlayer
value: CadetPlayer
objectReference: {fileID: 0}
- target: {fileID: 5783637365262278501, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3}
propertyPath: m_IsActive
@ -1471,6 +1493,11 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3}
--- !u!1 &8848288323294350469 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 5783637365262278501, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3}
m_PrefabInstance: {fileID: 3064968737360712672}
m_PrefabAsset: {fileID: 0}
--- !u!4 &3369076211363356189 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 308962927016676861, guid: 263eb1d1933d9544a8db7c1844e53bb6, type: 3}

View file

@ -34,13 +34,13 @@ namespace HeavenStudio.Games.Loaders
//the cues do nothing at the moment, so i temporarily disabled them
//new GameAction("marching", delegate { MarchingOrders.instance.CadetsMarch(eventCaller.currentEntity.beat); }, 4f, true),
//new GameAction("attention", delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.SargeAttention(e.beat); }, 2f, false),
//new GameAction("march", delegate {}, 2f, false),
new GameAction("attention", delegate { MarchingOrders.instance.SargeAttention(eventCaller.currentEntity.beat); }, 2.25f, false),
new GameAction("march", delegate { MarchingOrders.instance.SargeMarch(eventCaller.currentEntity.beat); }, 2.0f, false),
//new GameAction("halt", delegate {}, 2f, false),
//new GameAction("face turn", delegate {}, 4f, false, parameters: new List<Param>()
//{
// new Param("type", MarchingOrders.DirectionFaceTurn.Right, "Direction", "The direction sarge wants the cadets to face"),
// new Param("type2", MarchingOrders.FaceTurnLength.Normal, "Length", "How fast or slow the event lasts"),
// new Param("type2", MarchingOrders.FaceTurnLength.Normal, "Length", "How fast or slow the event lasts"),
//}),
});
}
@ -52,6 +52,12 @@ namespace HeavenStudio.Games
//using Scripts_MarchingOrders;
public class MarchingOrders : Minigame
{
public Animator Sarge;
public Animator Cadet1;
public Animator Cadet2;
public Animator Cadet3;
public Animator CadetPlayer;
public GameObject Player;
public static MarchingOrders instance;
public enum DirectionFaceTurn
@ -84,12 +90,27 @@ namespace HeavenStudio.Games
public void SargeAttention(float beat)
{
//MultiSound.Play(new MultiSound.Sound[] {
//new MultiSound.Sound("marchingOrders/attention1", beat),
//new MultiSound.Sound("marchingOrders/attention2", beat + 0.25f),
//new MultiSound.Sound("marchingOrders/attention3", beat + 0.75f),
//});
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("marchingOrders/attention1", beat),
new MultiSound.Sound("marchingOrders/attention2", beat + 0.25f),
new MultiSound.Sound("marchingOrders/attention3", beat + 0.75f),
});
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.25f, delegate { Sarge.Play("Talk", -1, 0);}),
});
}
public void SargeMarch(float beat)
{
Jukebox.PlayOneShot("games/marchingOrders/march1");
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { Sarge.Play("Talk", -1, 0);}),
});
}
}
}