Compare commits

...

2 Commits

Author SHA1 Message Date
d243ef6e3b 添加堆垛机取货完成 放置货物动画 2025-05-09 08:33:14 +08:00
2352e69081 增加配置文件 2025-05-08 13:38:55 +08:00
1635 changed files with 684853 additions and 874 deletions

View File

@ -0,0 +1,61 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 16
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: 18bd840b706853d4a934ec3199f63a41, type: 3}
m_Name: Animancer Settings
m_EditorClassIdentifier:
_Data:
- rid: 1102212210127012099
- rid: 1102212210127012100
- rid: 1102212210127012101
- rid: 1102212210127012102
- rid: 1102212210127012103
- rid: 1102212210127012104
references:
version: 2
RefIds:
- rid: 1102212210127012099
type: {class: AnimancerComponentPreviewSettings, ns: Animancer.Editor.Previews, asm: Kybernetik.Animancer.Editor}
data:
_RepaintRate: 30
- rid: 1102212210127012100
type: {class: AnimancerGraphControls, ns: Animancer.Editor, asm: Kybernetik.Animancer.Editor}
data:
_FrameStep: 0.02
- rid: 1102212210127012101
type: {class: TransitionPreviewSettings, ns: Animancer.Editor.Previews, asm: Kybernetik.Animancer.Editor}
data:
_AutoClose: 1
_SceneLighting: 0
_ShowSkybox: 0
_FrameStep: 0.02
_SceneEnvironment: {fileID: 0}
_Models: []
- rid: 1102212210127012102
type: {class: SerializableEventSequenceDrawerSettings, ns: Animancer.Editor, asm: Kybernetik.Animancer.Editor}
data:
_HideEventCallbacks: 0
- rid: 1102212210127012103
type: {class: AnimationTimeAttributeSettings, ns: Animancer.Units.Editor, asm: Kybernetik.Animancer.Editor}
data:
showApproximations: 1
showNormalized: 1
showSeconds: 1
showFrames: 1
- rid: 1102212210127012104
type: {class: GenerateSpriteAnimationsSettings, ns: Animancer.Editor.Tools, asm: Kybernetik.Animancer.Editor}
data:
_FrameRate: 12
_HierarchyPath:
_TargetType:
_QualifiedName: UnityEngine.SpriteRenderer, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
_PropertyName: m_Sprite

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6bd895ef003a7dd42b1212005d9de2ab
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 38f70f293f649324b99d4d7f1f9bede0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,113 @@
%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: 2dd819b1a17000747b98d533a289c5eb, type: 3}
m_Name: shelfConfig_1
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects:
- {fileID: 7400000, guid: c005c0711278dbd4eafdb92b99794612, type: 2}
- {fileID: 7400000, guid: 35f948453d152a04986763f636b3c194, type: 2}
- {fileID: 7400000, guid: e9fa085935da61b4ba9a30d5b095cb45, type: 2}
- {fileID: 7400000, guid: c7c24aeb0ca291d4583b5e28baf58f80, type: 2}
- {fileID: 7400000, guid: b5ae0aa7adc17f54988962e81404e636, type: 2}
- {fileID: 7400000, guid: d933409f8eec3814bad938a7aad0ab37, type: 2}
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: shelfAnimDatas
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[GameLogic.ShelfRowAnimData,
Assembly-CSharp]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.Int32,
mscorlib]], mscorlib
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 3
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 3
- Name: $v
Entry: 7
Data: 2|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 10
Data: 0
- Name: shrink
Entry: 10
Data: 1
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 1
- Name: $v
Entry: 7
Data: 3|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 10
Data: 2
- Name: shrink
Entry: 10
Data: 3
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 4
- Name: $v
Entry: 7
Data: 4|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 10
Data: 4
- Name: shrink
Entry: 10
Data: 5
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
groups: 010000000300000004000000

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cab58bc1ec41bb7448d685f50bb5708b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,107 @@
%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: 2dd819b1a17000747b98d533a289c5eb, type: 3}
m_Name: shelfConfig_2
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: shelfAnimDatas
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[GameLogic.ShelfRowAnimData,
Assembly-CSharp]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.Int32,
mscorlib]], mscorlib
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 3
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 6
- Name: $v
Entry: 7
Data: 2|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 5
- Name: $v
Entry: 7
Data: 3|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 7
- Name: $v
Entry: 7
Data: 4|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
groups: 050000000600000007000000

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 33bc2183695eea945a4d58fcb117937e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,107 @@
%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: 2dd819b1a17000747b98d533a289c5eb, type: 3}
m_Name: shelfConfig_3
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: shelfAnimDatas
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[GameLogic.ShelfRowAnimData,
Assembly-CSharp]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.Int32,
mscorlib]], mscorlib
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 3
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 11
- Name: $v
Entry: 7
Data: 2|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 9
- Name: $v
Entry: 7
Data: 3|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 12
- Name: $v
Entry: 7
Data: 4|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
groups: 090000000b0000000c000000

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bddc52252ed26b8409ddb979e7c6d277
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,128 @@
%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: 2dd819b1a17000747b98d533a289c5eb, type: 3}
m_Name: shelfConfig_4
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: shelfAnimDatas
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[GameLogic.ShelfRowAnimData,
Assembly-CSharp]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.Int32,
mscorlib]], mscorlib
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 4
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 13
- Name: $v
Entry: 7
Data: 2|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 15
- Name: $v
Entry: 7
Data: 3|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 14
- Name: $v
Entry: 7
Data: 4|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 16
- Name: $v
Entry: 7
Data: 5|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
groups: 0d0000000e0000000f00000010000000

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9b9c33b937c2c70488884d364858a4d3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,107 @@
%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: 2dd819b1a17000747b98d533a289c5eb, type: 3}
m_Name: shelfConfig_5
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: shelfAnimDatas
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[GameLogic.ShelfRowAnimData,
Assembly-CSharp]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.Int32,
mscorlib]], mscorlib
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 3
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 19
- Name: $v
Entry: 7
Data: 2|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 17
- Name: $v
Entry: 7
Data: 3|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 20
- Name: $v
Entry: 7
Data: 4|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
groups: 110000001300000014000000

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 73f70759e8ade1645a982f72ffe7ea7b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,107 @@
%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: 2dd819b1a17000747b98d533a289c5eb, type: 3}
m_Name: shelfConfig_6
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: shelfAnimDatas
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[GameLogic.ShelfRowAnimData,
Assembly-CSharp]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.Int32,
mscorlib]], mscorlib
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 3
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 22
- Name: $v
Entry: 7
Data: 2|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 21
- Name: $v
Entry: 7
Data: 3|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 23
- Name: $v
Entry: 7
Data: 4|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
groups: 150000001600000017000000

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fa210a939f5b7104ba4413a72638e695
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,107 @@
%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: 2dd819b1a17000747b98d533a289c5eb, type: 3}
m_Name: shelfConfig_7
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: shelfAnimDatas
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[GameLogic.ShelfRowAnimData,
Assembly-CSharp]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.Int32,
mscorlib]], mscorlib
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 3
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 27
- Name: $v
Entry: 7
Data: 2|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 25
- Name: $v
Entry: 7
Data: 3|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 28
- Name: $v
Entry: 7
Data: 4|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
groups: 190000001b0000001c000000

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7a9b8a706eab1c74f8f26c28448f41c9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,107 @@
%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: 2dd819b1a17000747b98d533a289c5eb, type: 3}
m_Name: shelfConfig_8
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: shelfAnimDatas
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[GameLogic.ShelfRowAnimData,
Assembly-CSharp]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.Int32,
mscorlib]], mscorlib
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 3
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 30
- Name: $v
Entry: 7
Data: 2|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 29
- Name: $v
Entry: 7
Data: 3|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 31
- Name: $v
Entry: 7
Data: 4|GameLogic.ShelfRowAnimData, Assembly-CSharp
- Name: stretch
Entry: 6
Data:
- Name: shrink
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
groups: 1d0000001e0000001f000000

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 803573dde1fe883479b2384da9193dbf
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,24 @@
%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: 7a686a47eee2fa44cb0a34b5d86e4d5e, type: 3}
m_Name: ShelfMachineBehaviour
m_EditorClassIdentifier:
_serializedGraph: '{"type":"NodeCanvas.BehaviourTrees.BehaviourTree","nodes":[{"selectionMode":1,"intCase":{},"enumCase":{"_type":"System.Enum","_name":"shelfToolActionType","_targetVariableID":"046106d6-ba37-46e3-8cc2-cbaac14b6e2b"},"_position":{"x":234.3504,"y":94.13937},"$type":"NodeCanvas.BehaviourTrees.Switch","$id":"0"},{"_position":{"x":-550.9409,"y":220.5786},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"1"},{"_position":{"x":36.05078,"y":209.6188},"$type":"NodeCanvas.BehaviourTrees.Sequencer","$id":"2"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":-425.4755,"y":326.8681},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"3"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|InitLoadPositionComplete|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":-512.8286,"y":417.6421},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"4"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":-131.0505,"y":322.1024},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"5"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableLoadStartAnimation|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":-219.3914,"y":414.4665},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"6"},{"repeaterMode":1,"repeatTimes":{"_value":1},"_position":{"x":169.3494,"y":318.844},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"7"},{"_condition":{"method":{"_baseInfo":"GameLogic.ShelfMachineToolActor|EnableStartLoadToShelfPosition|System.Boolean","_paramsInfo":""},"parameters":[],"checkValue":{"_type":"System.Boolean","_value":{"$content":true,"$type":"System.Boolean"}},"$type":"NodeCanvas.Tasks.Conditions.CheckFunction_Multiplatform"},"_position":{"x":64.6575,"y":414.7119},"$type":"NodeCanvas.BehaviourTrees.ConditionNode","$id":"8"}],"connections":[{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"2"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"3"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"5"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"7"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"4"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"5"},"_targetNode":{"$ref":"6"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"7"},"_targetNode":{"$ref":"8"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"}],"canvasGroups":[],"localBlackboard":{"_variables":{}},"derivedData":{"$type":"NodeCanvas.BehaviourTrees.BehaviourTree+DerivedSerializationData"}}'
_objectReferences: []
_graphSource:
_version: 3.32
_category:
_comments:
_translation: {x: 489, y: -20}
_zoomFactor: 0.8562181
_haltSerialization: 0
_externalSerializationFile: {fileID: 0}

View File

@ -1,26 +0,0 @@
%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: 7a686a47eee2fa44cb0a34b5d86e4d5e, type: 3}
m_Name: ShelfMachineBehaviour
m_EditorClassIdentifier:
_serializedGraph: '{"type":"NodeCanvas.BehaviourTrees.BehaviourTree","nodes":[{"selectionMode":1,"intCase":{},"enumCase":{"_type":"System.Enum","_name":""},"_position":{"x":564.0,"y":122.0},"$type":"NodeCanvas.BehaviourTrees.Switch"}],"connections":[],"canvasGroups":[],"localBlackboard":{"_variables":{"Enum
Case":{"_name":"Enum Case","_id":"765c30f0-31a8-432d-8a9e-1a9dbf4d0337","$type":"NodeCanvas.Framework.Variable`1[[System.Enum,
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}}},"derivedData":{"repeat":true,"$type":"NodeCanvas.BehaviourTrees.BehaviourTree+DerivedSerializationData"}}'
_objectReferences: []
_graphSource:
_version: 3.32
_category:
_comments:
_translation: {x: 0, y: 0}
_zoomFactor: 1
_haltSerialization: 0
_externalSerializationFile: {fileID: 0}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +0,0 @@
using Sirenix.OdinInspector;
using UnityEngine;
public enum ShelfActionType
{
[LabelText("ÎÞ")]None,
[LabelText("×°»õ")]Load,
[LabelText("ж»õ")]UnLoad
}

View File

@ -0,0 +1,12 @@
using Sirenix.OdinInspector;
using UnityEngine;
namespace GameLogic
{
public enum ShelfToolActionType
{
[LabelText("ÎÞ")] None,
[LabelText("×°»õ")] Load,
[LabelText("ж»õ")] UnLoad
}
}

View File

@ -0,0 +1,10 @@
using Sirenix.OdinInspector;
namespace GameLogic
{
public enum ToolActionType : int
{
[LabelText("放下")]PutDown = 0,
[LabelText("拿起")]PickUp = 1,
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 2bcef26c07d84c549bda615a07a7a513
timeCreated: 1746688068

View File

@ -1,7 +1,33 @@
using System;
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
using UnityEngine; using UnityEngine;
public class Actor : MonoBehaviour namespace GameLogic
{ {
[LabelText("标识id")]public int _id = 0; public class Actor : MonoBehaviour
{
[LabelText("标识id")]public int _id = 0;
#region
protected virtual void OnLoad(){}
protected virtual void OnUpdate(){}
protected virtual void RegisterEvent(){}
private void Awake()
{
OnLoad();
RegisterEvent();
}
private void Update()
{
}
#endregion
}
} }

View File

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
@ -6,85 +7,102 @@ using Cysharp.Threading.Tasks;
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
using UnityEngine; using UnityEngine;
public class ActorMgr : Singleton<ActorMgr> namespace GameLogic
{ {
[ShowInInspector,LabelText("所有货物")]private Dictionary<string,ContainerInfo> _containerInfos = new Dictionary<string,ContainerInfo>(); public class ActorMgr : Singleton<ActorMgr>
[ShowInInspector,LabelText("所有货架")]private List<ShelfActor> _shelfActors = new List<ShelfActor>(); {
[ShowInInspector, LabelText("所有货物")]
private Dictionary<string, ContainerInfo> _containerInfos = new Dictionary<string, ContainerInfo>();
protected override void OnLoad() [ShowInInspector, LabelText("所有货架")] private List<ShelfActor> _shelfActors = new List<ShelfActor>();
{
base.OnLoad();
InitData().Forget();
}
private async UniTaskVoid InitData()
{
await UniTask.Yield();
await InitShelf();
await InitContainer();
}
private async UniTask InitShelf()
{
var shelfs = GameObject.FindObjectsByType<ShelfActor>(FindObjectsSortMode.None);
_shelfActors = shelfs.ToList();
}
/// <summary> protected override void OnLoad()
/// 生成容器 {
/// </summary> base.OnLoad();
private async UniTask InitContainer() InitData().Forget();
{ }
await UniTask.Yield();
List<GameObject> result = new List<GameObject>();
// 正则表达式:匹配
Regex regex = new Regex("^\\d{2}-\\d{2}-\\d{2}$");
foreach (GameObject obj in GameObject.FindObjectsByType<GameObject>(FindObjectsSortMode.InstanceID))
{
// 1. 检查名称是否匹配正则表达式
if (regex.IsMatch(obj.name))
{
var groups = obj.name.Split('-');
if (groups.Length != 3) break;
int row = int.Parse(groups[0]);
int column = int.Parse(groups[1]);
int layer = int.Parse(groups[2]);
var containerInfo = ContainerFactory.CreateInfo(obj, GetShelfBySort(row),row,column,layer);
_containerInfos.Add(obj.name,containerInfo);
}
}
}
private async UniTaskVoid InitData()
{
await UniTask.Yield();
await InitShelf();
await InitContainer();
}
#region private async UniTask InitShelf()
/// <summary> {
/// 根据排号 获取 相应的货架 var shelfs = GameObject.FindObjectsByType<ShelfActor>(FindObjectsSortMode.None);
/// </summary> _shelfActors = shelfs.ToList();
/// <param name="sortId"></param> }
/// <returns></returns>
private ShelfActor GetShelfBySort(int sortId)
{
foreach (ShelfActor shelfActor in _shelfActors)
{
if (shelfActor.IsContainGroup(sortId))
{
return shelfActor;
}
}
return null; protected override void OnUpdate()
} {
base.OnUpdate();
#endregion if (Input.GetKeyDown(KeyCode.R))
{
try
{
Debug.LogWarning("取货03-01-02");
var co = _containerInfos["03-01-02"];
co.shelf.LoadTest(co);
}
catch (Exception e)
{
Debug.LogWarning("货物不存在");
throw;
}
}
}
/// <summary>
/// 生成容器
/// </summary>
private async UniTask InitContainer()
{
await UniTask.Yield();
List<GameObject> result = new List<GameObject>();
// 正则表达式:匹配
Regex regex = new Regex("^\\d{2}-\\d{2}-\\d{2}$");
foreach (GameObject obj in GameObject.FindObjectsByType<GameObject>(FindObjectsSortMode.InstanceID))
{
// 1. 检查名称是否匹配正则表达式
if (regex.IsMatch(obj.name))
{
var groups = obj.name.Split('-');
if (groups.Length != 3) break;
int row = int.Parse(groups[0]);
int column = int.Parse(groups[1]);
int layer = int.Parse(groups[2]);
var containerInfo = ContainerFactory.CreateInfo(obj, GetShelfBySort(row), row, column, layer);
_containerInfos.Add(obj.name, containerInfo);
}
}
}
}
#region
/// <summary>
/// 根据排号 获取 相应的货架
/// </summary>
/// <param name="sortId"></param>
/// <returns></returns>
private ShelfActor GetShelfBySort(int sortId)
{
foreach (ShelfActor shelfActor in _shelfActors)
{
if (shelfActor.IsContainGroup(sortId))
{
return shelfActor;
}
}
return null;
}
#endregion
}
}

View File

@ -2,25 +2,84 @@ using System.Collections.Generic;
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
using UnityEngine; using UnityEngine;
public class ShelfActor : Actor namespace GameLogic
{ {
public class ShelfActor : Actor
[LabelText("货物所属工具组"),ShowInInspector] public List<int> _group = new List<int>();
public void LoadContainer()
{ {
[LabelText("配置文件"),ShowInInspector] public So_ShelfConfig _shelfConfig;
[LabelText("货物所属工具组"),ShowInInspector] public Dictionary<string,Transform> _stations = new Dictionary<string, Transform>();
[ShowInInspector]private ContainerInfo _currentContainerInfo = null;
private ShelfMachineToolActor _shelfMachineToolActor;
protected override void OnLoad()
{
base.OnLoad();
_shelfConfig = Resources.Load<So_ShelfConfig>(AssetLocationSetting.SoSelfConfig + _id);
_shelfMachineToolActor = GetComponentInChildren<ShelfMachineToolActor>();
InitStations();
}
/// <summary>
/// 初始化装取货站台数据
/// </summary>
private void InitStations()
{
var stations = GameObject.FindGameObjectsWithTag(TagSetting.ShelfStation);
Debug.Log(stations.Length);
foreach (var stationGo in stations)
{
var stationData = stationGo.name.Split('-');
int row = int.Parse(stationData[0]);
int column = int.Parse(stationData[1]);
int layer = int.Parse(stationData[2]);
if (!IsContainGroup(row)) continue;
_stations.Add(stationGo.name,stationGo.transform);
}
}
/// <summary>
/// 取货
/// </summary>
public void LoadContainer(string station,ContainerInfo container)
{
}
/// <summary>
/// 装货
/// </summary>
public void LoadTest(ContainerInfo container)
{
Debug.LogWarning("取货成功");
_currentContainerInfo = container;
Transform station = null;
foreach (var stationT in _stations.Values)
{
var containerPrefab = Resources.Load<GameObject>(AssetLocationSetting.ContainerPath);
GameObject go = Instantiate(containerPrefab);
container.container = go;
go.SetTransformNoScale(stationT);
station = stationT;
}
_shelfMachineToolActor.Load(station,container,_shelfConfig);
}
/// <summary>
/// 判断这个货物是否包含这个组内
/// </summary>
/// <param name="group"></param>
/// <returns></returns>
public bool IsContainGroup(int group)
{
return _shelfConfig.groups.Contains(group);
}
} }
/// <summary>
/// 判断这个货物是否包含这个组内
/// </summary>
/// <param name="group"></param>
/// <returns></returns>
public bool IsContainGroup(int group)
{
return _group.Contains(group);
}
} }

View File

@ -0,0 +1,206 @@
using System;
using Animancer;
using GameLogic;
using NodeCanvas.BehaviourTrees;
using PrimeTween;
using Sirenix.OdinInspector;
using UnityEngine;
using UnityEngine.Serialization;
namespace GameLogic
{
public class ShelfMachineToolActor : Actor
{
[ShowInInspector,ReadOnly]private BehaviourTreeOwner _behaviourTreeOwner;
[ShowInInspector,ReadOnly]public ShelfToolActionType _actionType = ShelfToolActionType.None;
[ShowInInspector,ReadOnly] public float _moveSpeed = 5;
[ShowInInspector,ReadOnly] public float _moveSeconds = 0;
[ShowInInspector] public So_ShelfConfig _shelfconfig = null;
[Title("私有参数")]
[ShowInInspector,ReadOnly] private bool _isPlayingAnim = false;
[ShowInInspector,ReadOnly] private ShelfRowAnimData _shelfRowAnimData = null;
[ShowInInspector,ReadOnly] private Transform _containerPlaceToolParent = null;
[Title("组件参数")]
private Transform _caroparent;
private Transform _station;
private ContainerInfo _currentContainerInfo;
private AnimancerComponent _animancer;
[LabelText("堆垛机拿取货物动画上偏移")] public float _upOffest = 0.2F;
[LabelText("堆垛机放下货物动画下偏移")] public float _downOffest = -0.2F;
[Title("加载参数")]
[ShowInInspector,BoxGroup("Load"),ReadOnly]public bool _isInitLoadPositionComplete = false;
[ShowInInspector,BoxGroup("Load"),ReadOnly]public bool _isEnableLoadStartAnimationComplete = false;
[ShowInInspector,BoxGroup("Load"),ReadOnly]public bool _isEnableStartLoadToShelfPosition = false;
protected override void OnLoad()
{
base.OnLoad();
_behaviourTreeOwner = GetComponent<BehaviourTreeOwner>();
_animancer = GetComponent<AnimancerComponent>();
_caroparent = transform.Find("Caro-parent").Find("Cargo");
_containerPlaceToolParent = _caroparent.Find("fork").Find("k");
}
protected override void RegisterEvent()
{
base.RegisterEvent();
}
private void OnDestroy()
{
// GameEvent.RemoveListener(EventSetting.PlayStretchComplete,PlayLoadStretchComplete);
}
/// <summary>
/// 计算速度
/// </summary>
/// <param name="distance"></param>
private void CalculateSpeedSecond(float distance)
{
_moveSeconds = distance / _moveSpeed;
}
#region
/// <summary>
/// 装货
/// </summary>
public void Load(Transform station,ContainerInfo containerInfo,So_ShelfConfig config)
{
_actionType = ShelfToolActionType.Load;
_station = station;
_currentContainerInfo = containerInfo;
_shelfconfig = config;
_behaviourTreeOwner.StartBehaviour();
}
public void ResetParam()
{
_isPlayingAnim = false;
}
/// <summary>
/// 第一步移动到初始位置点
/// </summary>
/// <returns></returns>
public bool InitLoadPositionComplete()
{
if (!_isPlayingAnim)
{
_isPlayingAnim = true;
CalculateSpeedSecond(Vector3.Distance(transform.position, _station.position));
Tween.PositionX(transform, _station.position.x, _moveSeconds,Ease.Linear).OnComplete(()=>
{
Debug.Log("完成初始化");
_isInitLoadPositionComplete = true;
ResetParam();
});
Tween.PositionY(_caroparent, _station.position.y+0.14f, _moveSeconds, Ease.Linear);
}
return _isInitLoadPositionComplete;
}
/// <summary>
/// 第二部开启装货动画
/// </summary>
/// <returns></returns>
public bool EnableLoadStartAnimation()
{
if (!_isPlayingAnim)
{
GameEvent.AddListener(EventSetting.PlayStretchPickUpComplete,PlayLoadStretchPickUpComplete);
GameEvent.AddListener(EventSetting.PlayShrinkComplete,PlayLoadShrinkComplete);
Debug.Log("开始播放伸动画" + DataUtility.GetRow(_station.name));
_isPlayingAnim = true;
_shelfRowAnimData = _shelfconfig.GetAnimaData(DataUtility.GetRow(_station.name));
_shelfRowAnimData.stretch.events = GetAnimationEvent(ToolActionType.PickUp);
_animancer.Play(_shelfRowAnimData.stretch);
}
return _isEnableLoadStartAnimationComplete;
}
/// <summary>
/// 第三步定位位置
/// </summary>
/// <returns></returns>
public bool EnableStartLoadToShelfPosition()
{
if (!_isPlayingAnim)
{
_isPlayingAnim = true;
CalculateSpeedSecond(Vector3.Distance(transform.position,_currentContainerInfo.mapContainer.transform.position));
Tween.PositionX(transform, _currentContainerInfo.mapContainer.transform.position.x, _moveSeconds,Ease.Linear).OnComplete(()=>
{
Debug.Log("到达货物放置位置");
_isEnableStartLoadToShelfPosition = true;
ResetParam();
});
Tween.PositionY(_caroparent, _currentContainerInfo.mapContainer.transform.position.y, _moveSeconds, Ease.Linear);
}
return _isEnableStartLoadToShelfPosition;
}
private AnimationEvent[] GetAnimationEvent(ToolActionType actionType)
{
AnimationEvent evt = _shelfRowAnimData.stretch.events[0];
evt.functionName = "PlayStretchComplete";
evt.intParameter = (int)actionType;
return new AnimationEvent[] { evt };
}
#region
public void PlayLoadStretchPickUpComplete(object data)
{
Debug.Log("伸动画完成");
_currentContainerInfo.container.SetParent(_containerPlaceToolParent);
Tween.LocalPosition(_currentContainerInfo.container.transform, Vector3.zero, 0.1f).OnComplete(() =>
{
ResetParam();
});
Tween.PositionY(_caroparent, _caroparent.transform.position.y+_upOffest, 1f).OnComplete(() =>
{
_animancer.Play(_shelfRowAnimData.shrink);
});
//
}
public void PlayLoadShrinkComplete(object data)
{
_isEnableLoadStartAnimationComplete = true;
}
#endregion
#endregion
#region
/// <summary>
/// 取货
/// </summary>
public void UnLoad()
{
_actionType = ShelfToolActionType.UnLoad;
}
#endregion
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: a0e58b47bf55898428028fa90be72aa2

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0084f04044682644a82e08aa38fd3db2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,41 @@
using System;
using UnityEngine;
namespace GameLogic
{
public class AnimationEventComponent : MonoBehaviour
{
public void PlayStretchComplete(int data)
{
if (Enum.IsDefined(typeof(ToolActionType), data))
{
ToolActionType action = (ToolActionType)data;
Debug.Log($"Received ToolActionType: {action}");
switch (action)
{
case ToolActionType.PickUp:
GameEvent.Send(EventSetting.PlayStretchPickUpComplete);
break;
case ToolActionType.PutDown:
GameEvent.Send(EventSetting.PlayStretchPutDownComplete);
break;
default:
Debug.LogWarning($"Unhandled ToolActionType: {action}");
break;
}
}
else
{
Debug.LogWarning($"Invalid ToolActionType value: {data}");
}
}
public void PlayShrinkComplete()
{
GameEvent.Send(EventSetting.PlayShrinkComplete);
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6e8ba6bad3c56e84d878078b440529f3

View File

@ -1,20 +1,18 @@
 using Sirenix.OdinInspector;
using Sirenix.OdinInspector;
using UnityEngine; using UnityEngine;
using UnityEngine.Serialization;
namespace GameLogic
[System.Serializable]
public class ContainerInfo
{ {
[LabelText("货物")]public GameObject container; [System.Serializable]
[LabelText("货架")] public ShelfActor shelf; public class ContainerInfo
{
[LabelText("货物")] public GameObject mapContainer;
[LabelText("货物")] public GameObject container;
[LabelText("货架")] public ShelfActor shelf;
[LabelText("货架排")]public int shelfRow; [LabelText("货架排")] public int shelfRow;
[LabelText("货架列")]public int shelColumn; [LabelText("货架列")] public int shelColumn;
[LabelText("货架层")]public int shelfLayer; [LabelText("货架层")] public int shelfLayer;
}
} }

View File

@ -0,0 +1,19 @@
using Sirenix.OdinInspector;
using UnityEngine;
namespace GameLogic
{
[System.Serializable]
public class ShelfRowAnimData
{
/// <summary>
/// 伸动画
/// </summary>
[LabelText("伸动画")] public AnimationClip stretch;
/// <summary>
/// 缩动画
/// </summary>
[LabelText("缩动画")] public AnimationClip shrink ;
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e17fdddd9422427ba7bdbb7c49c96fb1
timeCreated: 1746680862

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: db135584c06f406d8e113c3363ca229f
timeCreated: 1746668246

View File

@ -0,0 +1,33 @@
using UnityEngine;
namespace GameLogic
{
public static class GameObjectExtension
{
public static void SetPosition(this GameObject self, Vector3 position)
{
self.transform.position = position;
}
public static void SetPosition(this GameObject self, Transform transform)
{
self.transform.position = transform.position;
}
public static void SetTransformNoScale(this GameObject self, Transform transform)
{
self.transform.position = transform.position;
self.transform.rotation = transform.rotation;
}
public static void SetTransform(this GameObject self, Transform transform)
{
self.transform.position = transform.position;
self.transform.rotation = transform.rotation;
self.transform.localScale = transform.localScale;
}
public static void SetParent(this GameObject self, Transform parent)
{
self.transform.SetParent(parent);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b598db33ceb24c38aaba8bf6c2d8b5fe
timeCreated: 1746668261

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 05c9f423a585a4d48a7f7348eebb38d0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,146 @@
using System;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 游戏事件系统 - 静态类
/// 提供添加监听、发送事件和移除监听的功能
/// </summary>
public static class GameEvent
{
// 使用字典存储事件名称和对应的监听器列表
private static Dictionary<string, List<Action<object>>> eventDictionary = new Dictionary<string, List<Action<object>>>();
/// <summary>
/// 添加事件监听
/// </summary>
/// <param name="eventName">事件名称</param>
/// <param name="listener">事件监听器</param>
public static void AddListener(string eventName, Action<object> listener)
{
// 检查事件名称是否为空
if (string.IsNullOrEmpty(eventName))
{
Debug.LogError("GameEvent: 事件名称不能为空!");
return;
}
// 检查监听器是否为空
if (listener == null)
{
Debug.LogError("GameEvent: 监听器不能为空!");
return;
}
// 如果事件不存在,创建新的监听器列表
if (!eventDictionary.ContainsKey(eventName))
{
eventDictionary[eventName] = new List<Action<object>>();
}
// 添加监听器到列表中
eventDictionary[eventName].Add(listener);
}
/// <summary>
/// 发送事件
/// </summary>
/// <param name="eventName">事件名称</param>
/// <param name="param">事件参数</param>
public static void Send(string eventName, object param = null)
{
// 检查事件名称是否为空
if (string.IsNullOrEmpty(eventName))
{
Debug.LogError("GameEvent: 事件名称不能为空!");
return;
}
// 如果事件不存在,直接返回
if (!eventDictionary.ContainsKey(eventName))
{
return;
}
// 获取监听器列表
List<Action<object>> listeners = eventDictionary[eventName];
// 调用所有监听器
for (int i = 0; i < listeners.Count; i++)
{
try
{
listeners[i].Invoke(param);
}
catch (Exception e)
{
Debug.LogError($"GameEvent: 执行事件 '{eventName}' 的监听器时发生异常: {e.Message}");
}
}
}
/// <summary>
/// 移除事件监听
/// </summary>
/// <param name="eventName">事件名称</param>
/// <param name="listener">事件监听器</param>
public static void RemoveListener(string eventName, Action<object> listener)
{
// 检查事件名称是否为空
if (string.IsNullOrEmpty(eventName))
{
Debug.LogError("GameEvent: 事件名称不能为空!");
return;
}
// 检查监听器是否为空
if (listener == null)
{
Debug.LogError("GameEvent: 监听器不能为空!");
return;
}
// 如果事件不存在,直接返回
if (!eventDictionary.ContainsKey(eventName))
{
return;
}
// 从列表中移除监听器
eventDictionary[eventName].Remove(listener);
// 如果监听器列表为空,移除事件
if (eventDictionary[eventName].Count == 0)
{
eventDictionary.Remove(eventName);
}
}
/// <summary>
/// 清除所有事件监听
/// </summary>
public static void ClearAllEvents()
{
eventDictionary.Clear();
}
/// <summary>
/// 清除指定事件的所有监听
/// </summary>
/// <param name="eventName">事件名称</param>
public static void ClearEvent(string eventName)
{
// 检查事件名称是否为空
if (string.IsNullOrEmpty(eventName))
{
Debug.LogError("GameEvent: 事件名称不能为空!");
return;
}
// 如果事件存在,移除整个事件
if (eventDictionary.ContainsKey(eventName))
{
eventDictionary.Remove(eventName);
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6c9829ebe0411e346b713453e904b1c0

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 436600838c80455bad0101cdb79344ba
timeCreated: 1746664720

View File

@ -0,0 +1,9 @@
namespace GameLogic
{
public static class AssetLocationSetting
{
public static readonly string ContainerPath = "YCLZT";
public static readonly string SoSelfConfig = "So/Shelf/shelfConfig_";
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6a48acd0bb5e4b7bafc551658911f6cc
timeCreated: 1746667972

View File

@ -0,0 +1,9 @@
namespace GameLogic
{
public static class EventSetting
{
public static readonly string PlayStretchPickUpComplete = "PlayStretchPickUpComplete";
public static readonly string PlayStretchPutDownComplete = "PlayStretchPutDownComplete";
public static readonly string PlayShrinkComplete = "PlayShrinkComplete";
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c5c04078ec0a4988ae596c3ae0c564ac
timeCreated: 1746686567

View File

@ -0,0 +1,7 @@
namespace GameLogic
{
public static class TagSetting
{
public static readonly string ShelfStation = "ShelfStation";
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 71a6c10d17b44e109791ed532986b5d0
timeCreated: 1746664730

View File

@ -0,0 +1,26 @@
using UnityEngine;
namespace GameLogic
{
public static class DataUtility
{
public static int GetRow(string data)
{
var array = data.Split('-');
return int.Parse(array[0]);
}
public static int GetColumn(string data)
{
var array = data.Split('-');
return int.Parse(array[1]);
}
public static int GetLayer(string data)
{
var array = data.Split('-');
return int.Parse(array[2]);
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 4afb7fbb72f215d4aae9cca6e4e9badc

View File

@ -1,17 +1,20 @@
 using System;
using System;
using UnityEngine; using UnityEngine;
public static class ContainerFactory namespace GameLogic
{ {
public static ContainerInfo CreateInfo(GameObject container,ShelfActor shelf,int shelfRow,int shelColumn,int shelfLayer) public static class ContainerFactory
{ {
var containerInfo = Activator.CreateInstance<ContainerInfo>(); public static ContainerInfo CreateInfo(GameObject mapContainer, ShelfActor shelf, int shelfRow, int shelColumn,
containerInfo.container = container; int shelfLayer)
containerInfo.shelf = shelf; {
containerInfo.shelfRow = shelfRow; var containerInfo = Activator.CreateInstance<ContainerInfo>();
containerInfo.shelColumn = shelColumn; containerInfo.mapContainer = mapContainer;
containerInfo.shelfLayer = shelfLayer; containerInfo.shelf = shelf;
return containerInfo; containerInfo.shelfRow = shelfRow;
containerInfo.shelColumn = shelColumn;
containerInfo.shelfLayer = shelfLayer;
return containerInfo;
}
} }
} }

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 38a9b33e115c0124bafea9389ff3ed38
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,25 @@
using System.Collections.Generic;
using Sirenix.OdinInspector;
using UnityEngine;
namespace GameLogic
{
[CreateAssetMenu(fileName = "shelfConfig_", menuName = "数字孪生/ShelfConfig")]
public class So_ShelfConfig : SerializedScriptableObject
{
[LabelText("货物所属工具组"),ShowInInspector] public List<int> groups = new List<int>();
[LabelText("伸缩动画"),ShowInInspector]public Dictionary<int,ShelfRowAnimData> shelfAnimDatas = new Dictionary<int, ShelfRowAnimData>();
public ShelfRowAnimData GetAnimaData(int row)
{
return shelfAnimDatas.GetValueOrDefault(row);
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 2dd819b1a17000747b98d533a289c5eb

View File

@ -334,4 +334,11 @@ AnimationClip:
m_EulerEditorCurves: [] m_EulerEditorCurves: []
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events:
- time: 1.3333334
functionName: PlayStretchComplete
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0

View File

@ -20,7 +20,7 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: {x: 0, y: 0.0067, z: 0.71499926} value: {x: 0, y: 0.0067, z: -0.536}
inSlope: {x: 0, y: 0, z: 0} inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0 tangentMode: 0
@ -28,17 +28,17 @@ AnimationClip:
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3 - serializedVersion: 3
time: 0.8333333 time: 0.6666667
value: {x: 0, y: 0.0067, z: 0.364} value: {x: 0, y: 0.0067, z: -0.223}
inSlope: {x: 0, y: 0, z: -0.46888837} inSlope: {x: 0, y: 0, z: 0.46785003}
outSlope: {x: 0, y: 0, z: -0.46888837} outSlope: {x: 0, y: 0, z: 0.46785003}
tangentMode: 0 tangentMode: 0
weightedMode: 0 weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3 - serializedVersion: 3
time: 1.35 time: 1.3333334
value: {x: 0, y: 0.0067, z: 0.082} value: {x: 0, y: 0.0067, z: 0.0878}
inSlope: {x: 0, y: 0, z: 0} inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0 tangentMode: 0
@ -54,7 +54,7 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: {x: 31.3795, y: -0.5468, z: 18.414} value: {x: 31.3795, y: -0.5468, z: 17.854}
inSlope: {x: 0, y: 0, z: 0} inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0 tangentMode: 0
@ -62,8 +62,8 @@ AnimationClip:
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3 - serializedVersion: 3
time: 1.35 time: 1.3333334
value: {x: 31.3795, y: -0.5468, z: 18.132004} value: {x: 31.3795, y: -0.5468, z: 18.1648}
inSlope: {x: 0, y: 0, z: 0} inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0 tangentMode: 0
@ -108,7 +108,7 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0 m_AdditiveReferencePoseTime: 0
m_StartTime: 0 m_StartTime: 0
m_StopTime: 1.35 m_StopTime: 1.3333334
m_OrientationOffsetY: 0 m_OrientationOffsetY: 0
m_Level: 0 m_Level: 0
m_CycleOffset: 0 m_CycleOffset: 0
@ -138,7 +138,7 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 0.8333333 time: 0.6666667
value: 0 value: 0
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
@ -147,7 +147,7 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 1.35 time: 1.3333334
value: 0 value: 0
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
@ -177,7 +177,7 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 0.8333333 time: 0.6666667
value: 0.0067 value: 0.0067
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
@ -186,7 +186,7 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 1.35 time: 1.3333334
value: 0.0067 value: 0.0067
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
@ -208,7 +208,7 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 0.71499926 value: -0.536
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
tangentMode: 136 tangentMode: 136
@ -216,17 +216,17 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 0.8333333 time: 0.6666667
value: 0.364 value: -0.223
inSlope: -0.46888837 inSlope: 0.46785003
outSlope: -0.46888837 outSlope: 0.46785003
tangentMode: 136 tangentMode: 136
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 1.35 time: 1.3333334
value: 0.082 value: 0.0878
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
tangentMode: 136 tangentMode: 136
@ -255,7 +255,7 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 1.35 time: 1.3333334
value: 31.3795 value: 31.3795
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
@ -285,7 +285,7 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 1.35 time: 1.3333334
value: -0.5468 value: -0.5468
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
@ -307,7 +307,7 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 18.414 value: 17.854
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
tangentMode: 136 tangentMode: 136
@ -315,8 +315,8 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 1.35 time: 1.3333334
value: 18.132004 value: 18.1648
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
tangentMode: 136 tangentMode: 136
@ -334,4 +334,11 @@ AnimationClip:
m_EulerEditorCurves: [] m_EulerEditorCurves: []
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events:
- time: 1.3333334
functionName: PlayShrinkComplete
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 35f948453d152a04986763f636b3c194 guid: c7c24aeb0ca291d4583b5e28baf58f80
NativeFormatImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 7400000 mainObjectFileID: 7400000

View File

@ -494,4 +494,11 @@ AnimationClip:
m_EulerEditorCurves: [] m_EulerEditorCurves: []
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events:
- time: 2
functionName: PlayStretchComplete
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0

View File

@ -458,4 +458,11 @@ AnimationClip:
m_EulerEditorCurves: [] m_EulerEditorCurves: []
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events:
- time: 1.6666666
functionName: PlayShrinkComplete
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0

View File

@ -334,4 +334,11 @@ AnimationClip:
m_EulerEditorCurves: [] m_EulerEditorCurves: []
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events:
- time: 1
functionName: PlayStretchComplete
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0

View File

@ -20,7 +20,7 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: {x: 0, y: 0.0067, z: -0.536} value: {x: 0, y: 0.0067, z: 0.71499926}
inSlope: {x: 0, y: 0, z: 0} inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0 tangentMode: 0
@ -28,17 +28,17 @@ AnimationClip:
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3 - serializedVersion: 3
time: 0.6666667 time: 0.8333333
value: {x: 0, y: 0.0067, z: -0.223} value: {x: 0, y: 0.0067, z: 0.364}
inSlope: {x: 0, y: 0, z: 0.46785003} inSlope: {x: 0, y: 0, z: -0.46888837}
outSlope: {x: 0, y: 0, z: 0.46785003} outSlope: {x: 0, y: 0, z: -0.46888837}
tangentMode: 0 tangentMode: 0
weightedMode: 0 weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3 - serializedVersion: 3
time: 1.3333334 time: 1.35
value: {x: 0, y: 0.0067, z: 0.0878} value: {x: 0, y: 0.0067, z: 0.082}
inSlope: {x: 0, y: 0, z: 0} inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0 tangentMode: 0
@ -54,7 +54,7 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: {x: 31.3795, y: -0.5468, z: 17.854} value: {x: 31.3795, y: -0.5468, z: 18.414}
inSlope: {x: 0, y: 0, z: 0} inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0 tangentMode: 0
@ -62,8 +62,8 @@ AnimationClip:
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3 - serializedVersion: 3
time: 1.3333334 time: 1.35
value: {x: 31.3795, y: -0.5468, z: 18.1648} value: {x: 31.3795, y: -0.5468, z: 18.132004}
inSlope: {x: 0, y: 0, z: 0} inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0 tangentMode: 0
@ -108,7 +108,7 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0 m_AdditiveReferencePoseTime: 0
m_StartTime: 0 m_StartTime: 0
m_StopTime: 1.3333334 m_StopTime: 1.35
m_OrientationOffsetY: 0 m_OrientationOffsetY: 0
m_Level: 0 m_Level: 0
m_CycleOffset: 0 m_CycleOffset: 0
@ -138,7 +138,7 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 0.6666667 time: 0.8333333
value: 0 value: 0
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
@ -147,7 +147,7 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 1.3333334 time: 1.35
value: 0 value: 0
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
@ -177,7 +177,7 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 0.6666667 time: 0.8333333
value: 0.0067 value: 0.0067
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
@ -186,7 +186,7 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 1.3333334 time: 1.35
value: 0.0067 value: 0.0067
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
@ -208,7 +208,7 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: -0.536 value: 0.71499926
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
tangentMode: 136 tangentMode: 136
@ -216,17 +216,17 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 0.6666667 time: 0.8333333
value: -0.223 value: 0.364
inSlope: 0.46785003 inSlope: -0.46888837
outSlope: 0.46785003 outSlope: -0.46888837
tangentMode: 136 tangentMode: 136
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 1.3333334 time: 1.35
value: 0.0878 value: 0.082
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
tangentMode: 136 tangentMode: 136
@ -255,7 +255,7 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 1.3333334 time: 1.35
value: 31.3795 value: 31.3795
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
@ -285,7 +285,7 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 1.3333334 time: 1.35
value: -0.5468 value: -0.5468
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
@ -307,7 +307,7 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 17.854 value: 18.414
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
tangentMode: 136 tangentMode: 136
@ -315,8 +315,8 @@ AnimationClip:
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 1.3333334 time: 1.35
value: 18.1648 value: 18.132004
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
tangentMode: 136 tangentMode: 136
@ -334,4 +334,11 @@ AnimationClip:
m_EulerEditorCurves: [] m_EulerEditorCurves: []
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events:
- time: 1.35
functionName: PlayShrinkComplete
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: c7c24aeb0ca291d4583b5e28baf58f80 guid: 35f948453d152a04986763f636b3c194
NativeFormatImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 7400000 mainObjectFileID: 7400000

View File

@ -530,4 +530,11 @@ AnimationClip:
m_EulerEditorCurves: [] m_EulerEditorCurves: []
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events:
- time: 1.6666666
functionName: PlayStretchComplete
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0

View File

@ -458,4 +458,11 @@ AnimationClip:
m_EulerEditorCurves: [] m_EulerEditorCurves: []
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events:
- time: 1.6833333
functionName: PlayShrinkComplete
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: da2e19a1c5f8b4e2ca7c1785ea338b2e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e6cc44d08e8de4cf7878638624e59a94
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 13170347bc506405f88d3a87bd0982b3
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 252960
packageName: "PrimeTween \xB7 High-Performance Animations and Sequences"
packageVersion: 1.3.1
assetPath: Assets/Plugins/PrimeTween/Demo/Demo.unity
uploadId: 752333

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 15054139658a5445689224c71f805b10
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 252960
packageName: "PrimeTween \xB7 High-Performance Animations and Sequences"
packageVersion: 1.3.1
assetPath: Assets/Plugins/PrimeTween/Demo/Demo_URP.unity
uploadId: 752333

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4788bd8dfc445485781b23a4cf21188b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,34 @@
#if PRIME_TWEEN_INSTALLED
using PrimeTween;
using UnityEngine;
namespace PrimeTweenDemo {
public abstract class Clickable : MonoBehaviour {
public virtual void OnClick() {}
}
public abstract class Animatable : Clickable {
public abstract Sequence Animate(bool toEndValue);
}
#if UNITY_EDITOR
[UnityEditor.CustomEditor(typeof(Clickable), true), UnityEditor.CanEditMultipleObjects]
internal class InspectorWithButton : UnityEditor.Editor {
GUIStyle boldButtonStyle;
public override void OnInspectorGUI() {
DrawDefaultInspector();
GUILayout.Space(8);
if (boldButtonStyle == null) {
boldButtonStyle = new GUIStyle(GUI.skin.button) { fontStyle = FontStyle.Bold };
}
if (GUILayout.Button("Play Animation", boldButtonStyle)) {
foreach (var t in targets) {
(t as Clickable).OnClick();
}
}
}
}
#endif
}
#endif

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: f631a276db10467c9860e2814855df25
timeCreated: 1695283968
AssetOrigin:
serializedVersion: 1
productId: 252960
packageName: "PrimeTween \xB7 High-Performance Animations and Sequences"
packageVersion: 1.3.1
assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/Animatable.cs
uploadId: 752333

View File

@ -0,0 +1,29 @@
#if PRIME_TWEEN_INSTALLED
using PrimeTween;
using UnityEngine;
namespace PrimeTweenDemo {
public class Baggage : Animatable {
[SerializeField] Transform animationAnchor;
Sequence sequence;
public override void OnClick() {
PlayFlipAnimation();
}
public override Sequence Animate(bool _) {
return PlayFlipAnimation();
}
Sequence PlayFlipAnimation() {
if (!sequence.isAlive) {
const float jumpDuration = 0.3f;
sequence = Tween.LocalPositionZ(animationAnchor, 0.2f, jumpDuration)
.Chain(Tween.LocalEulerAngles(animationAnchor, Vector3.zero, new Vector3(0, 360, 0), 0.9f, Ease.InOutBack))
.Chain(Tween.LocalPositionZ(animationAnchor, 0, jumpDuration));
}
return sequence;
}
}
}
#endif

View File

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 27b542649ab4a463aa343c437387783e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 252960
packageName: "PrimeTween \xB7 High-Performance Animations and Sequences"
packageVersion: 1.3.1
assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/Baggage.cs
uploadId: 752333

View File

@ -0,0 +1,57 @@
#if PRIME_TWEEN_INSTALLED && UNITY_UGUI_INSTALLED
using PrimeTween;
using UnityEngine;
using UnityEngine.EventSystems;
namespace PrimeTweenDemo {
public class CameraController : Clickable {
[SerializeField] HighlightedElementController highlightedElementController;
[SerializeField] SwipeTutorial swipeTutorial;
[SerializeField] Camera mainCamera;
[SerializeField, Range(0f, 1f)] float cameraShakeStrength = 0.4f;
float currentAngle;
Vector2? inputBeginPos;
bool isAnimating;
float curRotationSpeed;
void OnEnable() {
currentAngle = transform.localEulerAngles.y;
isAnimating = true;
Tween.Custom(this, 0, 5, 2, (target, val) => target.curRotationSpeed = val);
}
void Update() {
if (isAnimating) {
currentAngle += curRotationSpeed * Time.deltaTime;
transform.localEulerAngles = new Vector3(0f, currentAngle);
}
if (highlightedElementController.current == null && InputController.GetDown() && !EventSystem.current.IsPointerOverGameObject()) {
inputBeginPos = InputController.screenPosition;
}
if (InputController.GetUp()) {
inputBeginPos = null;
}
if (inputBeginPos.HasValue) {
var deltaMove = InputController.screenPosition - inputBeginPos.Value;
if (Mathf.Abs(deltaMove.x) / Screen.width > 0.05f) {
isAnimating = false;
inputBeginPos = null;
currentAngle += Mathf.Sign(deltaMove.x) * 45f;
Tween.LocalRotation(transform, new Vector3(0f, currentAngle), 1.5f, Ease.OutCubic);
swipeTutorial.Hide();
}
}
}
public override void OnClick() => ShakeCamera();
public void ShakeCamera() {
Shake();
}
internal Sequence Shake(float startDelay = 0) {
return Tween.ShakeCamera(mainCamera, cameraShakeStrength, startDelay: startDelay);
}
}
}
#endif

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 3f2f29997e7148b98e1d84f3de1011bc
timeCreated: 1682326446
AssetOrigin:
serializedVersion: 1
productId: 252960
packageName: "PrimeTween \xB7 High-Performance Animations and Sequences"
packageVersion: 1.3.1
assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/CameraController.cs
uploadId: 752333

View File

@ -0,0 +1,57 @@
#if PRIME_TWEEN_INSTALLED
using PrimeTween;
using UnityEngine;
namespace PrimeTweenDemo {
public class CameraProjectionMatrixAnimation : Clickable {
[SerializeField] Camera mainCamera;
float interpolationFactor;
bool isOrthographic;
Tween tween;
public override void OnClick() => AnimateCameraProjection();
public void AnimateCameraProjection() {
isOrthographic = !isOrthographic;
tween.Stop();
tween = Tween.Custom(this, interpolationFactor, isOrthographic ? 1 : 0, 0.6f, ease: Ease.InOutSine, onValueChange: (target, t) => {
target.InterpolateProjectionMatrix(t);
})
.OnComplete(this, target => {
target.mainCamera.orthographic = target.isOrthographic;
target.mainCamera.ResetProjectionMatrix();
});
}
void InterpolateProjectionMatrix(float _interpolationFactor) {
interpolationFactor = _interpolationFactor;
uint width = (uint)Screen.width;
uint height = (uint)Screen.height;
#if UNITY_EDITOR && UNITY_2022_2_OR_NEWER
if (!Application.isPlaying) {
UnityEditor.PlayModeWindow.GetRenderingResolution(out width, out height);
}
#endif
float aspect = (float)width / height;
float orthographicSize = mainCamera.orthographicSize;
var perspectiveMatrix = Matrix4x4.Perspective(mainCamera.fieldOfView, aspect, mainCamera.nearClipPlane, mainCamera.farClipPlane);
var orthoMatrix = Matrix4x4.Ortho(-orthographicSize * aspect, orthographicSize * aspect, -orthographicSize, orthographicSize, mainCamera.nearClipPlane, mainCamera.farClipPlane);
Matrix4x4 projectionMatrix = default;
for (int i = 0; i < 16; i++) {
projectionMatrix[i] = Mathf.Lerp(perspectiveMatrix[i], orthoMatrix[i], _interpolationFactor);
}
mainCamera.projectionMatrix = projectionMatrix;
#if UNITY_EDITOR
if (!Application.isPlaying) {
UnityEditor.SceneView.RepaintAll();
}
#endif
}
public bool IsAnimating => tween.isAlive;
}
}
#endif

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 900e84e1426b4fc8a386a58aaee3b4ba
timeCreated: 1685260544
AssetOrigin:
serializedVersion: 1
productId: 252960
packageName: "PrimeTween \xB7 High-Performance Animations and Sequences"
packageVersion: 1.3.1
assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/CameraProjectionMatrixAnimation.cs
uploadId: 752333

View File

@ -0,0 +1,132 @@
#if PRIME_TWEEN_INSTALLED && UNITY_UGUI_INSTALLED
using PrimeTween;
using UnityEngine.UI;
#endif
using UnityEngine;
namespace PrimeTweenDemo {
public class Demo : MonoBehaviour {
#if PRIME_TWEEN_INSTALLED && UNITY_UGUI_INSTALLED
[SerializeField] AnimateAllType animateAllType; enum AnimateAllType { Sequence, Async, Coroutine }
[SerializeField] Slider sequenceTimelineSlider;
[SerializeField] Text pausedLabel;
[SerializeField] Button animateAllPartsButton;
[SerializeField] TypewriterAnimatorExample typewriterAnimatorExample;
[SerializeField] Animatable[] animatables;
[SerializeField] Wheels wheels;
[SerializeField, Range(0.5f, 5f)] float timeScale = 1;
bool isAnimatingWithCoroutineOrAsync;
public Sequence animateAllSequence;
void Awake() {
PrimeTweenConfig.SetTweensCapacity(100);
}
void OnEnable() {
sequenceTimelineSlider.fillRect.gameObject.SetActive(false);
sequenceTimelineSlider.onValueChanged.AddListener(SequenceTimelineSliderChanged);
}
void OnDisable() => sequenceTimelineSlider.onValueChanged.RemoveListener(SequenceTimelineSliderChanged);
void SequenceTimelineSliderChanged(float sliderValue) {
if (!notifySliderChanged) {
return;
}
if (!animateAllSequence.isAlive) {
wheels.OnClick();
}
animateAllSequence.isPaused = true;
animateAllSequence.progressTotal = sliderValue;
}
bool notifySliderChanged = true;
void UpdateSlider() {
var isSliderVisible = animateAllType == AnimateAllType.Sequence && !isAnimatingWithCoroutineOrAsync;
sequenceTimelineSlider.gameObject.SetActive(isSliderVisible);
if (!isSliderVisible) {
return;
}
pausedLabel.gameObject.SetActive(animateAllSequence.isAlive && animateAllSequence.isPaused);
var isSequenceAlive = animateAllSequence.isAlive;
sequenceTimelineSlider.handleRect.gameObject.SetActive(isSequenceAlive);
if (isSequenceAlive) {
notifySliderChanged = false;
sequenceTimelineSlider.value = animateAllSequence.progressTotal; // Unity 2018 doesn't have SetValueWithoutNotify(), so use notifySliderChanged instead
notifySliderChanged = true;
}
}
void Update() {
Time.timeScale = timeScale;
animateAllPartsButton.GetComponent<Image>().enabled = !isAnimatingWithCoroutineOrAsync;
animateAllPartsButton.GetComponentInChildren<Text>().enabled = !isAnimatingWithCoroutineOrAsync;
UpdateSlider();
}
public void AnimateAll(bool toEndValue) {
if (isAnimatingWithCoroutineOrAsync) {
return;
}
switch (animateAllType) {
case AnimateAllType.Sequence:
AnimateAllSequence(toEndValue);
break;
case AnimateAllType.Async:
AnimateAllAsync(toEndValue);
break;
case AnimateAllType.Coroutine:
StartCoroutine(AnimateAllCoroutine(toEndValue));
break;
}
}
/// Tweens and sequences can be grouped with and chained to other tweens and sequences.
/// The advantage of using this method instead of <see cref="AnimateAllAsync"/> and <see cref="AnimateAllCoroutine"/> is the ability to stop/complete/pause the combined sequence.
/// Also, this method doesn't generate garbage related to starting a coroutine or awaiting an async method.
void AnimateAllSequence(bool toEndValue) {
if (animateAllSequence.isAlive) {
animateAllSequence.isPaused = !animateAllSequence.isPaused;
return;
}
animateAllSequence = Sequence.Create();
#if TEXT_MESH_PRO_INSTALLED
animateAllSequence.Group(typewriterAnimatorExample.Animate());
#endif
float delay = 0f;
foreach (var animatable in animatables) {
animateAllSequence.Insert(delay, animatable.Animate(toEndValue));
delay += 0.6f;
}
}
/// Tweens and sequences can be awaited in async methods.
async void AnimateAllAsync(bool toEndValue) {
isAnimatingWithCoroutineOrAsync = true;
foreach (var animatable in animatables) {
await animatable.Animate(toEndValue);
}
isAnimatingWithCoroutineOrAsync = false;
}
/// Tweens and sequences can also be used in coroutines with the help of ToYieldInstruction() method.
System.Collections.IEnumerator AnimateAllCoroutine(bool toEndValue) {
isAnimatingWithCoroutineOrAsync = true;
foreach (var animatable in animatables) {
yield return animatable.Animate(toEndValue).ToYieldInstruction();
}
isAnimatingWithCoroutineOrAsync = false;
}
#else // PRIME_TWEEN_INSTALLED
void Awake() {
Debug.LogError("Please install PrimeTween via 'Assets/Plugins/PrimeTween/PrimeTweenInstaller'.");
#if !UNITY_2019_1_OR_NEWER
Debug.LogError("And add the 'PRIME_TWEEN_INSTALLED' define to the 'Project Settings/Player/Scripting Define Symbols' to run the Demo in Unity 2018.");
#endif
}
#endif
}
}

View File

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 945298e218f9841b08c8270c494cb200
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 252960
packageName: "PrimeTween \xB7 High-Performance Animations and Sequences"
packageVersion: 1.3.1
assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/Demo.cs
uploadId: 752333

View File

@ -0,0 +1,35 @@
#if PRIME_TWEEN_INSTALLED
using PrimeTween;
using UnityEngine;
namespace PrimeTweenDemo {
public class DirectionalLightController : MonoBehaviour {
[SerializeField] Light directionalLight;
[SerializeField] Camera mainCamera;
[SerializeField] Color startColor;
[SerializeField] Color endColor;
float angleX;
float angleY;
void OnEnable() {
// This overload is simpler, but allocates small amount of garbage because 'this' reference is captured in a closure.
// It ok to use it once in a while but for hot code paths consider using the overload that accepts 'target' as first parameter.
var xRotationSettings = new TweenSettings<float>(45, 10, 10, Ease.Linear, -1, CycleMode.Yoyo);
Tween.Custom(xRotationSettings, newX => angleX = newX);
// This overload is more verbose, but doesn't allocate garbage.
var yRotationSettings = new TweenSettings<float>(45, 405, 20, Ease.Linear, -1);
Tween.Custom(this, yRotationSettings, (target, newY) => target.angleY = newY);
var colorSettings = new TweenSettings<Color>(startColor, endColor, 10, Ease.InCirc, -1, CycleMode.Rewind);
Tween.LightColor(directionalLight, colorSettings);
Tween.CameraBackgroundColor(mainCamera, colorSettings);
Tween.Custom(colorSettings, color => RenderSettings.fogColor = color);
}
void Update() {
transform.localEulerAngles = new Vector3(angleX, angleY);
}
}
}
#endif

View File

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: db622a6d0e0fa4b68852ef1a7fc60dba
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 252960
packageName: "PrimeTween \xB7 High-Performance Animations and Sequences"
packageVersion: 1.3.1
assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/DirectionalLightController.cs
uploadId: 752333

View File

@ -0,0 +1,29 @@
#if PRIME_TWEEN_INSTALLED && UNITY_UGUI_INSTALLED
using PrimeTween;
using UnityEngine;
namespace PrimeTweenDemo {
public class Door : Animatable {
[SerializeField] CameraController cameraController;
[SerializeField] Transform animationAnchor;
bool isClosed;
public override void OnClick() {
Animate(!isClosed);
}
public override Sequence Animate(bool _isClosed) {
if (isClosed == _isClosed) {
return Sequence.Create();
}
isClosed = _isClosed;
var rotationTween = Tween.LocalRotation(animationAnchor, _isClosed ? new Vector3(0, -90) : Vector3.zero, 0.7f, Ease.InOutElastic);
var sequence = Sequence.Create(rotationTween);
if (_isClosed) {
sequence.Group(cameraController.Shake(0.5f));
}
return sequence;
}
}
}
#endif

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 4efa7d4d94464bb0b3e6ea597eb13637
timeCreated: 1682159642
AssetOrigin:
serializedVersion: 1
productId: 252960
packageName: "PrimeTween \xB7 High-Performance Animations and Sequences"
packageVersion: 1.3.1
assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/Door.cs
uploadId: 752333

View File

@ -0,0 +1,25 @@
#if PRIME_TWEEN_INSTALLED
using PrimeTween;
using UnityEngine;
namespace PrimeTweenDemo {
public class Headlights : Animatable {
[SerializeField] AnimationCurve ease;
[SerializeField] Light[] lights;
bool isOn;
public override void OnClick() {
Animate(!isOn);
}
public override Sequence Animate(bool _isOn) {
isOn = _isOn;
var sequence = Sequence.Create();
foreach (var _light in lights) {
sequence.Group(Tween.LightIntensity(_light, _isOn ? 0.7f : 0, 0.8f, ease));
}
return sequence;
}
}
}
#endif

View File

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 7bc81275df8d244a1a7568f9443b5e93
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 252960
packageName: "PrimeTween \xB7 High-Performance Animations and Sequences"
packageVersion: 1.3.1
assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/Headlights.cs
uploadId: 752333

View File

@ -0,0 +1,17 @@
#if PRIME_TWEEN_INSTALLED
using UnityEngine;
namespace PrimeTweenDemo {
public class HighlightableElement : MonoBehaviour {
[SerializeField] public Transform highlightAnchor;
public MeshRenderer[] models { get; private set; }
void OnEnable() {
models = GetComponentsInChildren<MeshRenderer>();
foreach (var mr in models) {
_ = mr.material; // copy shared material
}
}
}
}
#endif

View File

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 5fbd7d6a5982d440282a82998473a306
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 252960
packageName: "PrimeTween \xB7 High-Performance Animations and Sequences"
packageVersion: 1.3.1
assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/HighlightableElement.cs
uploadId: 752333

View File

@ -0,0 +1,67 @@
#if PRIME_TWEEN_INSTALLED
using JetBrains.Annotations;
using PrimeTween;
using UnityEngine;
namespace PrimeTweenDemo {
public class HighlightedElementController : MonoBehaviour {
[SerializeField] Camera mainCamera;
[SerializeField] CameraProjectionMatrixAnimation cameraProjectionMatrixAnimation;
[CanBeNull] public HighlightableElement current { get; private set; }
void Awake() {
#if UNITY_2019_1_OR_NEWER && !PHYSICS_MODULE_INSTALLED
Debug.LogError("Please install the package needed for Physics.Raycast(): 'Package Manager/Packages/Built-in/Physics' (com.unity.modules.physics).");
#endif
}
void Update() {
if (cameraProjectionMatrixAnimation.IsAnimating) {
return;
}
if (InputController.touchSupported && !InputController.Get()) {
SetCurrentHighlighted(null);
return;
}
var ray = mainCamera.ScreenPointToRay(InputController.screenPosition);
var highlightableElement = RaycastHighlightableElement(ray);
SetCurrentHighlighted(highlightableElement);
if (current != null && InputController.GetDown()) {
current.GetComponent<Animatable>().OnClick();
}
}
[CanBeNull]
static HighlightableElement RaycastHighlightableElement(Ray ray) {
#if !UNITY_2019_1_OR_NEWER || PHYSICS_MODULE_INSTALLED
// If you're seeing a compilation error on the next line, please install the package needed for Physics.Raycast(): 'Package Manager/Packages/Built-in/Physics' (com.unity.modules.physics).
return Physics.Raycast(ray, out var hit) ? hit.collider.GetComponentInParent<HighlightableElement>() : null;
#else
return null;
#endif
}
void SetCurrentHighlighted([CanBeNull] HighlightableElement newHighlighted) {
if (newHighlighted != current) {
if (current != null) {
AnimateHighlightedElement(current, false);
}
current = newHighlighted;
if (newHighlighted != null) {
AnimateHighlightedElement(newHighlighted, true);
}
}
}
static readonly int emissionColorPropId = Shader.PropertyToID("_EmissionColor");
static void AnimateHighlightedElement([NotNull] HighlightableElement highlightable, bool isHighlighted) {
Tween.LocalPositionZ(highlightable.highlightAnchor, isHighlighted ? 0.08f : 0, 0.3f);
foreach (var model in highlightable.models) {
Tween.MaterialColor(model.material, emissionColorPropId, isHighlighted ? Color.white * 0.25f : Color.black, 0.2f, Ease.OutQuad);
}
}
}
}
#endif

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 9e831710f8fb47e4a09c640d573d1358
timeCreated: 1682327543
AssetOrigin:
serializedVersion: 1
productId: 252960
packageName: "PrimeTween \xB7 High-Performance Animations and Sequences"
packageVersion: 1.3.1
assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/HighlightedElementController.cs
uploadId: 752333

View File

@ -0,0 +1,114 @@
using UnityEngine;
#if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.EnhancedTouch;
using UnityEngine.InputSystem.UI;
using TouchPhase = UnityEngine.InputSystem.TouchPhase;
using Touch = UnityEngine.InputSystem.EnhancedTouch.Touch;
#endif
namespace PrimeTweenDemo {
public class InputController : MonoBehaviour {
void Awake() {
if (isNewInputSystemEnabled && !isLegacyInputManagerEnabled) {
gameObject.SetActive(false);
#if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM
var inputModule = gameObject.AddComponent<InputSystemUIInputModule>();
inputModule.pointerBehavior = UIPointerBehavior.AllPointersAsIs;
EnhancedTouchSupport.Enable();
#endif
gameObject.SetActive(true);
} else {
#if UNITY_UGUI_INSTALLED
gameObject.AddComponent<UnityEngine.EventSystems.StandaloneInputModule>();
#endif
}
}
static bool isNewInputSystemEnabled {
get {
#if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM
return true;
#else
return false;
#endif
}
}
static bool isLegacyInputManagerEnabled {
get {
#if ENABLE_LEGACY_INPUT_MANAGER
return true;
#else
return false;
#endif
}
}
public static bool touchSupported {
get {
#if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM
if (isNewInputSystemEnabled) {
return Touchscreen.current != null;
}
#endif
return Input.touchSupported;
}
}
public static bool GetDown() {
#if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM
if (Mouse.current != null) {
return Mouse.current.leftButton.wasPressedThisFrame;
}
if (isNewInputSystemEnabled) {
return Touch.activeTouches.Count > 0 && Touch.activeTouches[0].phase == TouchPhase.Began;
}
#endif
return Input.GetMouseButtonDown(0);
}
public static bool Get() {
#if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM
if (isNewInputSystemEnabled) {
if (Mouse.current != null) {
return Mouse.current.leftButton.isPressed;
}
if (Touch.activeTouches.Count == 0) {
return false;
}
var phase = Touch.activeTouches[0].phase;
return phase == TouchPhase.Stationary || phase == TouchPhase.Moved;
}
#endif
return Input.GetMouseButtonDown(0);
}
public static bool GetUp() {
#if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM
if (isNewInputSystemEnabled) {
if (Mouse.current != null) {
return Mouse.current.leftButton.wasReleasedThisFrame;
}
return Touch.activeTouches.Count > 0 && Touch.activeTouches[0].phase == TouchPhase.Ended;
}
#endif
return Input.GetMouseButtonUp(0);
}
public static Vector2 screenPosition {
get {
#if INPUT_SYSTEM_INSTALLED && ENABLE_INPUT_SYSTEM
if (isNewInputSystemEnabled) {
if (Mouse.current != null) {
return Mouse.current.position.ReadValue();
}
var activeTouches = Touch.activeTouches;
return activeTouches.Count > 0 ? activeTouches[0].screenPosition : Vector2.zero;
}
#endif
return Input.mousePosition;
}
}
}
}

View File

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: ea1502cb33ab4d4ca1fedbdde163c980
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 252960
packageName: "PrimeTween \xB7 High-Performance Animations and Sequences"
packageVersion: 1.3.1
assetPath: Assets/Plugins/PrimeTween/Demo/Scripts/InputController.cs
uploadId: 752333

View File

@ -0,0 +1,23 @@
#if PRIME_TWEEN_INSTALLED
using PrimeTween;
using UnityEngine;
namespace PrimeTweenDemo {
public class JumpAnimation : Clickable {
[SerializeField] Transform target;
Sequence sequence;
public override void OnClick() => PlayAnimation();
public void PlayAnimation() {
if (!sequence.isAlive) {
const float jumpDuration = 0.3f;
sequence = Tween.Scale(target, new Vector3(1.1f, 0.8f, 1.1f), 0.15f, Ease.OutQuad, 2, CycleMode.Yoyo)
.Chain(Tween.LocalPositionY(target, 1, jumpDuration))
.Chain(Tween.LocalEulerAngles(target, Vector3.zero, new Vector3(0, 360), 1.5f, Ease.InOutBack))
.Chain(Tween.LocalPositionY(target, 0, jumpDuration));
}
}
}
}
#endif

Some files were not shown because too many files have changed in this diff Show More