增加载具模型自动处理

main
刘涛 2024-01-11 13:33:30 +08:00
parent bc473f1da8
commit c6f6a20f91
31 changed files with 1556 additions and 12 deletions

View File

@ -267,6 +267,16 @@ MonoBehaviour:
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 13e94daf440c34846853c971361bbfb9
m_Address: Assets/Art/AutoGen/Vehicle/300001/vehicle_300001.prefab
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: bc388db5566b3934bae2a16b24944b1d
m_Address: Assets/Art/AutoGen/Vehicle/300002/vehicle_300002.prefab
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
m_ReadOnly: 0
m_Settings: {fileID: 11400000, guid: 57363d90d371d4f9297bcadcb2c690e7, type: 2}
m_SchemaSet:

View File

@ -0,0 +1,201 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1101 &-5904198036966363207
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -1379786115403473480}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.3181818
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &-3172016763720694332
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: attack
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 2402249005667265973}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 1827226128182048838, guid: e66d6496654db14448496431ebd3c421,
type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &-1379786115403473480
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: idle
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 1827226128182048838, guid: 8a65b08053961ea419d61ab9d53e3d28,
type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &-499984013468804422
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: skill
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: -5904198036966363207}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 1827226128182048838, guid: 8a65b08053961ea419d61ab9d53e3d28,
type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: animator_battery
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 5985944561270567404}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1101 &2402249005667265973
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -1379786115403473480}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &5518378706073410113
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -1379786115403473480}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1107 &5985944561270567404
AnimatorStateMachine:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: -3172016763720694332}
m_Position: {x: 370, y: 80, z: 0}
- serializedVersion: 1
m_State: {fileID: -1379786115403473480}
m_Position: {x: 380, y: 210, z: 0}
- serializedVersion: 1
m_State: {fileID: -499984013468804422}
m_Position: {x: 590, y: 80, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -3172016763720694332}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 80082eaa256477a4ea5382fad277451e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -38,19 +38,19 @@ AnimatorStateMachine:
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 7654025921473466551}
m_Position: {x: 290, y: 140, z: 0}
m_Position: {x: 280, y: 140, z: 0}
- serializedVersion: 1
m_State: {fileID: 5503712888978025044}
m_Position: {x: 270, y: 250, z: 0}
m_Position: {x: 280, y: 190, z: 0}
- serializedVersion: 1
m_State: {fileID: -3532341354856716944}
m_Position: {x: 520, y: 140, z: 0}
m_Position: {x: 280, y: 290, z: 0}
- serializedVersion: 1
m_State: {fileID: 163366979757978364}
m_Position: {x: 510, y: 250, z: 0}
m_Position: {x: 280, y: 340, z: 0}
- serializedVersion: 1
m_State: {fileID: -7618683655268744837}
m_Position: {x: 280, y: 350, z: 0}
m_Position: {x: 280, y: 240, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []

View File

@ -0,0 +1,223 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1102 &-7618683655268744837
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: stop
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 1827226128182048838, guid: 399e42acf9e75c64abd5a2737911758b,
type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1107 &-4706527531502479944
AnimatorStateMachine:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 7654025921473466551}
m_Position: {x: 280, y: 140, z: 0}
- serializedVersion: 1
m_State: {fileID: 5503712888978025044}
m_Position: {x: 280, y: 190, z: 0}
- serializedVersion: 1
m_State: {fileID: -3532341354856716944}
m_Position: {x: 280, y: 290, z: 0}
- serializedVersion: 1
m_State: {fileID: 163366979757978364}
m_Position: {x: 280, y: 340, z: 0}
- serializedVersion: 1
m_State: {fileID: -7618683655268744837}
m_Position: {x: 280, y: 240, z: 0}
- serializedVersion: 1
m_State: {fileID: 5949761285876363776}
m_Position: {x: 280, y: 390, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 7654025921473466551}
--- !u!1102 &-3532341354856716944
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: dead
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 1827226128182048838, guid: d988823f329c84e409e332748a6a8cf7,
type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: animator_vehicle
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: -4706527531502479944}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1102 &163366979757978364
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: restart
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 1827226128182048838, guid: a0920fb56c678844ebfdb27482146449,
type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &5503712888978025044
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: move
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 1827226128182048838, guid: 7bec30f1ab7fbc540adab3a677402184,
type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &5949761285876363776
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: skill
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 1827226128182048838, guid: d070090219ff8ab4587f1ee3ab09446f,
type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &7654025921473466551
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: idle
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 1827226128182048838, guid: d070090219ff8ab4587f1ee3ab09446f,
type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3fdd688456c4d71428ef4a4e4f18405f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

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

View File

@ -0,0 +1,19 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!221 &22100000
AnimatorOverrideController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ov_battery_300001
m_Controller: {fileID: 9100000, guid: 80082eaa256477a4ea5382fad277451e, type: 2}
m_Clips:
- m_OriginalClip: {fileID: 1827226128182048838, guid: e66d6496654db14448496431ebd3c421,
type: 3}
m_OverrideClip: {fileID: 1827226128182048838, guid: e66d6496654db14448496431ebd3c421,
type: 3}
- m_OriginalClip: {fileID: 1827226128182048838, guid: 8a65b08053961ea419d61ab9d53e3d28,
type: 3}
m_OverrideClip: {fileID: 1827226128182048838, guid: 8a65b08053961ea419d61ab9d53e3d28,
type: 3}

View File

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

View File

@ -0,0 +1,31 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!221 &22100000
AnimatorOverrideController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ov_vehicle_300001
m_Controller: {fileID: 9100000, guid: 3fdd688456c4d71428ef4a4e4f18405f, type: 2}
m_Clips:
- m_OriginalClip: {fileID: 1827226128182048838, guid: d070090219ff8ab4587f1ee3ab09446f,
type: 3}
m_OverrideClip: {fileID: 1827226128182048838, guid: d070090219ff8ab4587f1ee3ab09446f,
type: 3}
- m_OriginalClip: {fileID: 1827226128182048838, guid: 7bec30f1ab7fbc540adab3a677402184,
type: 3}
m_OverrideClip: {fileID: 1827226128182048838, guid: 7bec30f1ab7fbc540adab3a677402184,
type: 3}
- m_OriginalClip: {fileID: 1827226128182048838, guid: d988823f329c84e409e332748a6a8cf7,
type: 3}
m_OverrideClip: {fileID: 1827226128182048838, guid: d988823f329c84e409e332748a6a8cf7,
type: 3}
- m_OriginalClip: {fileID: 1827226128182048838, guid: a0920fb56c678844ebfdb27482146449,
type: 3}
m_OverrideClip: {fileID: 1827226128182048838, guid: a0920fb56c678844ebfdb27482146449,
type: 3}
- m_OriginalClip: {fileID: 1827226128182048838, guid: 399e42acf9e75c64abd5a2737911758b,
type: 3}
m_OverrideClip: {fileID: 1827226128182048838, guid: 399e42acf9e75c64abd5a2737911758b,
type: 3}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 183815035b9d60046b0f52d34d86c729
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 22100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,229 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6770644500165233157
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7803087331950724001}
m_Layer: 0
m_Name: vehicle_300001
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7803087331950724001
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6770644500165233157}
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:
- {fileID: 1845710902757240007}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &2168466951281855276
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 7803087331950724001}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_Name
value: C00001
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects:
- targetCorrespondingSourceObject: {fileID: 4014852071514518513, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
insertIndex: -1
addedObject: {fileID: 506792334716588255}
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
insertIndex: -1
addedObject: {fileID: 5467798728424433906}
m_SourcePrefab: {fileID: 100100000, guid: e1039a07c012c43ab88dac7b7b9a6065, type: 3}
--- !u!1 &1357440450878338685 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
m_PrefabInstance: {fileID: 2168466951281855276}
m_PrefabAsset: {fileID: 0}
--- !u!95 &5467798728424433906
Animator:
serializedVersion: 5
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1357440450878338685}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 22100000, guid: 183815035b9d60046b0f52d34d86c729, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!4 &1845710902757240007 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
m_PrefabInstance: {fileID: 2168466951281855276}
m_PrefabAsset: {fileID: 0}
--- !u!4 &2999520067601397981 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4014852071514518513, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
m_PrefabInstance: {fileID: 2168466951281855276}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &7470091411660165812
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 2999520067601397981}
m_Modifications:
- target: {fileID: 2330599188404940625, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_Controller
value:
objectReference: {fileID: 22100000, guid: c133fb7b08e27fe4e99524ec2cf06bf0,
type: 2}
- target: {fileID: 4160420743197823084, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_Name
value: P_R00001_01
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalRotation.x
value: 0.70710677
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalRotation.y
value: -0.00000011920929
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalRotation.z
value: -0.000000029802322
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0dbc127b6f1e5449aa344142a73e5a02, type: 3}
--- !u!4 &506792334716588255 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
m_PrefabInstance: {fileID: 7470091411660165812}
m_PrefabAsset: {fileID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 13e94daf440c34846853c971361bbfb9
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@ -0,0 +1,19 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!221 &22100000
AnimatorOverrideController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ov_battery_300002
m_Controller: {fileID: 9100000, guid: 80082eaa256477a4ea5382fad277451e, type: 2}
m_Clips:
- m_OriginalClip: {fileID: 1827226128182048838, guid: e66d6496654db14448496431ebd3c421,
type: 3}
m_OverrideClip: {fileID: 1827226128182048838, guid: e66d6496654db14448496431ebd3c421,
type: 3}
- m_OriginalClip: {fileID: 1827226128182048838, guid: 8a65b08053961ea419d61ab9d53e3d28,
type: 3}
m_OverrideClip: {fileID: 1827226128182048838, guid: 8a65b08053961ea419d61ab9d53e3d28,
type: 3}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5e70721d9fe1f594a8653d3c62277362
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 22100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,31 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!221 &22100000
AnimatorOverrideController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ov_vehicle_300002
m_Controller: {fileID: 9100000, guid: 3fdd688456c4d71428ef4a4e4f18405f, type: 2}
m_Clips:
- m_OriginalClip: {fileID: 1827226128182048838, guid: d070090219ff8ab4587f1ee3ab09446f,
type: 3}
m_OverrideClip: {fileID: 1827226128182048838, guid: d070090219ff8ab4587f1ee3ab09446f,
type: 3}
- m_OriginalClip: {fileID: 1827226128182048838, guid: 7bec30f1ab7fbc540adab3a677402184,
type: 3}
m_OverrideClip: {fileID: 1827226128182048838, guid: 7bec30f1ab7fbc540adab3a677402184,
type: 3}
- m_OriginalClip: {fileID: 1827226128182048838, guid: d988823f329c84e409e332748a6a8cf7,
type: 3}
m_OverrideClip: {fileID: 1827226128182048838, guid: d988823f329c84e409e332748a6a8cf7,
type: 3}
- m_OriginalClip: {fileID: 1827226128182048838, guid: a0920fb56c678844ebfdb27482146449,
type: 3}
m_OverrideClip: {fileID: 1827226128182048838, guid: a0920fb56c678844ebfdb27482146449,
type: 3}
- m_OriginalClip: {fileID: 1827226128182048838, guid: 399e42acf9e75c64abd5a2737911758b,
type: 3}
m_OverrideClip: {fileID: 1827226128182048838, guid: 399e42acf9e75c64abd5a2737911758b,
type: 3}

View File

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

View File

@ -0,0 +1,229 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6770644500165233157
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7803087331950724001}
m_Layer: 0
m_Name: vehicle_300002
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7803087331950724001
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6770644500165233157}
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:
- {fileID: 1845710902757240007}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &2168466951281855276
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 7803087331950724001}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
propertyPath: m_Name
value: C00001
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects:
- targetCorrespondingSourceObject: {fileID: 4014852071514518513, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
insertIndex: -1
addedObject: {fileID: 506792334716588255}
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
insertIndex: -1
addedObject: {fileID: 5467798728424433906}
m_SourcePrefab: {fileID: 100100000, guid: e1039a07c012c43ab88dac7b7b9a6065, type: 3}
--- !u!1 &1357440450878338685 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
m_PrefabInstance: {fileID: 2168466951281855276}
m_PrefabAsset: {fileID: 0}
--- !u!95 &5467798728424433906
Animator:
serializedVersion: 5
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1357440450878338685}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 22100000, guid: e5be13bf7bf96b84e94422364deae51e, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!4 &1845710902757240007 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
m_PrefabInstance: {fileID: 2168466951281855276}
m_PrefabAsset: {fileID: 0}
--- !u!4 &2999520067601397981 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4014852071514518513, guid: e1039a07c012c43ab88dac7b7b9a6065,
type: 3}
m_PrefabInstance: {fileID: 2168466951281855276}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &7470091411660165812
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 2999520067601397981}
m_Modifications:
- target: {fileID: 2330599188404940625, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_Controller
value:
objectReference: {fileID: 22100000, guid: 5e70721d9fe1f594a8653d3c62277362,
type: 2}
- target: {fileID: 4160420743197823084, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_Name
value: P_R00001_01
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalRotation.x
value: 0.70710677
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalRotation.y
value: -0.00000011920929
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalRotation.z
value: -0.000000029802322
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0dbc127b6f1e5449aa344142a73e5a02, type: 3}
--- !u!4 &506792334716588255 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6963519945369911915, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
m_PrefabInstance: {fileID: 7470091411660165812}
m_PrefabAsset: {fileID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: bc388db5566b3934bae2a16b24944b1d
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -124,7 +124,7 @@ Animator:
m_GameObject: {fileID: 1357440450878338685}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: f854e9a9efcf8b140838bbb2f2c4ce6d, type: 2}
m_Controller: {fileID: 22100000, guid: e5be13bf7bf96b84e94422364deae51e, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
@ -155,6 +155,12 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 2999520067601397981}
m_Modifications:
- target: {fileID: 2330599188404940625, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_Controller
value:
objectReference: {fileID: 22100000, guid: 5e70721d9fe1f594a8653d3c62277362,
type: 2}
- target: {fileID: 4160420743197823084, guid: 0dbc127b6f1e5449aa344142a73e5a02,
type: 3}
propertyPath: m_Name

View File

@ -28,6 +28,8 @@ namespace Framework
public const string CHARACTER_ERROR = "Assets/Art/Character/Prefabs/Players/P_Error.prefab";
public const string DATA_FORMAT_PATH = "Assets/Config/Data/{0}.json";
public const string VEHICLE_OUTPUT_PATH = "Assets/Art/AutoGen/Vehicle/{0}";
public const string AI_ASSET_FORMAT_PATH = "Assets/Config/AI/{0}.asset";

View File

@ -29,10 +29,10 @@ namespace Gameplay.Vehicle
public async UniTask Create()
{
var sampleObj = await AssetManager.Instance.LoadAssetAsync<GameObject>(configData.PrefabPath);
var sampleObj = await AssetManager.Instance.LoadAssetAsync<GameObject>(configData.prefabPath);
if (sampleObj == null)
{
DebugUtil.LogError("加载vehicle失败: {0}", configData.PrefabPath);
DebugUtil.LogError("加载vehicle失败: {0}", configData.prefabPath);
return;
}
// 父节点已销毁

View File

@ -44,17 +44,18 @@ namespace Gameplay.Vehicle.Data
public int sitCount;
public string PrefabPath;
public string prefabPath;
public int tireMarkId;
public int skillId;
public void Init(DataVehicle rawConfig,
int level, int skillLevel)
{
configId = rawConfig.ID;
PrefabPath = rawConfig.PrefabPath;
var savePath = string.Format(Constants.VEHICLE_OUTPUT_PATH, configId);
prefabPath = $"{savePath}/vehicle_{configId}.prefab";
this.level = level;

View File

@ -12,7 +12,7 @@ namespace CharacterBuilder
public class CharacterBuilderWindow : EditorWindow
{
[MenuItem("Tools/角色构建器")]
[MenuItem("Tools/构建器/角色构建器")]
public static void ShowWindow()
{
var window = GetWindow<CharacterBuilderWindow>();

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a0f6af3b5f574e7bb0b7046811db021c
timeCreated: 1704945074

View File

@ -0,0 +1,288 @@
using System.Collections.Generic;
using System.IO;
using cfg.VehicleCfg;
using Framework;
using UnityEditor;
using UnityEditor.AddressableAssets;
using UnityEditor.Animations;
using UnityEngine;
namespace VehicleBuilder
{
/// <summary>
/// 所有动作都可以没有
/// body使用的animator Assets/Art/Animations/animator/Vehicle/animator_vehicle.controller
/// body需要的动作 Assets/Art/Animations/Vehicle/C00001/ani_C00001_D_dead.fbx
/// dead
/// idle
/// move
/// restart
/// stop
/// skill
/// battery使用的animator Assets/Art/Animations/animator/Battery/animator_battery.controller
/// battery需要的动作 Assets/Art/Animations/Battery/R00001/ani_R00001_attack01.fbx
/// attack01
/// idle
/// skill
/// </summary>
public class VehicleBuildData
{
public DataVehicle vehicleConfig;
public bool isChecked;
public string bodyName;
public string batteryName;
public string errorInfo;
private string _prefabPath;
private string[] _bodyAniNames = new string[]
{
"dead",
"idle",
"move",
"restart",
"stop",
// "skill",
};
private string[] _batteryAniNames = new string[]
{
"attack01",
"idle",
// "skill",
};
public void Init()
{
var prefabPath = vehicleConfig.PrefabPath;
var prefab = AssetDatabase.LoadAssetAtPath<GameObject>(prefabPath);
if (prefab == null)
{
errorInfo = $"载具预制体不存在:{prefabPath}";
return;
}
_prefabPath = prefabPath;
var prefabName = prefab.name;
var splits = prefabName.Split('_');
if (splits.Length != 5)
{
errorInfo = $"prefab命名错误{prefabName}";
return;
}
bodyName = splits[1];
batteryName = splits[3];
// 检查所有bodyanims
for (var i = 0; i < _bodyAniNames.Length; ++i)
{
var bodyAnimName = _bodyAniNames[i];
var combinePath = $"Assets/Art/Animations/Vehicle/{bodyName}/ani_{bodyName}_D_{bodyAnimName}.fbx";
var loadAnim = AssetDatabase.LoadAssetAtPath<AnimationClip>(combinePath);
if (loadAnim == null)
{
errorInfo = $"不存在需求动作: {combinePath}";
return;
}
}
// 检查所有batteryanims
for (var i = 0; i < _batteryAniNames.Length; ++i)
{
var batteryAnimName = _batteryAniNames[i];
var combinePath = $"Assets/Art/Animations/Battery/{batteryName}/ani_{batteryName}_{batteryAnimName}.fbx";
var loadAnim = AssetDatabase.LoadAssetAtPath<AnimationClip>(combinePath);
if (loadAnim == null)
{
errorInfo = $"不存在需求动作: {combinePath}";
return;
}
}
}
public void DoBuild()
{
var savePath = string.Format(Constants.VEHICLE_OUTPUT_PATH, vehicleConfig.ID);
var realPath = savePath.Replace("Assets", Application.dataPath);
if (!Directory.Exists(realPath))
{
Directory.CreateDirectory(realPath);
}
var loadPrefab = AssetDatabase.LoadAssetAtPath<GameObject>(_prefabPath);
_HandlePrefab(loadPrefab, savePath);
var savePrefabPath = $"{savePath}/vehicle_{vehicleConfig.ID}.prefab";
PrefabUtility.SaveAsPrefabAsset(loadPrefab, savePrefabPath);
_AddToAddressables(savePrefabPath);
Debug.Log($"生成载具预制体:{savePrefabPath}");
}
private void _AddToAddressables(string assetPath)
{
// 获取 AddressableAssetSettings
var settings = AddressableAssetSettingsDefaultObject.Settings;
// 获取或创建一个资源组
var group = settings.FindGroup("SplitCharacter");
if (group == null)
{
Debug.LogError("找不到资源组:SplitCharacter");
return;
}
// 创建或移动条目
var guid = AssetDatabase.AssetPathToGUID(assetPath);
settings.CreateOrMoveEntry(guid, group);
}
private void _HandlePrefab(GameObject prefab, string savePath)
{
var allTrans = new List<Transform>();
_DeepSearchTrans(prefab.transform, allTrans);
var findBody = _SearchByName(allTrans, bodyName);
if (findBody == null)
{
Debug.LogError($"找不到body{bodyName}");
return;
}
var findBattery = _SearchByName(allTrans, batteryName);
if (findBattery == null)
{
Debug.LogError($"找不到battery{batteryName}");
return;
}
// 处理body
_HandleBody(savePath, findBody);
// 处理battery
_HandleBattery(savePath, findBattery);
EditorUtility.SetDirty(prefab);
AssetDatabase.SaveAssets();
}
private void _HandleBattery(string savePath,
Transform findBattery)
{
var srcController = AssetDatabase.LoadAssetAtPath<AnimatorController>("Assets/Art/Animations/animator/Battery/animator_battery.controller");
if (srcController == null)
{
Debug.LogError($"找不到animator_battery.controller");
return;
}
// 创建一个overrideController
var overrideController = new AnimatorOverrideController();
overrideController.runtimeAnimatorController = srcController;
// 设置动作
var kvList = new List<KeyValuePair<AnimationClip, AnimationClip>>();
var oldClips = overrideController.animationClips;
for (int i = 0; i < oldClips.Length; i++)
{
var oldClip = oldClips[i];
var oldClipName = oldClip.name;
// ani_R00001_attack01
var splits = oldClipName.Split('_');
var finalName = splits[^1];
var newClipPath = $"Assets/Art/Animations/Battery/{batteryName}/ani_{batteryName}_{finalName}.fbx";
var newClip = AssetDatabase.LoadAssetAtPath<AnimationClip>(newClipPath);
if (newClip == null)
{
Debug.LogError($"找不到动作:{newClipPath}");
continue;
}
kvList.Add(new KeyValuePair<AnimationClip, AnimationClip>(oldClip, newClip));
}
overrideController.ApplyOverrides(kvList);
// 保存controller
var saveControllerPath = $"{savePath}/ov_battery_{vehicleConfig.ID}.controller";
AssetDatabase.CreateAsset(overrideController, saveControllerPath);
AssetDatabase.Refresh();
overrideController = AssetDatabase.LoadAssetAtPath<AnimatorOverrideController>(saveControllerPath);
// 设置battery的animator
var batteryAnimator = findBattery.GetComponent<Animator>();
if (batteryAnimator == null)
{
batteryAnimator = findBattery.gameObject.AddComponent<Animator>();
}
batteryAnimator.runtimeAnimatorController = overrideController;
batteryAnimator.cullingMode = AnimatorCullingMode.AlwaysAnimate;
}
private void _HandleBody(string savePath,
Transform findBody)
{
var srcController = AssetDatabase.LoadAssetAtPath<AnimatorController>("Assets/Art/Animations/animator/Vehicle/animator_vehicle.controller");
if (srcController == null)
{
Debug.LogError($"找不到animator_vehicle.controller");
return;
}
// 创建一个overrideController
var overrideController = new AnimatorOverrideController();
overrideController.runtimeAnimatorController = srcController;
// 设置动作
var kvList = new List<KeyValuePair<AnimationClip, AnimationClip>>();
var oldClips = overrideController.animationClips;
for (int i = 0; i < oldClips.Length; i++)
{
var oldClip = oldClips[i];
var oldClipName = oldClip.name;
// ani_C00001_D_idle
var splits = oldClipName.Split('_');
var finalName = splits[^1];
var newClipPath = $"Assets/Art/Animations/Vehicle/{bodyName}/ani_{bodyName}_D_{finalName}.fbx";
var newClip = AssetDatabase.LoadAssetAtPath<AnimationClip>(newClipPath);
if (newClip == null)
{
Debug.LogError($"找不到动作:{newClipPath}");
continue;
}
kvList.Add(new KeyValuePair<AnimationClip, AnimationClip>(oldClip, newClip));
}
overrideController.ApplyOverrides(kvList);
// 保存controller
var saveControllerPath = $"{savePath}/ov_vehicle_{vehicleConfig.ID}.controller";
AssetDatabase.CreateAsset(overrideController, saveControllerPath);
AssetDatabase.Refresh();
overrideController = AssetDatabase.LoadAssetAtPath<AnimatorOverrideController>(saveControllerPath);
// 设置body的animator
var bodyAnimator = findBody.GetComponent<Animator>();
if (bodyAnimator == null)
{
bodyAnimator = findBody.gameObject.AddComponent<Animator>();
}
bodyAnimator.runtimeAnimatorController = overrideController;
bodyAnimator.cullingMode = AnimatorCullingMode.AlwaysAnimate;
}
private static Transform _SearchByName(List<Transform> searchList, string name)
{
for (int i = 0; i < searchList.Count; i++)
{
var trans = searchList[i];
if (trans.name == name)
{
return trans;
}
}
return null;
}
private static void _DeepSearchTrans(Transform searchTrans, List<Transform> result)
{
result.Add(searchTrans);
for (int i = 0; i < searchTrans.childCount; i++)
{
var child = searchTrans.GetChild(i);
_DeepSearchTrans(child, result);
}
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 804e49d69e5a447d86e9d7a03f3adbdf
timeCreated: 1704945280

View File

@ -0,0 +1,160 @@
using System;
using System.Collections.Generic;
using DG.DemiEditor;
using Framework;
using UnityEditor;
using UnityEngine;
namespace VehicleBuilder
{
public class VehicleBuildWindow : EditorWindow
{
[MenuItem("Tools/构建器/载具构建器")]
public static void ShowWindow()
{
var window = GetWindow<VehicleBuildWindow>();
window.titleContent = new GUIContent("载具构建器");
window.Show();
}
private List<VehicleBuildData> _buildData;
private GUIStyle _styleNormal;
private GUIStyle _styleError;
private Vector2 _scrollPos1;
private void OnGUI()
{
if (_buildData == null)
{
_InitData();
}
if (_buildData == null)
{
EditorGUILayout.HelpBox("载具配置表为空", MessageType.Error);
return;
}
GUILayout.BeginHorizontal();
GUILayout.Label($"共有 {_buildData.Count} 个载具");
if (GUILayout.Button("刷新", GUILayout.Width(100)))
{
_buildData = null;
EditorTableManager.instance.ForceReload();
GUILayout.EndHorizontal();
return;
}
GUILayout.EndHorizontal();
_ShowVehicleInfos();
if (GUILayout.Button("开始构建", GUILayout.Height(60)))
{
_Build();
}
}
private void _ShowVehicleInfos()
{
var maxHeight = 200;
_scrollPos1 = EditorGUILayout.BeginScrollView(_scrollPos1, GUILayout.Height(maxHeight));
GUILayout.BeginVertical();
for (int i = 0; i < _buildData.Count; i++)
{
var buildData = _buildData[i];
GUILayout.BeginHorizontal();
buildData.isChecked = GUILayout.Toggle(buildData.isChecked, "", GUILayout.Width(20));
var hasError = !string.IsNullOrEmpty(buildData.errorInfo);
GUILayout.Label("ID: " + buildData.vehicleConfig.ID, GUILayout.Width(100));
if (hasError)
{
GUILayout.Label("名称: " + buildData.vehicleConfig.Name, _styleError, GUILayout.Width(100));
}
else
{
GUILayout.Label("名称: " + buildData.vehicleConfig.Name, GUILayout.Width(100));
}
GUILayout.Label("车体名字: " + buildData.bodyName, GUILayout.Width(120));
GUILayout.Label("炮台名字: " + buildData.batteryName, GUILayout.Width(120));
GUILayout.EndHorizontal();
if (buildData.isChecked && hasError)
{
GUILayout.BeginHorizontal();
GUILayout.Space(100);
GUILayout.Label(buildData.errorInfo, _styleError);
GUILayout.EndHorizontal();
}
}
GUILayout.EndVertical();
EditorGUILayout.EndScrollView();
GUILayout.BeginHorizontal();
if (GUILayout.Button("全选"))
{
for (int i = 0; i < _buildData.Count; i++)
{
var buildData = _buildData[i];
buildData.isChecked = true;
}
}
if (GUILayout.Button("全不选"))
{
for (int i = 0; i < _buildData.Count; i++)
{
var buildData = _buildData[i];
buildData.isChecked = false;
}
}
GUILayout.EndHorizontal();
}
private void _Build()
{
for (int i = 0; i < _buildData.Count; i++)
{
var buildData = _buildData[i];
if (buildData.isChecked)
{
buildData.DoBuild();
}
}
AssetDatabase.Refresh();
}
private void _InitData()
{
_buildData = new List<VehicleBuildData>();
var configList = EditorTableManager.instance.tables.VehicleConfig.DataList;
for (int i = 0; i < configList.Count; i++)
{
var config = configList[i];
var data = new VehicleBuildData();
data.vehicleConfig = config;
data.Init();
_buildData.Add(data);
}
_styleNormal = GUI.skin.label.Clone();
_styleNormal.normal.textColor = Color.white;
_styleNormal.focused.textColor = Color.white;
_styleNormal.hover.textColor = Color.white;
_styleNormal.active.textColor = Color.white;
_styleError = GUI.skin.label.Clone();
_styleError.normal.textColor = Color.red;
_styleError.focused.textColor = Color.red;
_styleError.hover.textColor = Color.red;
_styleError.active.textColor = Color.red;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 3dd3422d834443b8a1e80a5b7df342a8
timeCreated: 1704945090