forked from zxl/LaboratoryProtection
完善timeline;添加timeline事件处理
parent
9d0b6e634f
commit
29a557108d
|
@ -59,25 +59,7 @@ MonoBehaviour:
|
|||
m_RotationOrder: 4
|
||||
m_MixOutCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
|
@ -104,49 +86,13 @@ MonoBehaviour:
|
|||
m_BlendOutDuration: 0.04999999999999982
|
||||
m_MixInCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
m_MixOutCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
|
@ -173,25 +119,7 @@ MonoBehaviour:
|
|||
m_BlendOutDuration: -1
|
||||
m_MixInCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
|
@ -230,8 +158,7 @@ MonoBehaviour:
|
|||
m_PreExtrapolationTime: 0
|
||||
m_DisplayName: "A \u62E7\u52A8\u4E59\u7094\u6C14\u74F6\u5F00\u5173"
|
||||
m_Markers:
|
||||
m_Objects:
|
||||
- {fileID: 6331639561260615408}
|
||||
m_Objects: []
|
||||
m_InfiniteClipPreExtrapolation: 0
|
||||
m_InfiniteClipPostExtrapolation: 0
|
||||
m_InfiniteClipOffsetPosition: {x: 0, y: 0, z: 0}
|
||||
|
@ -1282,6 +1209,22 @@ MonoBehaviour:
|
|||
m_Loop: 0
|
||||
m_Version: 1
|
||||
m_Rotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
--- !u!114 &-3034490624713385214
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 15c38f6fa1940124db1ab7f6fe7268d1, type: 3}
|
||||
m_Name: Signal Emitter
|
||||
m_EditorClassIdentifier:
|
||||
m_Time: 12.116666666666667
|
||||
m_Retroactive: 0
|
||||
m_EmitOnce: 0
|
||||
m_Asset: {fileID: 11400000, guid: ede3fc21038c7334b8ed1d5959b99d0b, type: 2}
|
||||
--- !u!114 &-2062498397165723363
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
|
@ -2702,6 +2645,7 @@ MonoBehaviour:
|
|||
m_Version: 0
|
||||
m_Tracks:
|
||||
- {fileID: -9051326502670716700}
|
||||
- {fileID: 5422919838227539239}
|
||||
- {fileID: -4779748693950560976}
|
||||
- {fileID: 3604926440614759851}
|
||||
- {fileID: 4812240281189112322}
|
||||
|
@ -3089,6 +3033,22 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: fde0d25a170598d46a0b9dc16b4527a5, type: 3}
|
||||
m_Name: ActivationPlayableAsset
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &1926366267646294619
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 15c38f6fa1940124db1ab7f6fe7268d1, type: 3}
|
||||
m_Name: Signal Emitter
|
||||
m_EditorClassIdentifier:
|
||||
m_Time: 7.3
|
||||
m_Retroactive: 0
|
||||
m_EmitOnce: 0
|
||||
m_Asset: {fileID: 11400000, guid: 0601eee20933d3a4188ea72c5974ac83, type: 2}
|
||||
--- !u!114 &3604926440614759851
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
|
@ -3245,6 +3205,31 @@ MonoBehaviour:
|
|||
m_OpenClipOffsetRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_Rotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_ApplyOffsets: 0
|
||||
--- !u!114 &5422919838227539239
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b46e36075dd1c124a8422c228e75e1fb, type: 3}
|
||||
m_Name: Signal Track
|
||||
m_EditorClassIdentifier:
|
||||
m_Version: 3
|
||||
m_AnimClip: {fileID: 0}
|
||||
m_Locked: 0
|
||||
m_Muted: 0
|
||||
m_CustomPlayableFullTypename:
|
||||
m_Curves: {fileID: 0}
|
||||
m_Parent: {fileID: 11400000}
|
||||
m_Children: []
|
||||
m_Clips: []
|
||||
m_Markers:
|
||||
m_Objects:
|
||||
- {fileID: -3034490624713385214}
|
||||
- {fileID: 1926366267646294619}
|
||||
--- !u!114 &5454088595684049504
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
|
@ -3446,22 +3431,6 @@ MonoBehaviour:
|
|||
m_OpenClipOffsetRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_Rotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_ApplyOffsets: 0
|
||||
--- !u!114 &6331639561260615408
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 15c38f6fa1940124db1ab7f6fe7268d1, type: 3}
|
||||
m_Name: Signal Emitter
|
||||
m_EditorClassIdentifier:
|
||||
m_Time: 7.216666666666667
|
||||
m_Retroactive: 0
|
||||
m_EmitOnce: 0
|
||||
m_Asset: {fileID: 11400000, guid: 899fd85222f01d246ac09cdefb17fa21, type: 2}
|
||||
--- !u!114 &6747700512757112769
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 328396b161969e44eaa0600d34bd0d0f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
|
@ -0,0 +1,33 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9c0413fa904d5e147a56932da0cdb163
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,3 @@
|
|||
<linker>
|
||||
<assembly fullname="Sirenix.Serialization.AOTGenerated" preserve="all"/>
|
||||
</linker>
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c3562bde2369fce4f9f3c634647d192c
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -12,23 +12,27 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 1726182683, guid: a4865f1ab4504ed8a368670db22f409c, type: 3}
|
||||
m_Name: AOTGenerationConfig
|
||||
m_EditorClassIdentifier:
|
||||
automateBeforeBuilds: 0
|
||||
automateBeforeBuilds: 1
|
||||
deleteDllAfterBuilds: 1
|
||||
AutomateForAllAOTPlatforms: 1
|
||||
automateForPlatforms: 0900000014000000
|
||||
lastScan: 638214043944850821
|
||||
lastScan: 638305697549808565
|
||||
supportSerializedTypes:
|
||||
- TypeName: UnityEngine.Animator, UnityEngine.AnimationModule
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle,
|
||||
Unity.ResourceManager
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Boolean, mscorlib
|
||||
- TypeName: PMaker.Await.AwaitTimeline, Assembly-CSharp
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Boolean[,], mscorlib
|
||||
- TypeName: UnityTest.ZXL.DialogueType, Assembly-CSharp
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: UnityEngine.UI.Button, UnityEngine.UI
|
||||
- TypeName: System.Collections.Generic.Dictionary`2[[UnityTest.ZXL.DialogueType,
|
||||
Assembly-CSharp],[UnityEngine.GameObject, UnityEngine.CoreModule]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle,
|
||||
|
@ -39,10 +43,34 @@ MonoBehaviour:
|
|||
UnityEngine.CoreModule]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.Dictionary`2[[ObjectItem, Assembly-CSharp],[System.String[],
|
||||
mscorlib]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.Dictionary`2[[UnityTest.ZXL.ProcessType,
|
||||
Assembly-CSharp],[UnityTest.ZXL.ProcessBase, Assembly-CSharp]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[PMaker.Await.AwaitTimeline,
|
||||
Assembly-CSharp]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UnityEngine.GameObject,
|
||||
UnityEngine.CoreModule]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Int32,
|
||||
mscorlib]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Collections.Generic.List`1[[UnityEngine.Animator,
|
||||
UnityEngine.AnimationModule]], mscorlib]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UnityTest.ZXL.ObjectComponent,
|
||||
Assembly-CSharp]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.String,
|
||||
mscorlib]], mscorlib
|
||||
IsCustom: 0
|
||||
|
@ -51,6 +79,14 @@ MonoBehaviour:
|
|||
Unity.TextMeshPro]], mscorlib]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.EnumEqualityComparer`1[[UnityTest.ZXL.DialogueType,
|
||||
Assembly-CSharp]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.EnumEqualityComparer`1[[UnityTest.ZXL.ProcessType,
|
||||
Assembly-CSharp]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Func`2[[System.Threading.CancellationToken, mscorlib, Version=4.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=b77a5c561934e089],[Cysharp.Threading.Tasks.UniTask,
|
||||
UniTask, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]][], mscorlib
|
||||
|
@ -59,7 +95,7 @@ MonoBehaviour:
|
|||
- TypeName: UnityEngine.GameObject, UnityEngine.CoreModule
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.GenericEqualityComparer`1[[System.Int32,
|
||||
- TypeName: System.Collections.Generic.GenericEqualityComparer`1[[System.String,
|
||||
mscorlib]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
|
@ -67,11 +103,19 @@ MonoBehaviour:
|
|||
mscorlib],[UnityEngine.GameObject, UnityEngine.CoreModule]], mscorlib]], System.Core
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.HashSet`1[[UnityEngine.Transform, UnityEngine.CoreModule]],
|
||||
System.Core
|
||||
- TypeName: System.Collections.Generic.IEqualityComparer`1[[UnityTest.ZXL.DialogueType,
|
||||
Assembly-CSharp]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.IEqualityComparer`1[[System.Int32, mscorlib]],
|
||||
- TypeName: System.Collections.Generic.IEqualityComparer`1[[ObjectItem, Assembly-CSharp]],
|
||||
mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.IEqualityComparer`1[[UnityTest.ZXL.ProcessType,
|
||||
Assembly-CSharp]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.IEqualityComparer`1[[System.String, mscorlib]],
|
||||
mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
|
@ -82,6 +126,10 @@ MonoBehaviour:
|
|||
- TypeName: System.Int32, mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.List`1[[UnityEngine.Animator, UnityEngine.AnimationModule]],
|
||||
mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.List`1[[QuestionDatabase+Data, Assembly-CSharp]],
|
||||
mscorlib
|
||||
IsCustom: 0
|
||||
|
@ -93,10 +141,26 @@ MonoBehaviour:
|
|||
mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: UnityTest.ZXL.ObjectComponent, Assembly-CSharp
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.ObjectEqualityComparer`1[[ObjectItem, Assembly-CSharp]],
|
||||
mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.Collections.Generic.ObjectEqualityComparer`1[[TMPro.TMP_FontAsset,
|
||||
Unity.TextMeshPro]], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: ObjectItem, Assembly-CSharp
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: UnityTest.ZXL.ProcessBase, Assembly-CSharp
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: UnityTest.ZXL.ProcessType, Assembly-CSharp
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: QuestionDatabase+Data, Assembly-CSharp
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
|
@ -109,11 +173,10 @@ MonoBehaviour:
|
|||
- TypeName: UnityEngine.ResourceManagement.ResourceProviders.SceneInstance, Unity.ResourceManager
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: SegmentContainer`2[[UnityEngine.UI.Button, UnityEngine.UI],[UnityEngine.UI.Extensions.UILineRenderer,
|
||||
UnityUIExtensions]], Assembly-CSharp
|
||||
- TypeName: System.String, mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: System.String, mscorlib
|
||||
- TypeName: System.String[], mscorlib
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: TMPro.TextMeshProUGUI, Unity.TextMeshPro
|
||||
|
@ -122,9 +185,3 @@ MonoBehaviour:
|
|||
- TypeName: TMPro.TMP_FontAsset, Unity.TextMeshPro
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: UnityEngine.Transform, UnityEngine.CoreModule
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
- TypeName: UnityEngine.UI.Extensions.UILineRenderer, UnityUIExtensions
|
||||
IsCustom: 0
|
||||
Emit: 1
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0c3771b3c0b773d4ca5c0067bc8803e9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
|
@ -9,6 +9,16 @@ namespace UnityTest.ZXL
|
|||
{
|
||||
public Dictionary<string, List<Animator>> dictionary = new Dictionary<string, List<Animator>>();
|
||||
|
||||
public List<GameObject> gameObjects = new List<GameObject>();
|
||||
|
||||
public void HideAll()
|
||||
{
|
||||
foreach (var go in gameObjects)
|
||||
{
|
||||
go.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
public List<Animator> Get(string aniName)
|
||||
{
|
||||
dictionary.TryGetValue(aniName, out List<Animator> list);
|
||||
|
@ -17,6 +27,16 @@ namespace UnityTest.ZXL
|
|||
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[Button("AddGo")]
|
||||
void AutoAddGo()
|
||||
{
|
||||
gameObjects = new List<GameObject>();
|
||||
for (var i = 0; i < transform.childCount; i++)
|
||||
{
|
||||
gameObjects.Add(transform.GetChild(i).gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
[Button("Add")]
|
||||
void AutoAdd()
|
||||
{
|
||||
|
@ -33,7 +53,7 @@ namespace UnityTest.ZXL
|
|||
if (dictionary.ContainsKey(animatorName))
|
||||
dictionary[animatorName].Add(animator);
|
||||
else
|
||||
dictionary.Add(animatorName, new List<Animator>() {animator});
|
||||
dictionary.Add(animatorName, new List<Animator>() { animator });
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -16,10 +16,23 @@ namespace UnityTest.ZXL
|
|||
{
|
||||
if (instance == null)
|
||||
{
|
||||
GameObject go = new GameObject();
|
||||
go.name = typeof(T).ToString();
|
||||
DontDestroyOnLoad(go);
|
||||
instance = go.AddComponent<T>();
|
||||
var findObjectsOfType = GameObject.FindObjectsOfType<T>();
|
||||
if (findObjectsOfType.Length > 1)
|
||||
{
|
||||
throw new Exception($"{typeof(T)}' count is larger than 1");
|
||||
}
|
||||
|
||||
if (findObjectsOfType.Length == 0)
|
||||
{
|
||||
GameObject go = new GameObject();
|
||||
go.name = typeof(T).ToString();
|
||||
DontDestroyOnLoad(go);
|
||||
instance = go.AddComponent<T>();
|
||||
}
|
||||
else
|
||||
{
|
||||
instance = findObjectsOfType[0];
|
||||
}
|
||||
}
|
||||
|
||||
return instance;
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Threading;
|
|||
using Cysharp.Threading.Tasks;
|
||||
using HighlightPlus;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.UI.Extensions;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
|
@ -133,5 +134,40 @@ namespace UnityTest.ZXL
|
|||
{
|
||||
self.gameObject.SetActive(isShow);
|
||||
}
|
||||
|
||||
public static void SetPlayDirector(this ProcessBase processBase, PlayableDirector playableDirector, PlayTimelineMode playMode)
|
||||
{
|
||||
processBase.CurrentPlayableDirector = playableDirector;
|
||||
switch (playMode)
|
||||
{
|
||||
case PlayTimelineMode.Play:
|
||||
playableDirector.gameObject.SetActive(true);
|
||||
playableDirector.Play();
|
||||
break;
|
||||
case PlayTimelineMode.Pause:
|
||||
playableDirector.Pause();
|
||||
break;
|
||||
case PlayTimelineMode.Resume:
|
||||
playableDirector.Resume();
|
||||
break;
|
||||
case PlayTimelineMode.Stop:
|
||||
playableDirector.Stop();
|
||||
playableDirector.gameObject.SetActive(false);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(playMode), playMode, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 播放模式
|
||||
/// </summary>
|
||||
public enum PlayTimelineMode
|
||||
{
|
||||
Play,
|
||||
Pause,
|
||||
Resume,
|
||||
Stop
|
||||
}
|
||||
}
|
|
@ -1,14 +1,73 @@
|
|||
namespace UnityTest.ZXL
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityTest.ZXL
|
||||
{
|
||||
public static class ConstData
|
||||
public class ConstData : MonoBehaviour
|
||||
{
|
||||
public static string Timeline2_1_Over = "Timeline2_1_Over"; // 2-1结束
|
||||
[ShowInInspector] private ConstDataType constDataType;
|
||||
public ConstDataType ConstDataType => constDataType;
|
||||
|
||||
public string[] strs =
|
||||
{
|
||||
// 1-1
|
||||
"电脑屏幕高亮并等待点击",
|
||||
|
||||
// 1-3
|
||||
"弹出气瓶燃烧提示并等待关闭",
|
||||
"湿抹布高亮等待点击",
|
||||
"拧紧阀门时弹出选择题并等待关闭",
|
||||
|
||||
// 1-4
|
||||
"等待点击进入实验室按钮",
|
||||
"打开电源关闭提示等待关闭",
|
||||
"打开检查结果提示等待关闭",
|
||||
|
||||
// 3-1
|
||||
"警示牌高亮并等待点击",
|
||||
|
||||
// 3-2
|
||||
"打开二次确认提示并等待点击",
|
||||
|
||||
// 3-3
|
||||
|
||||
// 3-4
|
||||
"打开密封性良好提示并等待点击",
|
||||
|
||||
// 3-5
|
||||
"打开气体探测器检测正常并等待关闭",
|
||||
|
||||
// 3-6
|
||||
"打开确认电源关闭提示并等待点击",
|
||||
|
||||
// 4-1
|
||||
"消火栓高亮等待点击",
|
||||
|
||||
// 4-2
|
||||
"出现小时钟及文字并等待点击灭火器",
|
||||
"弹出阀门已关提示并等待关闭",
|
||||
|
||||
// 4-3
|
||||
"打开检查无漏气提示并等待关闭",
|
||||
"打开防止再次燃烧提示并等待关闭",
|
||||
|
||||
// 4-4
|
||||
"打开事故气瓶转移提示并等待关闭",
|
||||
|
||||
// 4-5
|
||||
"打开消防员做最后检测提示并等待关闭",
|
||||
};
|
||||
}
|
||||
|
||||
public enum ConstDataType
|
||||
{
|
||||
None,
|
||||
动画2_1播放中断_等待用户点击,
|
||||
|
||||
// 1-1
|
||||
乙炔气瓶开关高亮并等待点击,
|
||||
电脑屏幕高亮并等待点击,
|
||||
等待点击启动按钮,
|
||||
电脑开始启动,
|
||||
|
||||
// 1-3
|
||||
弹出气瓶燃烧提示并等待关闭,
|
||||
|
|
|
@ -3,6 +3,9 @@ using UnityTest.ZXL;
|
|||
|
||||
namespace Mono.Event
|
||||
{
|
||||
/// <summary>
|
||||
/// timeline播放结束抛出事件
|
||||
/// </summary>
|
||||
public class PlayableStoppedEventArgs : GameEventArgs
|
||||
{
|
||||
public static readonly int EventId = typeof(PlayableStoppedEventArgs).GetHashCode();
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
using UnityEngine.Playables;
|
||||
using UnityTest.ZXL;
|
||||
|
||||
namespace Mono.Event
|
||||
{
|
||||
/// <summary>
|
||||
/// 流程结束
|
||||
/// </summary>
|
||||
public class ProcessOverEventArgs : GameEventArgs
|
||||
{
|
||||
public static readonly int EventId = typeof(ProcessOverEventArgs).GetHashCode();
|
||||
public override int Id => EventId;
|
||||
|
||||
public ProcessType processType;
|
||||
|
||||
public ProcessOverEventArgs(ProcessType processType)
|
||||
{
|
||||
this.processType = processType;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 257bf4e3e7f34013a724a7c80ab65917
|
||||
timeCreated: 1694923496
|
|
@ -6,7 +6,7 @@ namespace UnityTest.ZXL
|
|||
{
|
||||
public class FireEvent : MonoBehaviour
|
||||
{
|
||||
public void Fire(string str)
|
||||
public void FireConstEvent(string str)
|
||||
{
|
||||
if (!Enum.TryParse(str, out ConstDataType dataType))
|
||||
{
|
||||
|
@ -16,6 +16,26 @@ namespace UnityTest.ZXL
|
|||
EventManager.Instance.FireNow(this, new ConstEventArgs(dataType));
|
||||
}
|
||||
|
||||
public void FireConstEvent(ConstData constData)
|
||||
{
|
||||
// if (!Enum.TryParse(str, out ConstDataType dataType))
|
||||
// {
|
||||
// Debug.LogError("str转枚举失败");
|
||||
// }
|
||||
|
||||
EventManager.Instance.FireNow(this, new ConstEventArgs(constData.ConstDataType));
|
||||
}
|
||||
|
||||
public void FireConstEvent(ConstDataType constData)
|
||||
{
|
||||
// if (!Enum.TryParse(str, out ConstDataType dataType))
|
||||
// {
|
||||
// Debug.LogError("str转枚举失败");
|
||||
// }
|
||||
|
||||
EventManager.Instance.FireNow(this, new ConstEventArgs(constData));
|
||||
}
|
||||
|
||||
public void OpenTipsUI(string str)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using DragonSoul.Shared;
|
||||
using Mono.Event;
|
||||
|
@ -11,57 +12,196 @@ namespace UnityTest.ZXL
|
|||
{
|
||||
public class FirstProcess : ProcessBase
|
||||
{
|
||||
public override ProcessType processType => ProcessType.一_爆炸发生场景;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
base.OnInit();
|
||||
EventManager.Instance.Subscribe(ConstEventArgs.EventId, ConstEventLogic);
|
||||
EventManager.Instance.Subscribe(ClickObjectEventArgs.EventId, ClickObjectEvent);
|
||||
|
||||
// Minutia1_1();
|
||||
StartAsync().Coroutine();
|
||||
}
|
||||
|
||||
protected override void OnLevel()
|
||||
{
|
||||
base.OnLevel();
|
||||
EventManager.Instance.Unsubscribe(ConstEventArgs.EventId, ConstEventLogic);
|
||||
EventManager.Instance.Unsubscribe(ClickObjectEventArgs.EventId, ClickObjectEvent);
|
||||
}
|
||||
|
||||
private void ConstEventLogic(object sender, GameEventArgs e)
|
||||
async ETTask StartAsync()
|
||||
{
|
||||
var ui = UIManager.Instance().ShowUI(UIType.Chapter);
|
||||
var chapterUI = ui as ChapterUI;
|
||||
if (chapterUI == null)
|
||||
{
|
||||
Debug.LogError($"{ui.GetType()}");
|
||||
return;
|
||||
}
|
||||
|
||||
await chapterUI.Transit(0);
|
||||
UIManager.Instance().HideUI(UIType.Chapter);
|
||||
|
||||
Minutia1_1().Coroutine();
|
||||
}
|
||||
|
||||
protected override void Next()
|
||||
{
|
||||
base.Next();
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
Minutia1_1().Coroutine();
|
||||
break;
|
||||
case 1:
|
||||
Minutia1_2().Coroutine();
|
||||
break;
|
||||
case 2:
|
||||
Minutia1_3().Coroutine();
|
||||
break;
|
||||
case 3:
|
||||
Minutia1_4().Coroutine();
|
||||
break;
|
||||
default:
|
||||
EventManager.Instance.FireNow(this, new ProcessOverEventArgs(processType));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void ConstEventLogic(object sender, GameEventArgs e)
|
||||
{
|
||||
base.ConstEventLogic(sender, e);
|
||||
var args = e as ConstEventArgs;
|
||||
this.SetPlayDirector(CurrentPlayableDirector, PlayTimelineMode.Pause);
|
||||
|
||||
switch (args.constDataType)
|
||||
{
|
||||
case ConstDataType.None:
|
||||
break;
|
||||
case ConstDataType.动画2_1播放中断_等待用户点击:
|
||||
task_1_1.SetResult(true);
|
||||
case ConstDataType.乙炔气瓶开关高亮并等待点击:
|
||||
WaitOperateFinish1_1_1().Coroutine();
|
||||
break;
|
||||
case ConstDataType.电脑屏幕高亮并等待点击:
|
||||
WaitOperateFinish1_1_2().Coroutine();
|
||||
break;
|
||||
case ConstDataType.等待点击启动按钮:
|
||||
WaitOperateFinish1_1_3().Coroutine();
|
||||
break;
|
||||
case ConstDataType.电脑开始启动:
|
||||
currentTask.SetResult(true);
|
||||
break;
|
||||
case ConstDataType.弹出气瓶燃烧提示并等待关闭:
|
||||
break;
|
||||
case ConstDataType.湿抹布高亮等待点击:
|
||||
WaitOperateFinish1_3_1().Coroutine();
|
||||
break;
|
||||
case ConstDataType.拧紧阀门时弹出选择题并等待关闭:
|
||||
break;
|
||||
case ConstDataType.等待点击进入实验室按钮:
|
||||
break;
|
||||
case ConstDataType.打开电源关闭提示等待关闭:
|
||||
break;
|
||||
case ConstDataType.打开检查结果提示等待关闭:
|
||||
break;
|
||||
case ConstDataType.警示牌高亮并等待点击:
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
}
|
||||
|
||||
private void ClickObjectEvent(object sender, GameEventArgs e)
|
||||
public override void ClickObjectEvent(object sender, GameEventArgs e)
|
||||
{
|
||||
base.ClickObjectEvent(sender, e);
|
||||
var args = e as ClickObjectEventArgs;
|
||||
switch (args.objectType)
|
||||
{
|
||||
case HighlightObjectType.乙炔气瓶开关:
|
||||
currentTask.SetResult(true);
|
||||
break;
|
||||
case HighlightObjectType.电脑屏幕:
|
||||
currentTask.SetResult(true);
|
||||
break;
|
||||
case HighlightObjectType.乙炔瓶柜门:
|
||||
break;
|
||||
case HighlightObjectType.湿抹布:
|
||||
break;
|
||||
case HighlightObjectType.警示牌:
|
||||
break;
|
||||
case HighlightObjectType.应急处理表:
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
}
|
||||
|
||||
#region 1-1
|
||||
|
||||
private async ETTask WaitOperateFinish1_1_1() // 乙炔气瓶开关高亮并等待点击
|
||||
{
|
||||
await WaitOperateFinish_ClickHighlight(HighlightObjectType.乙炔气瓶开关);
|
||||
}
|
||||
|
||||
private async ETTask WaitOperateFinish1_1_2() // 电脑屏幕高亮并等待点击
|
||||
{
|
||||
await WaitOperateFinish_ClickHighlight(HighlightObjectType.电脑屏幕);
|
||||
}
|
||||
|
||||
private async ETTask WaitOperateFinish1_1_3() // 等待点击启动按钮
|
||||
{
|
||||
await WaitOperateFinish_Click();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 1-2
|
||||
|
||||
#endregion
|
||||
|
||||
#region 1-3
|
||||
|
||||
private async ETTask WaitOperateFinish1_3_1() // 湿抹布高亮等待点击
|
||||
{
|
||||
await WaitOperateFinish_ClickHighlight(HighlightObjectType.湿抹布, false);
|
||||
|
||||
var ui = UIManager.Instance().ShowUI(UIType.StrongTips);
|
||||
var strongTipsUI = ui as StrongTipsUI;
|
||||
strongTipsUI.SetContent("提示",
|
||||
"气瓶站立燃烧,由于火焰向外喷射,热量并不会直接炙烤气瓶,加上气体气化的吸热现象,气瓶的温度并不会剧烈升高,可按照应急程序,用湿抹布包住手,绕到自喷火口后方,尝试拧紧阀门。(注意:若气瓶倒在地面火焰朝地面喷射,或火焰被物体阻挡烘烤瓶体时,火的热量会导致气瓶内部温度、压力剧烈升高,气瓶瓶体受热强度下降,存在爆炸危险,这时不可盲目接近,所有人应立即迅速撤离现场。)",
|
||||
() => { currentTask.SetResult(true); }, 1);
|
||||
|
||||
await WaitOperateFinish_Click();
|
||||
UIManager.Instance().HideUI(UIType.StrongTips);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 1-4
|
||||
|
||||
private async ETTask WaitOperateFinish4() // 弹出气瓶燃烧提示并等待关闭
|
||||
{
|
||||
currentTask = ETTask<bool>.Create();
|
||||
currentToken = new ETCancellationToken();
|
||||
|
||||
currentToken.Add(TokenCancel);
|
||||
await currentTask;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
// 1-1
|
||||
// ①来到三维场景,播放动画2-1;当同学A打开乙炔柜体后,乙炔气瓶开关高亮,用户点击后再播放剩余动画、弹出“存在泄露”UI,不断闪烁,并伴随着咻~咻~咻~咻的泄气声,关闭柜门后“存在泄露”UI及泄气声消失;
|
||||
// ②此时电脑屏幕高亮,点击后出现电脑画面,画面中“确定”按钮高亮,鼠标点击后,显示启动中UI;
|
||||
// ③启动后0.5s,“蹦”的一声,柜体被爆炸打开,气瓶火焰向外喷射,并且光度计发生轻微爆炸,用户屏幕颤抖,三位同学倒地(动画2-2);
|
||||
private ETTask<bool> task_1_1;
|
||||
|
||||
private async ETTask Minutia1_1(ETCancellationToken token)
|
||||
private async ETTask Minutia1_1()
|
||||
{
|
||||
this.SetPlayDirector(playableDirectors[0], PlayTimelineMode.Play);
|
||||
await ETTask.CompletedTask;
|
||||
}
|
||||
|
||||
// 1-2
|
||||
// ①待动画2-2播放完毕,给个视角能看到爆炸处,又能看到其他同学,紧接着播放动画2-3,动画2-3播放同时光度计再次发生了2次轻微爆炸,1s后火焰慢慢变小,并播放动画2-4;(动画2-3、2-4中人物说话时需要弹出气泡框)
|
||||
private async ETTask Minutia1_2(ETCancellationToken token)
|
||||
private async ETTask Minutia1_2()
|
||||
{
|
||||
this.SetPlayDirector(playableDirectors[1], PlayTimelineMode.Play);
|
||||
await ETTask.CompletedTask;
|
||||
}
|
||||
|
||||
|
@ -71,8 +211,9 @@ namespace UnityTest.ZXL
|
|||
// ②2-5播放中间,拧紧阀门时弹出选择框
|
||||
// 情况一:出气口阀门可以关紧,火焰熄灭,再播放剩余动画;跟同学G说到“已关闭事故瓶出气口阀门,火焰熄灭,周围未有新的引燃物。”,此步骤做完后,直接跳转1-4
|
||||
// 情况二:出气口阀门无法关紧,火焰无法熄灭,再播放剩余动画;跟同学G说到:“无法关闭事故瓶出气口阀门,火焰依然燃烧,周围未有新的引燃物。”;随后再继续播放剩余动画;动画播放完毕
|
||||
private async ETTask Minutia1_3(ETCancellationToken token)
|
||||
private async ETTask Minutia1_3()
|
||||
{
|
||||
this.SetPlayDirector(playableDirectors[2], PlayTimelineMode.Play);
|
||||
await ETTask.CompletedTask;
|
||||
}
|
||||
|
||||
|
@ -81,8 +222,9 @@ namespace UnityTest.ZXL
|
|||
// ②播放动画2-9,动画播完,自动跳转至下一步;
|
||||
// ③视角来到实验室内,播放动画2-10,待电源开关关闭后,弹出“已确认电源关闭”提示框,点击确认,再播放J老师开门进入实验室动作;弹出再次检查按钮。
|
||||
// ④按钮点击后,播放动画2-11,完成后弹出文字提示框:经检测确认气瓶无漏气,爆炸起火周围未有被引燃物品(注意:若有检查到起火点用干粉灭火器将气瓶火焰引燃的周围物品火焰根部喷射,扑灭火焰)。
|
||||
private async ETTask Minutia1_4(ETCancellationToken token)
|
||||
private async ETTask Minutia1_4()
|
||||
{
|
||||
this.SetPlayDirector(playableDirectors[3], PlayTimelineMode.Play);
|
||||
await ETTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
namespace UnityTest.ZXL
|
||||
using System.Collections.Generic;
|
||||
using DragonSoul.Shared;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
namespace UnityTest.ZXL
|
||||
{
|
||||
public class FourProcess : ProcessBase
|
||||
{
|
||||
public override ProcessType processType => ProcessType.四_现场处置场景;
|
||||
|
||||
// 4-1
|
||||
// ①J老师进门后,室内消火栓高亮,点击后播放动画2-12;(要求:打开软管前端喷枪阀门后,喷射出水)
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using DragonSoul.Shared;
|
||||
using Mono.Event;
|
||||
using Sirenix.OdinInspector;
|
||||
using Sirenix.Serialization;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
|
@ -9,9 +11,39 @@ namespace UnityTest.ZXL
|
|||
{
|
||||
public abstract class ProcessBase : SerializedMonoBehaviour
|
||||
{
|
||||
public ProcessType processType;
|
||||
public abstract ProcessType processType { get; }
|
||||
// public GameObject go;
|
||||
|
||||
public List<PlayableDirector> playableDirectors = new List<PlayableDirector>();
|
||||
[OdinSerialize] protected List<PlayableDirector> playableDirectors;
|
||||
|
||||
private PlayableDirector currentPlayableDirector;
|
||||
|
||||
#region Task
|
||||
|
||||
protected ETTask<bool> currentTask;
|
||||
protected ETCancellationToken currentToken;
|
||||
|
||||
protected void TokenCancel()
|
||||
{
|
||||
currentTask?.SetResult(false);
|
||||
currentToken.Remove(TokenCancel);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public PlayableDirector CurrentPlayableDirector
|
||||
{
|
||||
set
|
||||
{
|
||||
if (currentPlayableDirector != null && currentPlayableDirector == value)
|
||||
return;
|
||||
|
||||
currentPlayableDirector = value;
|
||||
}
|
||||
get => currentPlayableDirector;
|
||||
}
|
||||
|
||||
protected int index;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[Button]
|
||||
|
@ -27,6 +59,10 @@ namespace UnityTest.ZXL
|
|||
EventManager.Instance.Subscribe(ConstEventArgs.EventId, ConstEventLogic);
|
||||
EventManager.Instance.Subscribe(ClickObjectEventArgs.EventId, ClickObjectEvent);
|
||||
EventManager.Instance.Subscribe(PlayableStoppedEventArgs.EventId, PlayableStoppedEvent);
|
||||
|
||||
// var list = go.GetComponentAllChild<PlayableDirector>();
|
||||
// playableDirectors = list;
|
||||
this.index = 0;
|
||||
}
|
||||
|
||||
protected virtual void OnUpdate()
|
||||
|
@ -40,37 +76,108 @@ namespace UnityTest.ZXL
|
|||
EventManager.Instance.Unsubscribe(PlayableStoppedEventArgs.EventId, PlayableStoppedEvent);
|
||||
}
|
||||
|
||||
protected virtual void Next()
|
||||
{
|
||||
foreach (var playableDirector in playableDirectors)
|
||||
{
|
||||
playableDirector.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
index++;
|
||||
AnimatorManager.Instance().HideAll();
|
||||
}
|
||||
|
||||
// protected abstract void ProcessLogic();
|
||||
|
||||
public virtual void ConstEventLogic(object sender, GameEventArgs e)
|
||||
{
|
||||
var args = e as ConstEventArgs;
|
||||
Debug.Log($"接收到抛出的事件{args.constDataType}");
|
||||
}
|
||||
|
||||
public virtual void PlayableStoppedEvent(object sender, GameEventArgs e)
|
||||
{
|
||||
var args = e as PlayableStoppedEventArgs;
|
||||
Next();
|
||||
}
|
||||
|
||||
public virtual void ClickObjectEvent(object sender, GameEventArgs e)
|
||||
{
|
||||
var args = e as ClickObjectEventArgs;
|
||||
}
|
||||
|
||||
|
||||
private void Awake()
|
||||
private void OnEnable()
|
||||
{
|
||||
ETTask.ExceptionHandler -= ExceptionHandler;
|
||||
ETTask.ExceptionHandler += ExceptionHandler;
|
||||
OnInit();
|
||||
}
|
||||
|
||||
private void ExceptionHandler(Exception obj)
|
||||
{
|
||||
UnityEngine.Debug.LogError(obj.ToString());
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
OnUpdate();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
private void OnDisable()
|
||||
{
|
||||
OnLevel();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打开高亮物体并等待点击后恢复timeline播放
|
||||
/// </summary>
|
||||
/// <param name="highlightObjectType"></param>
|
||||
/// <param name="isAutoResume"></param>
|
||||
protected async ETTask WaitOperateFinish_ClickHighlight(HighlightObjectType highlightObjectType, bool isAutoResume = true)
|
||||
{
|
||||
currentTask = ETTask<bool>.Create();
|
||||
currentToken = new ETCancellationToken();
|
||||
|
||||
currentToken.Add(TokenCancel);
|
||||
ObjectDataComponent.Instance().GetObject(highlightObjectType).HighlightOpen();
|
||||
await currentTask;
|
||||
if (isAutoResume)
|
||||
this.SetPlayDirector(CurrentPlayableDirector, PlayTimelineMode.Resume);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 等待点击后恢复timeline播放
|
||||
/// </summary>
|
||||
/// <param name="isAutoResume"></param>
|
||||
protected async ETTask WaitOperateFinish_Click(bool isAutoResume = true)
|
||||
{
|
||||
currentTask = ETTask<bool>.Create();
|
||||
currentToken = new ETCancellationToken();
|
||||
|
||||
currentToken.Add(TokenCancel);
|
||||
await currentTask;
|
||||
if (isAutoResume)
|
||||
this.SetPlayDirector(CurrentPlayableDirector, PlayTimelineMode.Resume);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打开UI并等待点击后恢复timeline播放
|
||||
/// </summary>
|
||||
/// <param name="uiType"></param>
|
||||
/// <param name="isAutoResume"></param>
|
||||
protected async ETTask WaitOperateFinish_ClickUI(UIType uiType, bool isAutoResume = true)
|
||||
{
|
||||
currentTask = ETTask<bool>.Create();
|
||||
currentToken = new ETCancellationToken();
|
||||
|
||||
currentToken.Add(TokenCancel);
|
||||
UIManager.Instance().ShowUI(uiType);
|
||||
|
||||
await currentTask;
|
||||
UIManager.Instance().HideUI(uiType);
|
||||
if (isAutoResume)
|
||||
this.SetPlayDirector(CurrentPlayableDirector, PlayTimelineMode.Resume);
|
||||
}
|
||||
}
|
||||
|
||||
public enum ProcessType
|
||||
|
|
|
@ -1,27 +1,115 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using DragonSoul.Shared;
|
||||
using Mono.Event;
|
||||
using Sirenix.OdinInspector;
|
||||
using Sirenix.Serialization;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityTest.ZXL
|
||||
{
|
||||
public class ProcessManager: MonoBehaviour
|
||||
public class ProcessManager : SerializedMonoBehaviour
|
||||
{
|
||||
[ShowInInspector] [ReadOnly] private ProcessBase currentProcess;
|
||||
private ETCancellationToken _token;
|
||||
|
||||
[OdinSerialize] private Dictionary<ProcessType, ProcessBase> processGos = new Dictionary<ProcessType, ProcessBase>();
|
||||
|
||||
private int processIndex;
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
EventManager.Instance.Subscribe(PlayableStoppedEventArgs.EventId,PlayableStoppedEvent);
|
||||
EventManager.Instance.Subscribe(ProcessOverEventArgs.EventId, PlayableStoppedEvent);
|
||||
|
||||
SetProcess(ProcessType.一_爆炸发生场景);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
EventManager.Instance.Unsubscribe(PlayableStoppedEventArgs.EventId,PlayableStoppedEvent);
|
||||
EventManager.Instance.Unsubscribe(ProcessOverEventArgs.EventId, PlayableStoppedEvent);
|
||||
}
|
||||
|
||||
private void PlayableStoppedEvent(object sender, GameEventArgs e)
|
||||
{
|
||||
var args = e as PlayableStoppedEventArgs;
|
||||
|
||||
var args = e as ProcessOverEventArgs;
|
||||
ChangeProcess();
|
||||
}
|
||||
|
||||
void ChangeProcess()
|
||||
{
|
||||
processIndex++;
|
||||
ProcessType processType;
|
||||
|
||||
if (processIndex == 0)
|
||||
{
|
||||
processType = ProcessType.一_爆炸发生场景;
|
||||
}
|
||||
else if (processIndex == 1)
|
||||
{
|
||||
processType = ProcessType.二_汇报程序;
|
||||
}
|
||||
else if (processIndex == 2)
|
||||
{
|
||||
processType = ProcessType.三_准备场景;
|
||||
}
|
||||
else if (processIndex == 3)
|
||||
{
|
||||
processType = ProcessType.四_现场处置场景;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 完成四个模块的任务了
|
||||
Debug.Log("完成四个模块的任务了");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"{processType}");
|
||||
|
||||
_token = new ETCancellationToken();
|
||||
processGos.TryGetValue(processType, out ProcessBase processBase);
|
||||
|
||||
foreach (var processGosValue in processGos.Values)
|
||||
{
|
||||
processGosValue.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
currentProcess = processBase;
|
||||
|
||||
if (currentProcess != null) currentProcess.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
void SetProcess(ProcessType processType)
|
||||
{
|
||||
Debug.Log($"{processType}");
|
||||
|
||||
_token = new ETCancellationToken();
|
||||
processGos.TryGetValue(processType, out ProcessBase processBase);
|
||||
|
||||
foreach (var processGosValue in processGos.Values)
|
||||
{
|
||||
processGosValue.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
currentProcess = processBase;
|
||||
|
||||
if (currentProcess != null) currentProcess.gameObject.SetActive(true);
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
[Button]
|
||||
void Add()
|
||||
{
|
||||
processGos = new Dictionary<ProcessType, ProcessBase>();
|
||||
for (var i = 0; i < transform.childCount; i++)
|
||||
{
|
||||
var tran = transform.GetChild(i);
|
||||
var processBase = tran.GetComponent<ProcessBase>();
|
||||
processGos.Add(processBase.processType, processBase);
|
||||
}
|
||||
|
||||
UnityEditor.EditorUtility.SetDirty(this);
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -1,19 +1,34 @@
|
|||
using Cysharp.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using DragonSoul.Shared;
|
||||
using Mono.Event;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
namespace UnityTest.ZXL
|
||||
{
|
||||
public class SecondProcess : ProcessBase
|
||||
{
|
||||
public override ProcessType processType => ProcessType.二_汇报程序;
|
||||
|
||||
void Logic()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
async UniTask Wait()
|
||||
protected override void Next()
|
||||
{
|
||||
|
||||
base.Next();
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
// Minutia1_1().Coroutine();
|
||||
break;
|
||||
default:
|
||||
EventManager.Instance.FireNow(this, new ProcessOverEventArgs(processType));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 2-1
|
||||
// 实验组安全负责人同学G向实验负责老师F报告事故发生:“环工楼411实验室发生乙炔气瓶泄漏起火、进而引发原子吸收分光光度计发生爆炸。
|
||||
// 实验负责老师F回答:“好的,我知道了,现场情况如何?”
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
namespace UnityTest.ZXL
|
||||
using System.Collections.Generic;
|
||||
using DragonSoul.Shared;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
namespace UnityTest.ZXL
|
||||
{
|
||||
public class ThirdProcess : ProcessBase
|
||||
{
|
||||
public override ProcessType processType => ProcessType.三_准备场景;
|
||||
|
||||
// 3-1
|
||||
// ①来到泄露现场,实验室门口站着同学G、F老师,L老师和J老师推着应急器材专用车来到实验室门口,将专用车放置在实验室走廊上,应急器材专用车中的警示牌高亮,点击后,在实验室入口处播放动画16,播放完毕显示警示牌和隔离带;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Mono.Event;
|
||||
using Sirenix.OdinInspector;
|
||||
using Sirenix.Serialization;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
|
@ -9,7 +9,7 @@ namespace UnityTest.ZXL
|
|||
{
|
||||
public class TimelineManager : MonoBehaviour
|
||||
{
|
||||
[ShowInInspector] private List<PlayableDirector> _playableDirectors = new List<PlayableDirector>();
|
||||
[SerializeField] private List<PlayableDirector> _playableDirectors = new List<PlayableDirector>();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
|
@ -25,6 +25,7 @@ namespace UnityTest.ZXL
|
|||
/// <param name="obj"></param>
|
||||
private void FirePlayableStopped(PlayableDirector obj)
|
||||
{
|
||||
Debug.Log($"timeline {obj.name} is stop");
|
||||
EventManager.Instance.FireNow(this, new PlayableStoppedEventArgs(obj));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using DragonSoul.Shared;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
@ -27,14 +28,14 @@ namespace UnityTest.ZXL
|
|||
}
|
||||
}
|
||||
|
||||
public IEnumerator Transit(int index)
|
||||
public async ETTask Transit(int index)
|
||||
{
|
||||
ShowChapter(index);
|
||||
|
||||
yield return new WaitForSeconds(1);
|
||||
await ETTaskHelper.WaitTime(1);
|
||||
|
||||
blackImage.DOColor(new Color(1, 1, 1, 1), 1);
|
||||
yield return new WaitForSeconds(1);
|
||||
await ETTaskHelper.WaitTime(1);
|
||||
|
||||
// 加载后面的内容
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace UnityTest.ZXL
|
|||
{
|
||||
public class UIManager : BaseAutoMono<UIManager>
|
||||
{
|
||||
public List<UIObjectData> uiObjectData = new List<UIObjectData>();
|
||||
[SerializeField] public List<UIObjectData> uiObjectData = new List<UIObjectData>();
|
||||
|
||||
public UI ShowUI(UIType uiType)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d6fa2d92fc1b3f34da284357edf89c3b, type: 3}
|
||||
m_Name: "\u4E59\u7094\u6C14\u74F6\u5F00\u5173\u9AD8\u4EAE\u5E76\u7B49\u5F85\u70B9\u51FB"
|
||||
m_EditorClassIdentifier:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0601eee20933d3a4188ea72c5974ac83
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,14 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d6fa2d92fc1b3f34da284357edf89c3b, type: 3}
|
||||
m_Name: "\u7535\u8111\u5C4F\u5E55\u9AD8\u4EAE\u5E76\u7B49\u5F85\u70B9\u51FB"
|
||||
m_EditorClassIdentifier:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ede3fc21038c7334b8ed1d5959b99d0b
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,14 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d6fa2d92fc1b3f34da284357edf89c3b, type: 3}
|
||||
m_Name: "\u7B49\u5F85\u70B9\u51FB\u542F\u52A8\u6309\u94AE"
|
||||
m_EditorClassIdentifier:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ba535e2a3cf68cc49a558dc37f456cca
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -5873,25 +5873,7 @@ MonoBehaviour:
|
|||
m_BlendOutDuration: -1
|
||||
m_MixInCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
|
@ -5948,25 +5930,7 @@ MonoBehaviour:
|
|||
m_RotationOrder: 4
|
||||
m_MixOutCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
|
@ -8261,25 +8225,7 @@ MonoBehaviour:
|
|||
m_RotationOrder: 4
|
||||
m_MixOutCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
|
@ -8961,25 +8907,7 @@ MonoBehaviour:
|
|||
m_RotationOrder: 4
|
||||
m_MixOutCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
|
@ -9006,25 +8934,7 @@ MonoBehaviour:
|
|||
m_BlendOutDuration: -1
|
||||
m_MixInCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_Curve: []
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
|
|
Loading…
Reference in New Issue