From 8abdd6d1f83bb672347506871f016f09e5f23b90 Mon Sep 17 00:00:00 2001 From: Ding Yuntian <1491671119@qq.com> Date: Thu, 15 May 2025 16:22:22 +0800 Subject: [PATCH] Playable --- .../RawResources/Anima/TestTimeline.playable | 131 +++++++++++++++++ .../Anima/TestTimeline.playable.meta | 8 ++ Assets/Scenes/OPTest.unity | 136 ++++++++++++++++++ .../Playable/DeepIn/DeepInPlayableAsset.cs | 2 - .../DeepIn/DeepInPlayableBehaviour.cs | 3 +- Assets/Scripts/Playable/SpriteLoop.meta | 3 + .../SpriteLoop/SpriteLoopPlayableAsset.cs | 16 +++ .../SpriteLoopPlayableAsset.cs.meta | 3 + 8 files changed, 298 insertions(+), 4 deletions(-) create mode 100644 Assets/RawResources/Anima/TestTimeline.playable create mode 100644 Assets/RawResources/Anima/TestTimeline.playable.meta create mode 100644 Assets/Scripts/Playable/SpriteLoop.meta create mode 100644 Assets/Scripts/Playable/SpriteLoop/SpriteLoopPlayableAsset.cs create mode 100644 Assets/Scripts/Playable/SpriteLoop/SpriteLoopPlayableAsset.cs.meta diff --git a/Assets/RawResources/Anima/TestTimeline.playable b/Assets/RawResources/Anima/TestTimeline.playable new file mode 100644 index 000000000..4a9b30e08 --- /dev/null +++ b/Assets/RawResources/Anima/TestTimeline.playable @@ -0,0 +1,131 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-5049516660190200887 +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: 82cd92ffc29383742932b27ca414c80f, type: 3} + m_Name: Playable 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_Version: 1 + m_Start: 0 + m_ClipIn: 0 + m_Asset: {fileID: 1816811236470170442} + m_Duration: 5 + m_TimeScale: 1 + m_ParentTrack: {fileID: -5049516660190200887} + m_EaseInDuration: 0 + m_EaseOutDuration: 0 + m_BlendInDuration: -1 + 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_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_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_BlendInCurveMode: 0 + m_BlendOutCurveMode: 0 + m_ExposedParameterNames: [] + m_AnimationCurves: {fileID: 0} + m_Recordable: 0 + m_PostExtrapolationMode: 0 + m_PreExtrapolationMode: 0 + m_PostExtrapolationTime: 0 + m_PreExtrapolationTime: 0 + m_DisplayName: DeepInPlayableAsset + m_Markers: + m_Objects: [] +--- !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: bfda56da833e2384a9677cd3c976a436, type: 3} + m_Name: TestTimeline + m_EditorClassIdentifier: + m_Version: 0 + m_Tracks: + - {fileID: -5049516660190200887} + m_FixedDuration: 0 + m_EditorSettings: + m_Framerate: 60 + m_ScenePreview: 1 + m_DurationMode: 0 + m_MarkerTrack: {fileID: 0} +--- !u!114 &1816811236470170442 +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: 605cbd24495e41f49b99eaeca6146819, type: 3} + m_Name: DeepInPlayableAsset + m_EditorClassIdentifier: + targetObject: + exposedName: ebf8de2e64054c54dbb743dbb2835675 + defaultValue: {fileID: 0} + sprites: [] diff --git a/Assets/RawResources/Anima/TestTimeline.playable.meta b/Assets/RawResources/Anima/TestTimeline.playable.meta new file mode 100644 index 000000000..ac12ecbc1 --- /dev/null +++ b/Assets/RawResources/Anima/TestTimeline.playable.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 000907d541f055f4682e7ef40b8ef5f7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/OPTest.unity b/Assets/Scenes/OPTest.unity index 20aa49b22..dc2fd668b 100644 --- a/Assets/Scenes/OPTest.unity +++ b/Assets/Scenes/OPTest.unity @@ -410,6 +410,141 @@ MonoBehaviour: sprite: {fileID: -7059906391879546779, guid: b7c6259423055d3468ee386abcdbeb7e, type: 3} width: 6.3 moveSpeed: -1 +--- !u!1 &223721433 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 223721435} + - component: {fileID: 223721434} + m_Layer: 0 + m_Name: TimelineTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!320 &223721434 +PlayableDirector: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 223721433} + m_Enabled: 1 + serializedVersion: 3 + m_PlayableAsset: {fileID: 11400000, guid: 000907d541f055f4682e7ef40b8ef5f7, type: 2} + m_InitialState: 1 + m_WrapMode: 2 + m_DirectorUpdateMode: 1 + m_InitialTime: 0 + m_SceneBindings: [] + m_ExposedReferences: + m_References: + - ebf8de2e64054c54dbb743dbb2835675: {fileID: 333377586} +--- !u!4 &223721435 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 223721433} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.2223406, y: 0.13589421, z: -0.02986741} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 333377588} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &333377586 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 333377588} + - component: {fileID: 333377587} + m_Layer: 0 + m_Name: Square + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &333377587 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 333377586} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &333377588 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 333377586} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 223721435} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &724936450 GameObject: m_ObjectHideFlags: 0 @@ -2589,3 +2724,4 @@ SceneRoots: - {fileID: 1631142629} - {fileID: 1409397678} - {fileID: 875433554} + - {fileID: 223721435} diff --git a/Assets/Scripts/Playable/DeepIn/DeepInPlayableAsset.cs b/Assets/Scripts/Playable/DeepIn/DeepInPlayableAsset.cs index 441719870..82aae0b9f 100644 --- a/Assets/Scripts/Playable/DeepIn/DeepInPlayableAsset.cs +++ b/Assets/Scripts/Playable/DeepIn/DeepInPlayableAsset.cs @@ -8,7 +8,6 @@ namespace AibisDream { public ExposedReference targetObject; public Sprite[] sprites; - public float singleDuration; public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { @@ -17,7 +16,6 @@ namespace AibisDream behaviour.targetObject = targetObject.Resolve(graph.GetResolver()); behaviour.sprites = sprites; - behaviour.singleDuration = singleDuration; return playable; } diff --git a/Assets/Scripts/Playable/DeepIn/DeepInPlayableBehaviour.cs b/Assets/Scripts/Playable/DeepIn/DeepInPlayableBehaviour.cs index e71256375..b2ea0360b 100644 --- a/Assets/Scripts/Playable/DeepIn/DeepInPlayableBehaviour.cs +++ b/Assets/Scripts/Playable/DeepIn/DeepInPlayableBehaviour.cs @@ -7,8 +7,7 @@ namespace AibisDream { public GameObject targetObject; public Sprite[] sprites; - public float singleDuration; - + #region 一些索引 private SpriteRenderer _renderer1; diff --git a/Assets/Scripts/Playable/SpriteLoop.meta b/Assets/Scripts/Playable/SpriteLoop.meta new file mode 100644 index 000000000..97b607e20 --- /dev/null +++ b/Assets/Scripts/Playable/SpriteLoop.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d8036b5d104f4f6ea6c2ffdc93451946 +timeCreated: 1747288555 \ No newline at end of file diff --git a/Assets/Scripts/Playable/SpriteLoop/SpriteLoopPlayableAsset.cs b/Assets/Scripts/Playable/SpriteLoop/SpriteLoopPlayableAsset.cs new file mode 100644 index 000000000..d62fa4daf --- /dev/null +++ b/Assets/Scripts/Playable/SpriteLoop/SpriteLoopPlayableAsset.cs @@ -0,0 +1,16 @@ +using UnityEngine; +using UnityEngine.Playables; + +namespace AibisDream +{ + public class SpriteLoopPlayableAsset : PlayableAsset + { + public ExposedReference targetObject; + public Sprite[] sprites; + + public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) + { + throw new System.NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Playable/SpriteLoop/SpriteLoopPlayableAsset.cs.meta b/Assets/Scripts/Playable/SpriteLoop/SpriteLoopPlayableAsset.cs.meta new file mode 100644 index 000000000..fb0424e00 --- /dev/null +++ b/Assets/Scripts/Playable/SpriteLoop/SpriteLoopPlayableAsset.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8b97eda884604ff5bd906f2a7a4859f1 +timeCreated: 1747288570 \ No newline at end of file