Starter
This commit is contained in:
8
Assets/_Content/Materials.meta
Normal file
8
Assets/_Content/Materials.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b37e3c59d0d19b4fbc941e4dc21690d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
35
Assets/_Content/Materials/M_world.mat
Normal file
35
Assets/_Content/Materials/M_world.mat
Normal file
@@ -0,0 +1,35 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: M_world
|
||||
m_Shader: {fileID: 4800000, guid: 0b6b65e03c0cbc6458620f24738fd6c6, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs: []
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _Metallic: 0
|
||||
- _Smoothness: 0.3
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 0.10499997, g: 0.16999996, b: 0.21999997, a: 1}
|
||||
- _DarkColor: {r: 0.035, g: 0.054999977, b: 0.06999998, a: 1}
|
||||
- _LineColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
8
Assets/_Content/Materials/M_world.mat.meta
Normal file
8
Assets/_Content/Materials/M_world.mat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e28c686224834094b93cace287efa19e
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/_Content/Models/Characters.meta
Normal file
8
Assets/_Content/Models/Characters.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eddd3e268acd9ac4ea4ce449f2ed789f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/_Content/Models/Characters/Bot.meta
Normal file
8
Assets/_Content/Models/Characters/Bot.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9ad605e312d569e4e961633201ed96a8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/_Content/Models/Characters/Bot/Animations.meta
Normal file
8
Assets/_Content/Models/Characters/Bot/Animations.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51eb810ee76881649a411263431274ed
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
803
Assets/_Content/Models/Characters/Bot/Animations/bot.controller
Normal file
803
Assets/_Content/Models/Characters/Bot/Animations/bot.controller
Normal file
@@ -0,0 +1,803 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1101 &-8989119663961789257
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: IsRunning
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: -7327850354957798113}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1102 &-7327850354957798113
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: run
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: 1944938938964499278}
|
||||
- {fileID: 1106120401895831202}
|
||||
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: 7400000, guid: c7a78f46c90bf344999d8300c1b01a62, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &-5485362655117760516
|
||||
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: 2666831125099755100}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.2080859
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.48148537
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1102 &-5389070569500098327
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: jump
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: -5485362655117760516}
|
||||
- {fileID: -5300964824015945333}
|
||||
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: 7400000, guid: d72a3f1d084ea4f489614d113d06ea3f, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &-5300964824015945333
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: IsGrounded
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 5056364956027464035}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.85
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1102 &-2727789107110581485
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: die
|
||||
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: 7400000, guid: b577ab0f8f855b64bb43b96cd2804df1, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &-2180982934805110915
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 2
|
||||
m_ConditionEvent: IsStunned
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 5056364956027464035}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.875
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1102 &-1360090912894744725
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: win
|
||||
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: 7400000, guid: bb7fd47adbab5034286a4ea821ea313f, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &-1195506543672170107
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 2
|
||||
m_ConditionEvent: IsGrounded
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 2666831125099755100}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1107 &-916989623718650476
|
||||
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: 5056364956027464035}
|
||||
m_Position: {x: 320, y: 110, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 2666831125099755100}
|
||||
m_Position: {x: 450, y: 240, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -2727789107110581485}
|
||||
m_Position: {x: -150, y: -240, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -5389070569500098327}
|
||||
m_Position: {x: 450, y: 30, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 7954013121776325208}
|
||||
m_Position: {x: 230, y: -110, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -1360090912894744725}
|
||||
m_Position: {x: 170, y: -180, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 5948607311367280753}
|
||||
m_Position: {x: 70, y: -240, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -7327850354957798113}
|
||||
m_Position: {x: 580, y: 110, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 5959444898284141654}
|
||||
m_Position: {x: 370, y: -50, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions:
|
||||
- {fileID: 4100953385178679390}
|
||||
- {fileID: 3834895311111029761}
|
||||
- {fileID: 570737505238817413}
|
||||
- {fileID: 5879428480787235996}
|
||||
- {fileID: 200226189913076415}
|
||||
- {fileID: 9085738078956175888}
|
||||
m_EntryTransitions: []
|
||||
m_StateMachineTransitions: {}
|
||||
m_StateMachineBehaviours: []
|
||||
m_AnyStatePosition: {x: -30, y: 40, z: 0}
|
||||
m_EntryPosition: {x: -30, y: 110, z: 0}
|
||||
m_ExitPosition: {x: -30, y: 180, z: 0}
|
||||
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
|
||||
m_DefaultState: {fileID: 5056364956027464035}
|
||||
--- !u!91 &9100000
|
||||
AnimatorController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: bot
|
||||
serializedVersion: 5
|
||||
m_AnimatorParameters:
|
||||
- m_Name: Forward
|
||||
m_Type: 1
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
- m_Name: Right
|
||||
m_Type: 1
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
- m_Name: IsGrounded
|
||||
m_Type: 4
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 1
|
||||
m_Controller: {fileID: 9100000}
|
||||
- m_Name: IsRunning
|
||||
m_Type: 4
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
- m_Name: IsStunned
|
||||
m_Type: 4
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
- m_Name: Jump
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
- m_Name: Dash
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
- m_Name: Die
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
- m_Name: Win
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
- m_Name: Lose
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
m_StateMachine: {fileID: -916989623718650476}
|
||||
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 &200226189913076415
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: Lose
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 5948607311367280753}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 0
|
||||
--- !u!1101 &570737505238817413
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: IsStunned
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 7954013121776325208}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 0
|
||||
--- !u!1101 &879915511071350946
|
||||
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: 5056364956027464035}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.70000005
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1106120401895831202
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 2
|
||||
m_ConditionEvent: IsGrounded
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 2666831125099755100}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.5
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &1944938938964499278
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 2
|
||||
m_ConditionEvent: IsRunning
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 5056364956027464035}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.5
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &2660829088358260870
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: IsGrounded
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 5056364956027464035}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.625
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1102 &2666831125099755100
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: fall
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: 2660829088358260870}
|
||||
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: 7400000, guid: e8895815abaf781499005dca96578623, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &3834895311111029761
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: Dash
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 5959444898284141654}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 0
|
||||
--- !u!1101 &4100953385178679390
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: Jump
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: -5389070569500098327}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 0
|
||||
--- !u!1102 &5056364956027464035
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: locomotion
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: -8989119663961789257}
|
||||
- {fileID: -1195506543672170107}
|
||||
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: 7664462660922354015}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &5879428480787235996
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: Win
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: -1360090912894744725}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 0
|
||||
--- !u!1102 &5948607311367280753
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: lose
|
||||
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: 7400000, guid: 93046a1d1b9ff71488dd996559c3a043, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1102 &5959444898284141654
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: dash
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: 879915511071350946}
|
||||
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: 7400000, guid: 9366d7b277567e94da3055474d57e36c, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!206 &7664462660922354015
|
||||
BlendTree:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Blend Tree
|
||||
m_Childs:
|
||||
- serializedVersion: 2
|
||||
m_Motion: {fileID: 7400000, guid: 8c806d9fbb21847439297a4495ec07ea, type: 2}
|
||||
m_Threshold: 0
|
||||
m_Position: {x: 0, y: 0}
|
||||
m_TimeScale: 1
|
||||
m_CycleOffset: 0
|
||||
m_DirectBlendParameter: Blend
|
||||
m_Mirror: 0
|
||||
- serializedVersion: 2
|
||||
m_Motion: {fileID: 7400000, guid: bba630295409b484b97df6d931d247f4, type: 2}
|
||||
m_Threshold: 0.25
|
||||
m_Position: {x: 0, y: 1}
|
||||
m_TimeScale: 1.2
|
||||
m_CycleOffset: 0
|
||||
m_DirectBlendParameter: Blend
|
||||
m_Mirror: 0
|
||||
- serializedVersion: 2
|
||||
m_Motion: {fileID: 7400000, guid: 30b2445b4bc4d2f48ad20b2bbbe3e4c0, type: 2}
|
||||
m_Threshold: 0.5
|
||||
m_Position: {x: 1, y: 0}
|
||||
m_TimeScale: 1.2
|
||||
m_CycleOffset: 0
|
||||
m_DirectBlendParameter: Forward
|
||||
m_Mirror: 0
|
||||
- serializedVersion: 2
|
||||
m_Motion: {fileID: 7400000, guid: bba630295409b484b97df6d931d247f4, type: 2}
|
||||
m_Threshold: 0.75
|
||||
m_Position: {x: 0, y: -1}
|
||||
m_TimeScale: -1.2
|
||||
m_CycleOffset: 0
|
||||
m_DirectBlendParameter: Forward
|
||||
m_Mirror: 0
|
||||
- serializedVersion: 2
|
||||
m_Motion: {fileID: 7400000, guid: 30b2445b4bc4d2f48ad20b2bbbe3e4c0, type: 2}
|
||||
m_Threshold: 1
|
||||
m_Position: {x: -1, y: 0}
|
||||
m_TimeScale: -1.2
|
||||
m_CycleOffset: 0
|
||||
m_DirectBlendParameter: Forward
|
||||
m_Mirror: 0
|
||||
m_BlendParameter: Right
|
||||
m_BlendParameterY: Forward
|
||||
m_MinThreshold: 0
|
||||
m_MaxThreshold: 1
|
||||
m_UseAutomaticThresholds: 1
|
||||
m_NormalizedBlendValues: 0
|
||||
m_BlendType: 2
|
||||
--- !u!1102 &7954013121776325208
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: stunned
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: -2180982934805110915}
|
||||
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: 7400000, guid: 87bf56fb2b86f0943b0e3fb015eb4833, type: 2}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &9085738078956175888
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: Die
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: -2727789107110581485}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.75
|
||||
m_HasExitTime: 0
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ac50faef3099274cbd0a47ed527697c
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 9100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
33085
Assets/_Content/Models/Characters/Bot/Animations/dash.anim
Normal file
33085
Assets/_Content/Models/Characters/Bot/Animations/dash.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9366d7b277567e94da3055474d57e36c
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
14805
Assets/_Content/Models/Characters/Bot/Animations/die.anim
Normal file
14805
Assets/_Content/Models/Characters/Bot/Animations/die.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b577ab0f8f855b64bb43b96cd2804df1
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
14805
Assets/_Content/Models/Characters/Bot/Animations/eliminate.anim
Normal file
14805
Assets/_Content/Models/Characters/Bot/Animations/eliminate.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f954ce44b5c4b024f9ff4e347fbc5376
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8757
Assets/_Content/Models/Characters/Bot/Animations/fall.anim
Normal file
8757
Assets/_Content/Models/Characters/Bot/Animations/fall.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e8895815abaf781499005dca96578623
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8001
Assets/_Content/Models/Characters/Bot/Animations/idle.anim
Normal file
8001
Assets/_Content/Models/Characters/Bot/Animations/idle.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c806d9fbb21847439297a4495ec07ea
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
15525
Assets/_Content/Models/Characters/Bot/Animations/jump.anim
Normal file
15525
Assets/_Content/Models/Characters/Bot/Animations/jump.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d72a3f1d084ea4f489614d113d06ea3f
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
22949
Assets/_Content/Models/Characters/Bot/Animations/jumpRoll.anim
Normal file
22949
Assets/_Content/Models/Characters/Bot/Animations/jumpRoll.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b27fd29dea1321a4b868268a3ebabb5a
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8973
Assets/_Content/Models/Characters/Bot/Animations/lose.anim
Normal file
8973
Assets/_Content/Models/Characters/Bot/Animations/lose.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93046a1d1b9ff71488dd996559c3a043
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
13797
Assets/_Content/Models/Characters/Bot/Animations/run.anim
Normal file
13797
Assets/_Content/Models/Characters/Bot/Animations/run.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c7a78f46c90bf344999d8300c1b01a62
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
10485
Assets/_Content/Models/Characters/Bot/Animations/runWallLeft.anim
Normal file
10485
Assets/_Content/Models/Characters/Bot/Animations/runWallLeft.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 37f55d821e29a3d44803b8640000e23e
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
10629
Assets/_Content/Models/Characters/Bot/Animations/runWallRight.anim
Normal file
10629
Assets/_Content/Models/Characters/Bot/Animations/runWallRight.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a6241ab5cb021642aac569da953097a
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
11997
Assets/_Content/Models/Characters/Bot/Animations/stun.anim
Normal file
11997
Assets/_Content/Models/Characters/Bot/Animations/stun.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b0ac4447f43291d4dbc646ccaf0d13f4
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
11997
Assets/_Content/Models/Characters/Bot/Animations/stunned.anim
Normal file
11997
Assets/_Content/Models/Characters/Bot/Animations/stunned.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 87bf56fb2b86f0943b0e3fb015eb4833
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
15921
Assets/_Content/Models/Characters/Bot/Animations/walk.anim
Normal file
15921
Assets/_Content/Models/Characters/Bot/Animations/walk.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cf6602319a775b84f875693c32e10908
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
15921
Assets/_Content/Models/Characters/Bot/Animations/walkForward.anim
Normal file
15921
Assets/_Content/Models/Characters/Bot/Animations/walkForward.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bba630295409b484b97df6d931d247f4
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
4767
Assets/_Content/Models/Characters/Bot/Animations/walkRight.anim
Normal file
4767
Assets/_Content/Models/Characters/Bot/Animations/walkRight.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 30b2445b4bc4d2f48ad20b2bbbe3e4c0
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
17001
Assets/_Content/Models/Characters/Bot/Animations/win.anim
Normal file
17001
Assets/_Content/Models/Characters/Bot/Animations/win.anim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bb7fd47adbab5034286a4ea821ea313f
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 7400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
89
Assets/_Content/Models/Characters/Bot/Bot.prefab
Normal file
89
Assets/_Content/Models/Characters/Bot/Bot.prefab
Normal file
@@ -0,0 +1,89 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1001 &7405539825535706880
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: -8679921383154817045, guid: 2b8eab5f9e0c5c649a40b323ec6d99db, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: 2b8eab5f9e0c5c649a40b323ec6d99db, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: 2b8eab5f9e0c5c649a40b323ec6d99db, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: 2b8eab5f9e0c5c649a40b323ec6d99db, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: 2b8eab5f9e0c5c649a40b323ec6d99db, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: 2b8eab5f9e0c5c649a40b323ec6d99db, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: 2b8eab5f9e0c5c649a40b323ec6d99db, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: 2b8eab5f9e0c5c649a40b323ec6d99db, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: 2b8eab5f9e0c5c649a40b323ec6d99db, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: 2b8eab5f9e0c5c649a40b323ec6d99db, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 919132149155446097, guid: 2b8eab5f9e0c5c649a40b323ec6d99db, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Bot
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents:
|
||||
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 2b8eab5f9e0c5c649a40b323ec6d99db, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 6268899434028451206}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 2b8eab5f9e0c5c649a40b323ec6d99db, type: 3}
|
||||
--- !u!1 &7639418806218873425 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 2b8eab5f9e0c5c649a40b323ec6d99db, type: 3}
|
||||
m_PrefabInstance: {fileID: 7405539825535706880}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!95 &6268899434028451206
|
||||
Animator:
|
||||
serializedVersion: 7
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7639418806218873425}
|
||||
m_Enabled: 1
|
||||
m_Avatar: {fileID: 0}
|
||||
m_Controller: {fileID: 9100000, guid: 8ac50faef3099274cbd0a47ed527697c, type: 2}
|
||||
m_CullingMode: 0
|
||||
m_UpdateMode: 0
|
||||
m_ApplyRootMotion: 0
|
||||
m_LinearVelocityBlending: 0
|
||||
m_StabilizeFeet: 0
|
||||
m_AnimatePhysics: 0
|
||||
m_WarningMessage:
|
||||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorStateOnDisable: 0
|
||||
m_WriteDefaultValuesOnDisable: 0
|
||||
7
Assets/_Content/Models/Characters/Bot/Bot.prefab.meta
Normal file
7
Assets/_Content/Models/Characters/Bot/Bot.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dce89e082ea7b9c48ab0fe0f0d38f147
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/_Content/Models/Characters/Bot/Materials.meta
Normal file
8
Assets/_Content/Models/Characters/Bot/Materials.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c12ef71f51dc3ae4f8ee158265559ceb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,139 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: mat_bodywork_A
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses:
|
||||
- MOTIONVECTORS
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AddPrecomputedVelocity: 0
|
||||
- _AlphaClip: 0
|
||||
- _AlphaToMask: 0
|
||||
- _Blend: 0
|
||||
- _BlendModePreserveSpecular: 1
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _DstBlendAlpha: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0.72
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0.77
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _UVSec: 0
|
||||
- _WorkflowMode: 1
|
||||
- _XRMotionVectorsPass: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 0.78391165, b: 0, a: 1}
|
||||
- _Color: {r: 1, g: 0.78391165, b: 0, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
--- !u!114 &2404241721268897275
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
|
||||
version: 10
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b44589781f5e0e04c8ca5f190db42ada
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,139 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-3685564237119114527
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: mat_bodywork_B
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses:
|
||||
- MOTIONVECTORS
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AddPrecomputedVelocity: 0
|
||||
- _AlphaClip: 0
|
||||
- _AlphaToMask: 0
|
||||
- _Blend: 0
|
||||
- _BlendModePreserveSpecular: 1
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _DstBlendAlpha: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0.61
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _UVSec: 0
|
||||
- _WorkflowMode: 1
|
||||
- _XRMotionVectorsPass: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 0.27999288, g: 0.31801984, b: 0.41509432, a: 1}
|
||||
- _Color: {r: 0.27999285, g: 0.3180198, b: 0.4150943, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c8bf99957763684b9f83d1f8b070549
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
140
Assets/_Content/Models/Characters/Bot/Materials/mat_eye.mat
Normal file
140
Assets/_Content/Models/Characters/Bot/Materials/mat_eye.mat
Normal file
@@ -0,0 +1,140 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-7645745693084663736
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: mat_eye
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords:
|
||||
- _EMISSION
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 2
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses:
|
||||
- MOTIONVECTORS
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AddPrecomputedVelocity: 0
|
||||
- _AlphaClip: 0
|
||||
- _AlphaToMask: 0
|
||||
- _Blend: 0
|
||||
- _BlendModePreserveSpecular: 1
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _DstBlendAlpha: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _UVSec: 0
|
||||
- _WorkflowMode: 1
|
||||
- _XRMotionVectorsPass: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 0.699921, g: 0.86611784, b: 0.9808553, a: 1}
|
||||
- _Color: {r: 0.69992095, g: 0.86611784, b: 0.9808553, a: 1}
|
||||
- _EmissionColor: {r: 0.30197895, g: 3.0626981, b: 4.9245777, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27e2a9836de184e4b9ac07a0099ff283
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
139
Assets/_Content/Models/Characters/Bot/Materials/mat_head.mat
Normal file
139
Assets/_Content/Models/Characters/Bot/Materials/mat_head.mat
Normal file
@@ -0,0 +1,139 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: mat_head
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses:
|
||||
- MOTIONVECTORS
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AddPrecomputedVelocity: 0
|
||||
- _AlphaClip: 0
|
||||
- _AlphaToMask: 0
|
||||
- _Blend: 0
|
||||
- _BlendModePreserveSpecular: 1
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _DstBlendAlpha: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 1
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0.99
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _UVSec: 0
|
||||
- _WorkflowMode: 1
|
||||
- _XRMotionVectorsPass: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 0.100701235, g: 0.10727178, b: 0.13816991, a: 1}
|
||||
- _Color: {r: 0.10070119, g: 0.10727175, b: 0.13816988, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
--- !u!114 &7363598700272283861
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
|
||||
version: 10
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e08cab2b5d1fa9a47b210dfe659c9ed1
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/_Content/Models/Characters/Bot/Sources.meta
Normal file
8
Assets/_Content/Models/Characters/Bot/Sources.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2c8a73d4cc8febf4690b7f37c000e18e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/_Content/Models/Characters/Bot/Sources/bot.fbx
LFS
Normal file
BIN
Assets/_Content/Models/Characters/Bot/Sources/bot.fbx
LFS
Normal file
Binary file not shown.
130
Assets/_Content/Models/Characters/Bot/Sources/bot.fbx.meta
Normal file
130
Assets/_Content/Models/Characters/Bot/Sources/bot.fbx.meta
Normal file
@@ -0,0 +1,130 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b8eab5f9e0c5c649a40b323ec6d99db
|
||||
ModelImporter:
|
||||
serializedVersion: 24200
|
||||
internalIDToNameTable: []
|
||||
externalObjects:
|
||||
- first:
|
||||
type: UnityEngine:Material
|
||||
assembly: UnityEngine.CoreModule
|
||||
name: mat_bodywork_A
|
||||
second: {fileID: 2100000, guid: b44589781f5e0e04c8ca5f190db42ada, type: 2}
|
||||
- first:
|
||||
type: UnityEngine:Material
|
||||
assembly: UnityEngine.CoreModule
|
||||
name: mat_bodywork_B
|
||||
second: {fileID: 2100000, guid: 0c8bf99957763684b9f83d1f8b070549, type: 2}
|
||||
- first:
|
||||
type: UnityEngine:Material
|
||||
assembly: UnityEngine.CoreModule
|
||||
name: mat_eye
|
||||
second: {fileID: 2100000, guid: 27e2a9836de184e4b9ac07a0099ff283, type: 2}
|
||||
- first:
|
||||
type: UnityEngine:Material
|
||||
assembly: UnityEngine.CoreModule
|
||||
name: mat_head
|
||||
second: {fileID: 2100000, guid: e08cab2b5d1fa9a47b210dfe659c9ed1, type: 2}
|
||||
materials:
|
||||
materialImportMode: 2
|
||||
materialName: 0
|
||||
materialSearch: 1
|
||||
materialLocation: 1
|
||||
animations:
|
||||
legacyGenerateAnimations: 4
|
||||
bakeSimulation: 0
|
||||
resampleCurves: 1
|
||||
optimizeGameObjects: 0
|
||||
removeConstantScaleCurves: 0
|
||||
motionNodeName:
|
||||
animationImportErrors:
|
||||
animationImportWarnings:
|
||||
animationRetargetingWarnings:
|
||||
animationDoRetargetingWarnings: 0
|
||||
importAnimatedCustomProperties: 0
|
||||
importConstraints: 0
|
||||
animationCompression: 1
|
||||
animationRotationError: 0.5
|
||||
animationPositionError: 0.5
|
||||
animationScaleError: 0.5
|
||||
animationWrapMode: 0
|
||||
extraExposedTransformPaths: []
|
||||
extraUserProperties: []
|
||||
clipAnimations: []
|
||||
isReadable: 0
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 1
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
useSRGBMaterialColor: 1
|
||||
sortHierarchyByName: 1
|
||||
importPhysicalCameras: 1
|
||||
importVisibility: 1
|
||||
importBlendShapes: 1
|
||||
importCameras: 1
|
||||
importLights: 1
|
||||
nodeNameCollisionStrategy: 1
|
||||
fileIdsGeneration: 2
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
keepQuads: 0
|
||||
weldVertices: 1
|
||||
bakeAxisConversion: 0
|
||||
preserveHierarchy: 0
|
||||
skinWeightsMode: 0
|
||||
maxBonesPerVertex: 4
|
||||
minBoneWeight: 0.001
|
||||
optimizeBones: 1
|
||||
generateMeshLods: 0
|
||||
meshLodGenerationFlags: 0
|
||||
maximumMeshLod: -1
|
||||
meshOptimizationFlags: -1
|
||||
indexFormat: 0
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVMarginMethod: 1
|
||||
secondaryUVMinLightmapResolution: 40
|
||||
secondaryUVMinObjectScale: 1
|
||||
secondaryUVPackMargin: 4
|
||||
useFileScale: 1
|
||||
strictVertexDataChecks: 0
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 3
|
||||
normalCalculationMode: 4
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
referencedClips: []
|
||||
importAnimation: 0
|
||||
humanDescription:
|
||||
serializedVersion: 3
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: 0.5
|
||||
foreArmTwist: 0.5
|
||||
upperLegTwist: 0.5
|
||||
legTwist: 0.5
|
||||
armStretch: 0.05
|
||||
legStretch: 0.05
|
||||
feetSpacing: 0
|
||||
globalScale: 1
|
||||
rootMotionBoneName:
|
||||
hasTranslationDoF: 0
|
||||
hasExtraRoot: 0
|
||||
skeletonHasParents: 1
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
autoGenerateAvatarMappingIfUnspecified: 1
|
||||
animationType: 2
|
||||
humanoidOversampling: 1
|
||||
avatarSetup: 0
|
||||
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
|
||||
importBlendShapeDeformPercent: 1
|
||||
remapMaterialsIfMaterialImportModeIsNone: 0
|
||||
additionalBone: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/_Content/Models/Weapons.meta
Normal file
8
Assets/_Content/Models/Weapons.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3bdb5b020ad1bce4cae51fde6d71651f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -98,7 +98,7 @@ SphereCollider:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_IsTrigger: 1
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
@@ -126,7 +126,7 @@ Rigidbody:
|
||||
m_Bits: 0
|
||||
m_ImplicitCom: 1
|
||||
m_ImplicitTensor: 1
|
||||
m_UseGravity: 1
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 0
|
||||
8
Assets/_Content/Models/Weapons/Sources.meta
Normal file
8
Assets/_Content/Models/Weapons/Sources.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7bfc82c50a23f7d48a25b154acb44307
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -31,7 +31,7 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4595290834041894522}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &5286650573156461405
|
||||
--- !u!1 &5026817367868605555
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -39,88 +39,29 @@ GameObject:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2648838692056603215}
|
||||
- component: {fileID: 4433368355904579625}
|
||||
- component: {fileID: 7841523364635298371}
|
||||
- component: {fileID: 3421351127703031065}
|
||||
m_Layer: 0
|
||||
m_Name: Cube
|
||||
m_Name: Gun Direction
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2648838692056603215
|
||||
--- !u!4 &3421351127703031065
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5286650573156461405}
|
||||
m_GameObject: {fileID: 5026817367868605555}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.413, z: 0.46}
|
||||
m_LocalScale: {x: 0.57788104, y: 0.23092704, z: 0.3382222}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 8656262745496025766}
|
||||
m_Father: {fileID: 1336261255310037562}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &4433368355904579625
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5286650573156461405}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &7841523364635298371
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5286650573156461405}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_MaskInteraction: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1 &5701756709460610233
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -152,8 +93,8 @@ Transform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 8656262745496025766}
|
||||
- {fileID: 4595290834041894522}
|
||||
- {fileID: 1782388339736538777}
|
||||
- {fileID: 3421351127703031065}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!143 &4700255994880078248
|
||||
@@ -195,116 +136,44 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::PlayerMovero
|
||||
_settings:
|
||||
Speed: 10
|
||||
RunSpeed: 18
|
||||
DashDistance: 4
|
||||
DashDuration: 0.2
|
||||
DashCooldown: 1
|
||||
JumpHeight: 1.2
|
||||
Gravity: 20
|
||||
_references:
|
||||
Controller: {fileID: 4700255994880078248}
|
||||
Launcher: {fileID: 6426658406708130876}
|
||||
MoveAction: {fileID: -1680190386980627800, guid: 052faaac586de48259a63d0c4782560b, type: 3}
|
||||
InteractAction: {fileID: 1781555164194001046, guid: 052faaac586de48259a63d0c4782560b, type: 3}
|
||||
LookAction: {fileID: -5630151704836100654, guid: 052faaac586de48259a63d0c4782560b, type: 3}
|
||||
AttackAction: {fileID: 1120369429361536294, guid: 052faaac586de48259a63d0c4782560b, type: 3}
|
||||
InteractAction: {fileID: 1781555164194001046, guid: 052faaac586de48259a63d0c4782560b, type: 3}
|
||||
JumpAction: {fileID: -2099379676528639254, guid: 052faaac586de48259a63d0c4782560b, type: 3}
|
||||
SprintAction: {fileID: -7471211009204490832, guid: 052faaac586de48259a63d0c4782560b, type: 3}
|
||||
DashAction: {fileID: -4090225696740746782, guid: 052faaac586de48259a63d0c4782560b, type: 3}
|
||||
Launcher: {fileID: 6426658406708130876}
|
||||
CharacterAnimator: {fileID: 6377581527147502790}
|
||||
_state:
|
||||
IsMoving: 0
|
||||
IsGrounded: 1
|
||||
IsRunning: 0
|
||||
IsDashing: 0
|
||||
IsStunned: 0
|
||||
_health:
|
||||
Max: 100
|
||||
Armor: 0
|
||||
Resistances:
|
||||
- Type: 2
|
||||
Multiplier: 0
|
||||
Immunities: 00000000
|
||||
_current: 0
|
||||
--- !u!1 &7176853314782784158
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8656262745496025766}
|
||||
- component: {fileID: 179238054112632900}
|
||||
- component: {fileID: 8072051991269871080}
|
||||
m_Layer: 0
|
||||
m_Name: Model
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8656262745496025766
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7176853314782784158}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.9, z: 0}
|
||||
m_LocalScale: {x: 0.9, y: 0.9, z: 0.9}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children:
|
||||
- {fileID: 2648838692056603215}
|
||||
m_Father: {fileID: 1336261255310037562}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &179238054112632900
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7176853314782784158}
|
||||
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &8072051991269871080
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7176853314782784158}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_MaskInteraction: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1001 &4057595757166956945
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 1336261255310037562}
|
||||
m_TransformParent: {fileID: 2671059789286476194}
|
||||
m_Modifications:
|
||||
- target: {fileID: -8679921383154817045, guid: 6fff3f1a06c6aab4fb5e1055f1d22848, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
@@ -320,15 +189,15 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: 6fff3f1a06c6aab4fb5e1055f1d22848, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0.479
|
||||
value: 0.353
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: 6fff3f1a06c6aab4fb5e1055f1d22848, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0.878
|
||||
value: 0.22100002
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: 6fff3f1a06c6aab4fb5e1055f1d22848, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0.404
|
||||
value: 0.487
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: 6fff3f1a06c6aab4fb5e1055f1d22848, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
@@ -372,6 +241,9 @@ PrefabInstance:
|
||||
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 6fff3f1a06c6aab4fb5e1055f1d22848, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 6426658406708130876}
|
||||
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 6fff3f1a06c6aab4fb5e1055f1d22848, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 4537212181540951830}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 6fff3f1a06c6aab4fb5e1055f1d22848, type: 3}
|
||||
--- !u!1 &3786981955428199616 stripped
|
||||
GameObject:
|
||||
@@ -392,12 +264,140 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Arena.Combat.ProjectileLauncher
|
||||
_settings:
|
||||
Weapon: {fileID: 11400000, guid: c26b3ad646cf24c48904c1878f8d37e8, type: 2}
|
||||
InfiniteAmmo: 1
|
||||
_references:
|
||||
Muzzle: {fileID: 635898796213162980}
|
||||
_state:
|
||||
Ammo: 0
|
||||
--- !u!1818360609 &4537212181540951830
|
||||
RotationConstraint:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3786981955428199616}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Weight: 1
|
||||
m_RotationAtRest: {x: 0, y: 0, z: 0}
|
||||
m_RotationOffset: {x: 0, y: 0, z: 0}
|
||||
m_AffectRotationX: 1
|
||||
m_AffectRotationY: 1
|
||||
m_AffectRotationZ: 1
|
||||
m_Active: 1
|
||||
m_IsLocked: 1
|
||||
m_Sources:
|
||||
- sourceTransform: {fileID: 3421351127703031065}
|
||||
weight: 1
|
||||
--- !u!4 &4595290834041894522 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 6fff3f1a06c6aab4fb5e1055f1d22848, type: 3}
|
||||
m_PrefabInstance: {fileID: 4057595757166956945}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &8787414032281136754
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 1336261255310037562}
|
||||
m_Modifications:
|
||||
- target: {fileID: 7011957565800906987, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7011957565800906987, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7011957565800906987, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7011957565800906987, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7011957565800906987, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7011957565800906987, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7011957565800906987, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7011957565800906987, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7011957565800906987, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7011957565800906987, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7639418806218873425, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Bot
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects:
|
||||
- targetCorrespondingSourceObject: {fileID: 6693096958089127888, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 4595290834041894522}
|
||||
m_AddedComponents:
|
||||
- targetCorrespondingSourceObject: {fileID: 7639418806218873425, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 6377581527147502790}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
--- !u!1 &1438759811532141603 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 7639418806218873425, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
m_PrefabInstance: {fileID: 8787414032281136754}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &6377581527147502790
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1438759811532141603}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bab6a0f29562e1147b9630b053b4017e, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Arena.Characters.CharacterAnimator
|
||||
_settings:
|
||||
WalkSpeed: 10
|
||||
Damping: 0.1
|
||||
RunMinSpeed: 2
|
||||
_references:
|
||||
Animator: {fileID: 3390278490192325620}
|
||||
_state:
|
||||
IsGrounded: 1
|
||||
IsRunning: 0
|
||||
IsStunned: 0
|
||||
IsFinal: 0
|
||||
Locomotion: {x: 0, y: 0}
|
||||
--- !u!4 &1782388339736538777 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 7011957565800906987, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
m_PrefabInstance: {fileID: 8787414032281136754}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &2671059789286476194 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 6693096958089127888, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
m_PrefabInstance: {fileID: 8787414032281136754}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!95 &3390278490192325620 stripped
|
||||
Animator:
|
||||
m_CorrespondingSourceObject: {fileID: 6268899434028451206, guid: dce89e082ea7b9c48ab0fe0f0d38f147, type: 3}
|
||||
m_PrefabInstance: {fileID: 8787414032281136754}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
|
||||
BIN
Assets/_Content/Scenes/Arena.unity
LFS
Normal file
BIN
Assets/_Content/Scenes/Arena.unity
LFS
Normal file
Binary file not shown.
Binary file not shown.
205
Assets/_Content/Scripts/Characters/CharacterAnimator.cs
Normal file
205
Assets/_Content/Scripts/Characters/CharacterAnimator.cs
Normal file
@@ -0,0 +1,205 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Arena.Characters
|
||||
{
|
||||
/// <summary>
|
||||
/// Animates a character from the movement of its transform and from the calls of its owner (Player).
|
||||
/// Placed on the character root. Only sets parameters: the states, transitions and their durations
|
||||
/// are set in the Animator Controller.
|
||||
/// Floats Forward and Right: speed in the character space, divided by the walk speed (locomotion blend tree).
|
||||
/// Bools IsGrounded, IsRunning, IsStunned. Triggers Jump, Dash, Die, Win, Lose.
|
||||
/// </summary>
|
||||
public class CharacterAnimator : MonoBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
private class Settings
|
||||
{
|
||||
[Tooltip("Speed that plays the walk animations at full blend, in km/h.")]
|
||||
[Min(0.1f)] public float WalkSpeed = 10f;
|
||||
|
||||
[Tooltip("Smoothing of the Forward and Right parameters, in seconds.")]
|
||||
[Min(0f)] public float Damping = 0.1f;
|
||||
|
||||
[Tooltip("Speed below which a running character is not shown running, in km/h.")]
|
||||
[Min(0f)] public float RunMinSpeed = 2f;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
private struct References
|
||||
{
|
||||
public Animator Animator;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class StateContainer
|
||||
{
|
||||
public bool IsGrounded = true;
|
||||
public bool IsRunning;
|
||||
public bool IsStunned;
|
||||
public bool IsFinal;
|
||||
|
||||
[Tooltip("Speed in the character space, divided by the walk speed. x: right, y: forward.")]
|
||||
public Vector2 Locomotion;
|
||||
}
|
||||
|
||||
#region FIELDS
|
||||
|
||||
const float KMH_TO_MS = 1 / 3.6f;
|
||||
|
||||
// Parameters, named as in the Animator Controller
|
||||
private static readonly int ForwardParameter = Animator.StringToHash("Forward");
|
||||
private static readonly int RightParameter = Animator.StringToHash("Right");
|
||||
private static readonly int IsGroundedParameter = Animator.StringToHash("IsGrounded");
|
||||
private static readonly int IsRunningParameter = Animator.StringToHash("IsRunning");
|
||||
private static readonly int IsStunnedParameter = Animator.StringToHash("IsStunned");
|
||||
private static readonly int JumpTrigger = Animator.StringToHash("Jump");
|
||||
private static readonly int DashTrigger = Animator.StringToHash("Dash");
|
||||
private static readonly int DieTrigger = Animator.StringToHash("Die");
|
||||
private static readonly int WinTrigger = Animator.StringToHash("Win");
|
||||
private static readonly int LoseTrigger = Animator.StringToHash("Lose");
|
||||
|
||||
[SerializeField] private Settings _settings;
|
||||
[SerializeField] private References _references;
|
||||
[SerializeField] private StateContainer _state;
|
||||
|
||||
public StateContainer State => _state;
|
||||
|
||||
private Vector3 _lastPosition;
|
||||
private float _speed;
|
||||
private float _stunEndTime;
|
||||
|
||||
#endregion
|
||||
|
||||
#region UNITY LIFECYCLES
|
||||
|
||||
void Awake()
|
||||
{
|
||||
_lastPosition = transform.position;
|
||||
_references.Animator.SetBool(IsGroundedParameter, _state.IsGrounded);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
float t = Time.deltaTime;
|
||||
|
||||
// A paused game (time scale at 0) gives no speed to measure
|
||||
if (t > 0f)
|
||||
UpdateLocomotion(t);
|
||||
|
||||
if (_state.IsStunned && Time.time >= _stunEndTime)
|
||||
SetStunned(false);
|
||||
|
||||
_references.Animator.SetBool(IsRunningParameter, _state.IsRunning && _speed >= _settings.RunMinSpeed * KMH_TO_MS);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
/// <summary>
|
||||
/// Tells whether the character stands on the ground. Called by the owner when it changes.
|
||||
/// </summary>
|
||||
public void SetGrounded(bool isGrounded)
|
||||
{
|
||||
_state.IsGrounded = isGrounded;
|
||||
_references.Animator.SetBool(IsGroundedParameter, isGrounded);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tells whether the character is running. Called by the owner when it changes.
|
||||
/// IsRunning is true in the Animator only while the character also moves.
|
||||
/// </summary>
|
||||
public void SetRunning(bool isRunning)
|
||||
{
|
||||
_state.IsRunning = isRunning;
|
||||
}
|
||||
|
||||
public void Jump()
|
||||
{
|
||||
SetTrigger(JumpTrigger);
|
||||
}
|
||||
|
||||
public void Dash()
|
||||
{
|
||||
SetTrigger(DashTrigger);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets IsStunned for a duration, in seconds.
|
||||
/// </summary>
|
||||
public void Stun(float duration)
|
||||
{
|
||||
if (_state.IsFinal)
|
||||
return;
|
||||
|
||||
_stunEndTime = Time.time + duration;
|
||||
SetStunned(true);
|
||||
}
|
||||
|
||||
public void Die()
|
||||
{
|
||||
SetFinalTrigger(DieTrigger);
|
||||
}
|
||||
|
||||
public void Win()
|
||||
{
|
||||
SetFinalTrigger(WinTrigger);
|
||||
}
|
||||
|
||||
public void Lose()
|
||||
{
|
||||
SetFinalTrigger(LoseTrigger);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region PRIVATE METHODS
|
||||
|
||||
private void UpdateLocomotion(float t)
|
||||
{
|
||||
Vector3 position = transform.position;
|
||||
Vector3 velocity = (position - _lastPosition) / t;
|
||||
_lastPosition = position;
|
||||
|
||||
velocity.y = 0f;
|
||||
_speed = velocity.magnitude;
|
||||
|
||||
// Speed in the character space, so that a sideways move plays walkRight
|
||||
Vector3 localVelocity = transform.InverseTransformDirection(velocity);
|
||||
Vector2 locomotion = new Vector2(localVelocity.x, localVelocity.z) / (_settings.WalkSpeed * KMH_TO_MS);
|
||||
_state.Locomotion = Vector2.ClampMagnitude(locomotion, 1f);
|
||||
|
||||
_references.Animator.SetFloat(ForwardParameter, _state.Locomotion.y, _settings.Damping, t);
|
||||
_references.Animator.SetFloat(RightParameter, _state.Locomotion.x, _settings.Damping, t);
|
||||
}
|
||||
|
||||
private void SetStunned(bool isStunned)
|
||||
{
|
||||
_state.IsStunned = isStunned;
|
||||
_references.Animator.SetBool(IsStunnedParameter, isStunned);
|
||||
}
|
||||
|
||||
private void SetTrigger(int trigger)
|
||||
{
|
||||
if (_state.IsFinal || _state.IsStunned)
|
||||
return;
|
||||
|
||||
_references.Animator.SetTrigger(trigger);
|
||||
}
|
||||
|
||||
private void SetFinalTrigger(int trigger)
|
||||
{
|
||||
if (_state.IsFinal)
|
||||
return;
|
||||
|
||||
_state.IsFinal = true;
|
||||
SetStunned(false);
|
||||
|
||||
// Win and lose are played while the game is paused (time scale at 0)
|
||||
_references.Animator.updateMode = AnimatorUpdateMode.UnscaledTime;
|
||||
_references.Animator.SetTrigger(trigger);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bab6a0f29562e1147b9630b053b4017e
|
||||
@@ -1,276 +1,454 @@
|
||||
using Arena.Combat;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using Arena.Combat;
|
||||
|
||||
namespace Arena.Characters
|
||||
{
|
||||
public class Player : MonoBehaviour, IDamageable
|
||||
{
|
||||
[System.Serializable]
|
||||
public class Settings
|
||||
{
|
||||
[Tooltip("Movement speed, in km/h.")]
|
||||
[Min(0f)] public float Speed = 5f;
|
||||
}
|
||||
public class Player : MonoBehaviour, IDamageable
|
||||
{
|
||||
[System.Serializable]
|
||||
private class Settings
|
||||
{
|
||||
[Tooltip("Movement speed, in km/h.")]
|
||||
public float Speed = 10;
|
||||
|
||||
[System.Serializable]
|
||||
public struct References
|
||||
{
|
||||
public CharacterController Controller;
|
||||
public ProjectileLauncher Launcher;
|
||||
public InputActionReference MoveAction;
|
||||
public InputActionReference LookAction;
|
||||
public InputActionReference AttackAction;
|
||||
public InputActionReference InteractAction;
|
||||
}
|
||||
[Tooltip("Smoothing of the orientation, in seconds. 0: the player turns instantly.")]
|
||||
[Min(0f)] public float RotationDamping = 0.08f;
|
||||
|
||||
[System.Serializable]
|
||||
public class StateContainer
|
||||
{
|
||||
public bool IsMoving;
|
||||
}
|
||||
[Tooltip("Speed while the sprint action is held, in km/h. The player then faces where it runs and cannot shoot.")]
|
||||
[Min(0f)] public float RunSpeed = 18f;
|
||||
|
||||
#region Fields
|
||||
[Tooltip("Distance covered by a dash, in meters.")]
|
||||
[Min(0f)] public float DashDistance = 4f;
|
||||
|
||||
private const float KMH_TO_MS = 1f / 3.6f;
|
||||
private const float AIM_STICK_DEADZONE = 0.2f;
|
||||
[Tooltip("Duration of a dash, in seconds.")]
|
||||
[Min(0.05f)] public float DashDuration = 0.2f;
|
||||
|
||||
[SerializeField] private Settings _settings;
|
||||
[SerializeField] private References _references;
|
||||
[SerializeField] private StateContainer _state;
|
||||
[SerializeField] private Health _health;
|
||||
[Tooltip("Time between the start of two dashes, in seconds.")]
|
||||
[Min(0f)] public float DashCooldown = 1f;
|
||||
|
||||
/// <summary>
|
||||
/// Raised when the interact action is performed.
|
||||
/// </summary>
|
||||
public event Action OnInteract;
|
||||
[Tooltip("Jump height, in meters.")]
|
||||
[Min(0f)] public float JumpHeight = 1.2f;
|
||||
|
||||
/// <summary>
|
||||
/// The only player of the scene.
|
||||
/// </summary>
|
||||
public static Player Instance { get; private set; }
|
||||
public StateContainer State => _state;
|
||||
public Health Health => _health;
|
||||
public ProjectileLauncher Launcher => _references.Launcher;
|
||||
[Tooltip("Gravity, in meters per second squared.")]
|
||||
[Min(0f)] public float Gravity = 20f;
|
||||
}
|
||||
|
||||
private Camera _camera;
|
||||
private Vector2 _moveInput;
|
||||
private Vector2 _aimStickInput;
|
||||
private bool _isAimingWithStick;
|
||||
private bool _isAttacking;
|
||||
private bool _isInteracting;
|
||||
private Vector3 _aimDirection = Vector3.forward;
|
||||
[System.Serializable]
|
||||
private struct References
|
||||
{
|
||||
public CharacterController Controller;
|
||||
public InputActionReference MoveAction;
|
||||
public InputActionReference InteractAction;
|
||||
public InputActionReference LookAction;
|
||||
public InputActionReference AttackAction;
|
||||
public InputActionReference JumpAction;
|
||||
public InputActionReference SprintAction;
|
||||
|
||||
#endregion
|
||||
[Tooltip("Crouch action of the template, used for the dash.")]
|
||||
public InputActionReference DashAction;
|
||||
public ProjectileLauncher Launcher;
|
||||
public CharacterAnimator CharacterAnimator;
|
||||
}
|
||||
|
||||
#region Unity Lifecycle
|
||||
[System.Serializable]
|
||||
public class StateContainer
|
||||
{
|
||||
public bool IsMoving = false;
|
||||
public bool IsGrounded = true;
|
||||
public bool IsRunning = false;
|
||||
public bool IsDashing = false;
|
||||
public bool IsStunned = false;
|
||||
}
|
||||
|
||||
void Awake()
|
||||
{
|
||||
// Only one player can exist: a second one is removed
|
||||
if (Instance && Instance != this)
|
||||
{
|
||||
Debug.LogWarning($"A second Player was found on {name}, it is destroyed.");
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
#region FIELDS
|
||||
|
||||
Instance = this;
|
||||
public static Player Instance { get; private set; }
|
||||
|
||||
// Camera.main is the camera tagged MainCamera
|
||||
_camera = Camera.main;
|
||||
_health.Initialize();
|
||||
}
|
||||
const float KMH_TO_MS = 1 / 3.6f;
|
||||
const float AIM_STICK_DEADZONE = 0.2f;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
SetInputsEnabled(true);
|
||||
}
|
||||
// Small downward speed kept on the ground, so that the CharacterController stays grounded
|
||||
const float GROUNDED_SPEED = -2f;
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
SetInputsEnabled(false);
|
||||
}
|
||||
[SerializeField] private Settings _settings;
|
||||
[SerializeField] private References _references;
|
||||
[SerializeField] private StateContainer _state;
|
||||
[SerializeField] private Health _health;
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
if (Instance == this)
|
||||
Instance = null;
|
||||
}
|
||||
public event Action OnInteract;
|
||||
|
||||
void Update()
|
||||
{
|
||||
// A dead player no longer moves nor shoots
|
||||
if (_health.IsDead)
|
||||
return;
|
||||
public StateContainer State => _state;
|
||||
public Health Health => _health;
|
||||
public ProjectileLauncher Launcher => _references.Launcher;
|
||||
|
||||
float deltaTime = Time.deltaTime;
|
||||
private bool _isInteracting;
|
||||
private Vector2 _moveInput;
|
||||
private Camera _camera;
|
||||
private Vector2 _aimStickInput;
|
||||
private bool _isAimingWithStick;
|
||||
private bool _isAttacking;
|
||||
private Vector3 _aimDirection = Vector3.forward;
|
||||
private bool _isJumping;
|
||||
private bool _isSprinting;
|
||||
private bool _isDashPressed;
|
||||
private Vector3 _moveDirection;
|
||||
private Vector3 _dashDirection;
|
||||
private float _dashEndTime;
|
||||
private float _nextDashTime;
|
||||
private float _verticalSpeed;
|
||||
private float _stunEndTime;
|
||||
|
||||
GetInputs();
|
||||
Move(deltaTime);
|
||||
Aim();
|
||||
Attack();
|
||||
Interact();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
#region UNITY LIFECYCLES
|
||||
|
||||
#region Public Methods
|
||||
void Awake()
|
||||
{
|
||||
if (Instance && Instance != this)
|
||||
{
|
||||
Debug.LogWarning($"A second Player was found on {name}, it is destroyed.");
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
|
||||
public void TakeDamage(int amount)
|
||||
{
|
||||
_health.TakeDamage(amount);
|
||||
}
|
||||
Instance = this;
|
||||
|
||||
/// <summary>
|
||||
/// Teleports the player.
|
||||
/// </summary>
|
||||
/// <param name="pose">x, y, z: position. w: angle around the vertical axis, in degrees.</param>
|
||||
public void Teleport(Vector4 pose)
|
||||
{
|
||||
// An enabled CharacterController would overwrite the new position
|
||||
_references.Controller.enabled = false;
|
||||
_health.Initialize();
|
||||
_health.OnDied += HandleDied;
|
||||
|
||||
Vector3 position = new Vector3(pose.x, pose.y, pose.z);
|
||||
Quaternion rotation = Quaternion.Euler(0f, pose.w, 0f);
|
||||
transform.SetPositionAndRotation(position, rotation);
|
||||
_camera = Camera.main;
|
||||
}
|
||||
|
||||
_references.Controller.enabled = true;
|
||||
}
|
||||
void OnEnable()
|
||||
{
|
||||
_references.MoveAction.action.Enable();
|
||||
_references.InteractAction.action.Enable();
|
||||
_references.LookAction.action.Enable();
|
||||
_references.AttackAction.action.Enable();
|
||||
_references.JumpAction.action.Enable();
|
||||
_references.SprintAction.action.Enable();
|
||||
_references.DashAction.action.Enable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Teleports the player to the position and heading of a target, such as a spawn point.
|
||||
/// </summary>
|
||||
public void Teleport(Transform target)
|
||||
{
|
||||
Vector3 position = target.position;
|
||||
Vector4 pose = new Vector4(position.x, position.y, position.z, target.eulerAngles.y);
|
||||
Teleport(pose);
|
||||
}
|
||||
void OnDisable()
|
||||
{
|
||||
if (Instance == this)
|
||||
{
|
||||
_references.MoveAction.action.Disable();
|
||||
_references.InteractAction.action.Disable();
|
||||
_references.LookAction.action.Disable();
|
||||
_references.AttackAction.action.Disable();
|
||||
_references.JumpAction.action.Disable();
|
||||
_references.SprintAction.action.Disable();
|
||||
_references.DashAction.action.Disable();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
void OnDestroy()
|
||||
{
|
||||
_health.OnDied -= HandleDied;
|
||||
|
||||
#region Private Methods
|
||||
if (Instance == this)
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
private void SetInputsEnabled(bool isEnabled)
|
||||
{
|
||||
InputActionReference[] actions =
|
||||
{
|
||||
_references.MoveAction,
|
||||
_references.LookAction,
|
||||
_references.AttackAction,
|
||||
_references.InteractAction
|
||||
};
|
||||
void Update()
|
||||
{
|
||||
if (_health.IsDead)
|
||||
return;
|
||||
|
||||
foreach (InputActionReference action in actions)
|
||||
{
|
||||
if (isEnabled)
|
||||
action.action.Enable();
|
||||
else
|
||||
action.action.Disable();
|
||||
}
|
||||
}
|
||||
float t = Time.deltaTime;
|
||||
|
||||
private void GetInputs()
|
||||
{
|
||||
_moveInput = _references.MoveAction.action.ReadValue<Vector2>();
|
||||
_isAttacking = _references.AttackAction.action.IsPressed();
|
||||
_isInteracting = _references.InteractAction.action.WasPerformedThisFrame();
|
||||
GetInputs();
|
||||
UpdateStun();
|
||||
Move(t);
|
||||
|
||||
InputAction look = _references.LookAction.action;
|
||||
_aimStickInput = look.ReadValue<Vector2>();
|
||||
// A stunned player only falls: no aiming, shooting nor interacting
|
||||
if (_state.IsStunned)
|
||||
return;
|
||||
|
||||
// Look is also bound to the mouse delta: only the gamepad counts as a stick
|
||||
bool isStick = look.activeControl != null && look.activeControl.device is Gamepad;
|
||||
Aim(t);
|
||||
Attack();
|
||||
Interact();
|
||||
}
|
||||
|
||||
// The last aiming device used wins: the stick when pushed, the mouse when moved
|
||||
if (isStick && IsStickPushed())
|
||||
_isAimingWithStick = true;
|
||||
else if (Pointer.current != null && Pointer.current.delta.ReadValue().sqrMagnitude > 0f)
|
||||
_isAimingWithStick = false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void Move(float deltaTime)
|
||||
{
|
||||
Vector3 direction = ToWorldDirection(_moveInput);
|
||||
_state.IsMoving = direction.sqrMagnitude > 0f;
|
||||
#region PUBLIC METHODS
|
||||
|
||||
Vector3 velocity = direction * _settings.Speed * KMH_TO_MS;
|
||||
_references.Controller.Move(velocity * deltaTime);
|
||||
}
|
||||
public void TakeDamage(DamageInfo damage)
|
||||
{
|
||||
_health.TakeDamage(damage);
|
||||
}
|
||||
|
||||
private void Aim()
|
||||
{
|
||||
if (_isAimingWithStick)
|
||||
{
|
||||
// Released stick: the player keeps its last direction
|
||||
if (IsStickPushed())
|
||||
_aimDirection = ToWorldDirection(_aimStickInput);
|
||||
}
|
||||
else if (TryGetPointerDirection(out Vector3 direction))
|
||||
{
|
||||
_aimDirection = direction;
|
||||
}
|
||||
/// <summary>
|
||||
/// Takes the control away from the player for a duration, in seconds, and plays the stunned animation.
|
||||
/// </summary>
|
||||
public void Stun(float duration)
|
||||
{
|
||||
if (_health.IsDead)
|
||||
return;
|
||||
|
||||
transform.rotation = Quaternion.LookRotation(_aimDirection);
|
||||
}
|
||||
_stunEndTime = Time.time + duration;
|
||||
_state.IsStunned = true;
|
||||
_state.IsDashing = false;
|
||||
SetRunning(false);
|
||||
_references.CharacterAnimator.Stun(duration);
|
||||
}
|
||||
|
||||
private void Attack()
|
||||
{
|
||||
if (_isAttacking)
|
||||
_references.Launcher.TryFire();
|
||||
}
|
||||
/// <summary>
|
||||
/// Teleports the player.
|
||||
/// </summary>
|
||||
/// <param name="pose">x, y, z: position. w: angle around the vertical axis, in degrees.</param>
|
||||
public void Teleport(Vector4 pose)
|
||||
{
|
||||
// An enabled CharacterController would overwrite the new position
|
||||
_references.Controller.enabled = false;
|
||||
|
||||
private void Interact()
|
||||
{
|
||||
if (_isInteracting)
|
||||
OnInteract?.Invoke();
|
||||
}
|
||||
Vector3 position = new Vector3(pose.x, pose.y, pose.z);
|
||||
Quaternion rotation = Quaternion.Euler(0f, pose.w, 0f);
|
||||
transform.SetPositionAndRotation(position, rotation);
|
||||
|
||||
private bool IsStickPushed()
|
||||
{
|
||||
return _aimStickInput.sqrMagnitude > AIM_STICK_DEADZONE * AIM_STICK_DEADZONE;
|
||||
}
|
||||
_references.Controller.enabled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a 2D input into a world direction on the ground, relative to the camera heading.
|
||||
/// </summary>
|
||||
private Vector3 ToWorldDirection(Vector2 input)
|
||||
{
|
||||
// Only the camera rotation around the vertical axis is kept
|
||||
Quaternion cameraHeading = Quaternion.Euler(0f, _camera.transform.eulerAngles.y, 0f);
|
||||
return cameraHeading * new Vector3(input.x, 0f, input.y);
|
||||
}
|
||||
/// <summary>
|
||||
/// Teleports the player to the position and heading of a target, such as a spawn point.
|
||||
/// </summary>
|
||||
public void Teleport(Transform target)
|
||||
{
|
||||
Vector3 position = target.position;
|
||||
Vector4 pose = new Vector4(position.x, position.y, position.z, target.eulerAngles.y);
|
||||
Teleport(pose);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Direction from the player to the point under the pointer, on a horizontal plane at the player's height.
|
||||
/// </summary>
|
||||
private bool TryGetPointerDirection(out Vector3 direction)
|
||||
{
|
||||
direction = Vector3.zero;
|
||||
#endregion
|
||||
|
||||
if (Pointer.current == null)
|
||||
return false;
|
||||
#region PRIVATE METHODS
|
||||
|
||||
// Mouse position read directly: the Look action only gives its movement
|
||||
Ray ray = _camera.ScreenPointToRay(Pointer.current.position.ReadValue());
|
||||
Plane ground = new Plane(Vector3.up, transform.position);
|
||||
#if UNITY_EDITOR
|
||||
[ContextMenu("Debug/Take 25 Damage")]
|
||||
private void DebugTakeDamage()
|
||||
{
|
||||
TakeDamage(new DamageInfo(25, DamageType.Physical, gameObject));
|
||||
}
|
||||
|
||||
if (!ground.Raycast(ray, out float distance))
|
||||
return false;
|
||||
[ContextMenu("Debug/Stun 2 s")]
|
||||
private void DebugStun()
|
||||
{
|
||||
Stun(2f);
|
||||
}
|
||||
#endif
|
||||
|
||||
direction = ray.GetPoint(distance) - transform.position;
|
||||
direction.y = 0f;
|
||||
return direction.sqrMagnitude > 0.01f;
|
||||
}
|
||||
private void GetInputs()
|
||||
{
|
||||
_moveInput = _references.MoveAction.action.ReadValue<Vector2>();
|
||||
_isInteracting = _references.InteractAction.action.WasPressedThisFrame();
|
||||
_isAttacking = _references.AttackAction.action.IsPressed();
|
||||
_isJumping = _references.JumpAction.action.WasPressedThisFrame();
|
||||
_isSprinting = _references.SprintAction.action.IsPressed();
|
||||
_isDashPressed = _references.DashAction.action.WasPressedThisFrame();
|
||||
|
||||
[ContextMenu("Debug/Take 25 Damage")]
|
||||
private void DebugTakeDamage()
|
||||
{
|
||||
TakeDamage(25);
|
||||
}
|
||||
InputAction look = _references.LookAction.action;
|
||||
_aimStickInput = look.ReadValue<Vector2>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
// Look is also bound to the mouse delta: only the gamepad counts as a stick
|
||||
bool isStick = look.activeControl != null && look.activeControl.device is Gamepad;
|
||||
|
||||
// The last aiming device used wins: the stick when pushed, the mouse when moved
|
||||
if (isStick && IsStickPushed())
|
||||
_isAimingWithStick = true;
|
||||
else if (Pointer.current != null && Pointer.current.delta.ReadValue().sqrMagnitude > 0f)
|
||||
_isAimingWithStick = false;
|
||||
}
|
||||
|
||||
private void Move(float t)
|
||||
{
|
||||
Vector2 input = _state.IsStunned ? Vector2.zero : _moveInput;
|
||||
_moveDirection = ToWorldDirection(input);
|
||||
bool hasInput = _moveDirection.sqrMagnitude > .01f;
|
||||
|
||||
if (_state.IsDashing && Time.time >= _dashEndTime)
|
||||
_state.IsDashing = false;
|
||||
|
||||
if (_isDashPressed && !_state.IsStunned && !_state.IsDashing && Time.time >= _nextDashTime)
|
||||
Dash(hasInput ? _moveDirection.normalized : transform.forward);
|
||||
|
||||
SetRunning(_isSprinting && hasInput && !_state.IsStunned);
|
||||
|
||||
Vector3 velocity;
|
||||
|
||||
if (_state.IsDashing)
|
||||
{
|
||||
velocity = _dashDirection * (_settings.DashDistance / _settings.DashDuration);
|
||||
}
|
||||
else
|
||||
{
|
||||
float speed = _state.IsRunning ? _settings.RunSpeed : _settings.Speed;
|
||||
velocity = _moveDirection * KMH_TO_MS * speed;
|
||||
}
|
||||
|
||||
_state.IsMoving = velocity.sqrMagnitude > .01f;
|
||||
|
||||
if (_state.IsGrounded && _isJumping && !_state.IsStunned)
|
||||
Jump();
|
||||
|
||||
// Gravity: the CharacterController does not apply it
|
||||
_verticalSpeed -= _settings.Gravity * t;
|
||||
velocity.y = _verticalSpeed;
|
||||
|
||||
_references.Controller.Move(velocity * t);
|
||||
|
||||
SetGrounded(_references.Controller.isGrounded);
|
||||
|
||||
if (_state.IsGrounded && _verticalSpeed < 0f)
|
||||
_verticalSpeed = GROUNDED_SPEED;
|
||||
}
|
||||
|
||||
private void Jump()
|
||||
{
|
||||
// Speed that reaches the jump height against gravity: v = sqrt(2 g h)
|
||||
_verticalSpeed = Mathf.Sqrt(2f * _settings.Gravity * _settings.JumpHeight);
|
||||
_references.CharacterAnimator.Jump();
|
||||
}
|
||||
|
||||
private void Dash(Vector3 direction)
|
||||
{
|
||||
_dashDirection = direction;
|
||||
_dashEndTime = Time.time + _settings.DashDuration;
|
||||
_nextDashTime = Time.time + _settings.DashCooldown;
|
||||
_state.IsDashing = true;
|
||||
_references.CharacterAnimator.Dash();
|
||||
}
|
||||
|
||||
private void SetRunning(bool isRunning)
|
||||
{
|
||||
if (_state.IsRunning == isRunning)
|
||||
return;
|
||||
|
||||
_state.IsRunning = isRunning;
|
||||
_references.CharacterAnimator.SetRunning(isRunning);
|
||||
}
|
||||
|
||||
private void SetGrounded(bool isGrounded)
|
||||
{
|
||||
if (_state.IsGrounded == isGrounded)
|
||||
return;
|
||||
|
||||
_state.IsGrounded = isGrounded;
|
||||
_references.CharacterAnimator.SetGrounded(isGrounded);
|
||||
}
|
||||
|
||||
private void UpdateStun()
|
||||
{
|
||||
if (_state.IsStunned && Time.time >= _stunEndTime)
|
||||
_state.IsStunned = false;
|
||||
}
|
||||
|
||||
private void HandleDied()
|
||||
{
|
||||
_references.CharacterAnimator.Die();
|
||||
}
|
||||
|
||||
|
||||
private void Aim(float t)
|
||||
{
|
||||
// Running and dashing face the movement: aiming is suspended
|
||||
if (_state.IsDashing)
|
||||
{
|
||||
TurnTowards(_dashDirection, t);
|
||||
return;
|
||||
}
|
||||
|
||||
// In the air, the player keeps the orientation it had when it left the ground
|
||||
if (!_state.IsGrounded)
|
||||
return;
|
||||
|
||||
if (_state.IsRunning)
|
||||
{
|
||||
TurnTowards(_moveDirection, t);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_isAimingWithStick)
|
||||
{
|
||||
// Released stick: the player keeps its last direction
|
||||
if (IsStickPushed())
|
||||
_aimDirection = ToWorldDirection(_aimStickInput);
|
||||
}
|
||||
else if (TryGetPointerDirection(out Vector3 direction))
|
||||
{
|
||||
_aimDirection = direction;
|
||||
}
|
||||
|
||||
TurnTowards(_aimDirection, t);
|
||||
}
|
||||
|
||||
private void TurnTowards(Vector3 direction, float t)
|
||||
{
|
||||
Quaternion target = Quaternion.LookRotation(direction);
|
||||
|
||||
if (_settings.RotationDamping <= 0f)
|
||||
{
|
||||
transform.rotation = target;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Exponential smoothing: the same feel whatever the frame rate
|
||||
float blend = 1f - Mathf.Exp(-t / _settings.RotationDamping);
|
||||
transform.rotation = Quaternion.Slerp(transform.rotation, target, blend);
|
||||
}
|
||||
}
|
||||
|
||||
private void Attack()
|
||||
{
|
||||
// No shooting while running
|
||||
if (_isAttacking && !_state.IsRunning)
|
||||
_references.Launcher.TryFire();
|
||||
}
|
||||
|
||||
private void Interact()
|
||||
{
|
||||
if (_isInteracting)
|
||||
OnInteract?.Invoke();
|
||||
}
|
||||
|
||||
private bool IsStickPushed()
|
||||
{
|
||||
return _aimStickInput.sqrMagnitude > AIM_STICK_DEADZONE * AIM_STICK_DEADZONE;
|
||||
}
|
||||
|
||||
private Vector3 ToWorldDirection(Vector2 input)
|
||||
{
|
||||
// Only the camera rotation around the vertical axis is kept
|
||||
Quaternion cameraHeading = Quaternion.Euler(0f, _camera.transform.eulerAngles.y, 0f);
|
||||
return cameraHeading * new Vector3(input.x, 0f, input.y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Direction from the player to the point under the pointer, on a horizontal plane at the player's height.
|
||||
/// </summary>
|
||||
private bool TryGetPointerDirection(out Vector3 direction)
|
||||
{
|
||||
direction = Vector3.zero;
|
||||
|
||||
if (Pointer.current == null)
|
||||
return false;
|
||||
|
||||
// Mouse position read directly: the Look action only gives its movement
|
||||
Ray ray = _camera.ScreenPointToRay(Pointer.current.position.ReadValue());
|
||||
Plane ground = new Plane(Vector3.up, transform.position);
|
||||
|
||||
if (!ground.Raycast(ray, out float distance))
|
||||
return false;
|
||||
|
||||
direction = ray.GetPoint(distance) - transform.position;
|
||||
direction.y = 0f;
|
||||
return direction.sqrMagnitude > 0.01f;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,88 +2,74 @@ using UnityEngine;
|
||||
|
||||
namespace Arena.Characters
|
||||
{
|
||||
[ExecuteAlways]
|
||||
public class PlayerCamera : MonoBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
public class Settings
|
||||
{
|
||||
[Tooltip("x: horizontal distance from the player, y: height above the player, in meters.")]
|
||||
public Vector2 Offset = new Vector2(8f, 12f);
|
||||
[ExecuteAlways]
|
||||
public class PlayerCamera : MonoBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
public class Settings
|
||||
{
|
||||
[Tooltip("x: horizontal distance from the player, y: height above the player, in meters.")]
|
||||
public Vector2 Offset = new Vector2(7f, 8f);
|
||||
|
||||
[Tooltip("Rotation of the offset around the player, in degrees.")]
|
||||
public float Angle = 0f;
|
||||
[Tooltip("Rotation of the offset around the player, in degrees.")]
|
||||
public float Angle = 0f;
|
||||
|
||||
[Tooltip("Time to catch up with the player, in seconds. 0: no smoothing.")]
|
||||
[Range(0f, 1f)] public float Smooth = 0.2f;
|
||||
}
|
||||
[Tooltip("Time to catch up with the player, in seconds. 0: no smoothing.")]
|
||||
[Range(0f, 1f)] public float Smooth = 0.2f;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public struct References
|
||||
{
|
||||
[Tooltip("Followed player. Found automatically when empty.")]
|
||||
public Player Player;
|
||||
}
|
||||
[System.Serializable]
|
||||
private struct References
|
||||
{
|
||||
public Player Player;
|
||||
}
|
||||
|
||||
#region Fields
|
||||
#region FIELDS
|
||||
|
||||
[SerializeField] private Settings _settings;
|
||||
[SerializeField] private References _references;
|
||||
[SerializeField] private Settings _settings;
|
||||
[SerializeField] private References _references;
|
||||
|
||||
private Vector3 _velocity;
|
||||
private Vector3 _velocity;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Unity Lifecycle
|
||||
// LateUpdate: the player has already moved this frame
|
||||
void LateUpdate()
|
||||
{
|
||||
if (!GetPlayer())
|
||||
return;
|
||||
|
||||
// LateUpdate: the player has already moved this frame
|
||||
void LateUpdate()
|
||||
{
|
||||
if (!GetPlayer())
|
||||
return;
|
||||
Vector3 targetPos = GetTargetPosition();
|
||||
|
||||
Vector3 targetPos = GetTargetPosition();
|
||||
if (!Application.isPlaying || _settings.Smooth == 0)
|
||||
{
|
||||
transform.position = targetPos;
|
||||
}
|
||||
else
|
||||
{
|
||||
transform.position = Vector3.SmoothDamp(transform.position, targetPos, ref _velocity, _settings.Smooth);
|
||||
}
|
||||
}
|
||||
|
||||
// No smoothing in edit mode: the camera snaps while the scene is edited
|
||||
if (!Application.isPlaying || _settings.Smooth <= 0f)
|
||||
{
|
||||
transform.position = targetPos;
|
||||
_velocity = Vector3.zero;
|
||||
}
|
||||
else
|
||||
{
|
||||
transform.position = Vector3.SmoothDamp(transform.position, targetPos, ref _velocity, _settings.Smooth);
|
||||
}
|
||||
}
|
||||
private bool GetPlayer()
|
||||
{
|
||||
if (_references.Player)
|
||||
return true;
|
||||
|
||||
#endregion
|
||||
// In edit mode, Player.Awake has not run, so the singleton is empty
|
||||
else if (Player.Instance)
|
||||
_references.Player = Player.Instance;
|
||||
else
|
||||
_references.Player = FindFirstObjectByType<Player>();
|
||||
|
||||
#region Private Methods
|
||||
return _references.Player != null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks for the player: singleton first, then a search in the scene. Returns false if none is found.
|
||||
/// </summary>
|
||||
private bool GetPlayer()
|
||||
{
|
||||
if (_references.Player)
|
||||
return true;
|
||||
|
||||
// In edit mode, Player.Awake has not run, so the singleton is empty
|
||||
else if (Player.Instance)
|
||||
_references.Player = Player.Instance;
|
||||
else
|
||||
_references.Player = FindFirstObjectByType<Player>();
|
||||
|
||||
return _references.Player != null;
|
||||
}
|
||||
|
||||
private Vector3 GetTargetPosition()
|
||||
{
|
||||
Quaternion rotation = Quaternion.Euler(0f, _settings.Angle, 0f);
|
||||
Vector3 offset = rotation * new Vector3(0f, _settings.Offset.y, -_settings.Offset.x);
|
||||
return _references.Player.transform.position + offset;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
private Vector3 GetTargetPosition()
|
||||
{
|
||||
Quaternion rotation = Quaternion.Euler(0, _settings.Angle, 0);
|
||||
Vector3 offset = rotation * new Vector3(0, _settings.Offset.y, -_settings.Offset.x);
|
||||
return _references.Player.transform.position + offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using Arena.Characters;
|
||||
|
||||
namespace Arena.Interactions
|
||||
{
|
||||
/// <summary>
|
||||
/// Zone that raises OnPlayer when the player enters it, or when the player interacts inside it.
|
||||
/// It never acts on the player itself: the actions are set up in the Inspector.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(Collider))]
|
||||
public class PlayerEvent : MonoBehaviour
|
||||
{
|
||||
public enum Trigger
|
||||
{
|
||||
OnPlayerEnter,
|
||||
OnPlayerInteract
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class Settings
|
||||
{
|
||||
[Tooltip("OnPlayerEnter: as soon as the player enters. OnPlayerInteract: when the player interacts inside the zone.")]
|
||||
public Trigger Trigger;
|
||||
}
|
||||
|
||||
#region Fields
|
||||
|
||||
[SerializeField] private Settings _settings;
|
||||
|
||||
[Tooltip("Actions raised for the player: heal, ammo, sound, hide this object...")]
|
||||
[SerializeField] private UnityEvent _onPlayer;
|
||||
|
||||
private bool _isListening;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Unity Lifecycle
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
// The object can be hidden while the player is inside
|
||||
StopListening();
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (!IsPlayer(other))
|
||||
return;
|
||||
|
||||
if (_settings.Trigger == Trigger.OnPlayerEnter)
|
||||
_onPlayer.Invoke();
|
||||
else
|
||||
StartListening();
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (IsPlayer(other))
|
||||
StopListening();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private bool IsPlayer(Collider other)
|
||||
{
|
||||
return Player.Instance != null && other.gameObject == Player.Instance.gameObject;
|
||||
}
|
||||
|
||||
private void StartListening()
|
||||
{
|
||||
Player.Instance.OnInteract += HandleInteract;
|
||||
_isListening = true;
|
||||
}
|
||||
|
||||
private void StopListening()
|
||||
{
|
||||
if (!_isListening)
|
||||
return;
|
||||
|
||||
if (Player.Instance != null)
|
||||
Player.Instance.OnInteract -= HandleInteract;
|
||||
|
||||
_isListening = false;
|
||||
}
|
||||
|
||||
private void HandleInteract()
|
||||
{
|
||||
_onPlayer.Invoke();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d3c874cb9bc4c364d87e100aada2b434
|
||||
@@ -1,34 +0,0 @@
|
||||
using UnityEngine;
|
||||
using Arena.Characters;
|
||||
|
||||
namespace Arena.Interactions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gives ammo to the player. Apply is meant to be linked to a PlayerEvent.
|
||||
/// </summary>
|
||||
public class AmmoEffect : MonoBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
public class Settings
|
||||
{
|
||||
[Tooltip("Ammo given to the player.")]
|
||||
[Min(1)] public int Amount = 10;
|
||||
}
|
||||
|
||||
#region Fields
|
||||
|
||||
[SerializeField] private Settings _settings;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Apply()
|
||||
{
|
||||
if (Player.Instance != null)
|
||||
Player.Instance.Launcher.AddAmmo(_settings.Amount);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3831749972a75dc4dbe47f8a551785fc
|
||||
26
Assets/_Content/Scripts/Combat/DamageInfo.cs
Normal file
26
Assets/_Content/Scripts/Combat/DamageInfo.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Arena.Combat
|
||||
{
|
||||
/// <summary>
|
||||
/// Everything a hit carries: amount, type and source. Passed to IDamageable.TakeDamage.
|
||||
/// </summary>
|
||||
public readonly struct DamageInfo
|
||||
{
|
||||
public readonly int Amount;
|
||||
|
||||
public readonly DamageType Type;
|
||||
|
||||
/// <summary>
|
||||
/// Object that dealt the damage: shooter, damage zone... Can be null.
|
||||
/// </summary>
|
||||
public readonly GameObject Source;
|
||||
|
||||
public DamageInfo(int amount, DamageType type, GameObject source = null)
|
||||
{
|
||||
Amount = amount;
|
||||
Type = type;
|
||||
Source = source;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/_Content/Scripts/Combat/DamageInfo.cs.meta
Normal file
2
Assets/_Content/Scripts/Combat/DamageInfo.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2876a0af3a1b47e4dbd254a5fdb33f9f
|
||||
12
Assets/_Content/Scripts/Combat/DamageType.cs
Normal file
12
Assets/_Content/Scripts/Combat/DamageType.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace Arena.Combat
|
||||
{
|
||||
/// <summary>
|
||||
/// Nature of a damage, carried by a DamageInfo.
|
||||
/// </summary>
|
||||
public enum DamageType
|
||||
{
|
||||
Physical,
|
||||
Energy,
|
||||
Digital
|
||||
}
|
||||
}
|
||||
2
Assets/_Content/Scripts/Combat/DamageType.cs.meta
Normal file
2
Assets/_Content/Scripts/Combat/DamageType.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f2a3b56adabf304a994febc81bd5489
|
||||
171
Assets/_Content/Scripts/Combat/DamageZone.cs
Normal file
171
Assets/_Content/Scripts/Combat/DamageZone.cs
Normal file
@@ -0,0 +1,171 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Arena.Combat
|
||||
{
|
||||
/// <summary>
|
||||
/// Sphere that damages every IDamageable inside it, less and less towards its edge.
|
||||
/// Continuous: hits every tick while a target stays inside (contact damage, toxic area).
|
||||
/// Instant: hits everything in the radius once, when Explode is called (explosion).
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(SphereCollider), typeof(Rigidbody))]
|
||||
public class DamageZone : MonoBehaviour
|
||||
{
|
||||
public enum Mode
|
||||
{
|
||||
Continuous,
|
||||
Instant
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
private class Settings
|
||||
{
|
||||
[Tooltip("Continuous: damage every tick while a target stays inside. Instant: one hit on everything in the radius, when Explode is called.")]
|
||||
public Mode Mode;
|
||||
|
||||
[Tooltip("Damage at the center of the sphere.")]
|
||||
[Min(0)] public int Damage = 10;
|
||||
|
||||
public DamageType DamageType;
|
||||
|
||||
[Tooltip("Damage multiplier by distance to the center. 0: center, 1: edge of the sphere.")]
|
||||
public AnimationCurve Falloff = AnimationCurve.Linear(0f, 1f, 1f, 0f);
|
||||
|
||||
[Tooltip("Continuous mode: time between two hits on the same target, in seconds.")]
|
||||
[Min(0.05f)] public float TickInterval = 0.5f;
|
||||
|
||||
[Tooltip("Instant mode: explode as soon as the object is enabled, for an explosion prefab.")]
|
||||
public bool ExplodeOnEnable = true;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
private struct References
|
||||
{
|
||||
public SphereCollider Zone;
|
||||
|
||||
[Tooltip("Never hurt by the zone and given as damage source, usually the object that carries it.")]
|
||||
public GameObject Owner;
|
||||
}
|
||||
|
||||
#region FIELDS
|
||||
|
||||
[SerializeField] private Settings _settings;
|
||||
[SerializeField] private References _references;
|
||||
|
||||
private readonly Dictionary<IDamageable, float> _nextHitTimes = new Dictionary<IDamageable, float>();
|
||||
private readonly HashSet<IDamageable> _explosionTargets = new HashSet<IDamageable>();
|
||||
|
||||
#endregion
|
||||
|
||||
#region UNITY LIFECYCLES
|
||||
|
||||
void Reset()
|
||||
{
|
||||
// Called when the component is added: a trigger sphere that physics can detect
|
||||
_references.Zone = GetComponent<SphereCollider>();
|
||||
_references.Zone.isTrigger = true;
|
||||
GetComponent<Rigidbody>().isKinematic = true;
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (_settings.Mode == Mode.Instant && _settings.ExplodeOnEnable)
|
||||
Explode();
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
_nextHitTimes.Clear();
|
||||
}
|
||||
|
||||
void OnTriggerStay(Collider other)
|
||||
{
|
||||
if (_settings.Mode != Mode.Continuous || !TryGetTarget(other, out IDamageable target))
|
||||
return;
|
||||
|
||||
if (_nextHitTimes.TryGetValue(target, out float nextHitTime) && Time.time < nextHitTime)
|
||||
return;
|
||||
|
||||
_nextHitTimes[target] = Time.time + _settings.TickInterval;
|
||||
Hit(target, other.transform.position);
|
||||
}
|
||||
|
||||
void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (TryGetTarget(other, out IDamageable target))
|
||||
_nextHitTimes.Remove(target);
|
||||
}
|
||||
|
||||
void OnDrawGizmosSelected()
|
||||
{
|
||||
if (!_references.Zone)
|
||||
return;
|
||||
|
||||
Gizmos.color = new Color(1f, 0.45f, 0.35f, 0.8f);
|
||||
Gizmos.DrawWireSphere(GetCenter(), GetRadius());
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
/// <summary>
|
||||
/// Hits once every IDamageable in the radius. Can be linked to a UnityEvent.
|
||||
/// </summary>
|
||||
public void Explode()
|
||||
{
|
||||
_explosionTargets.Clear();
|
||||
Collider[] colliders = Physics.OverlapSphere(GetCenter(), GetRadius(), ~0, QueryTriggerInteraction.Ignore);
|
||||
|
||||
foreach (Collider other in colliders)
|
||||
{
|
||||
// A target with several colliders is hit only once
|
||||
if (TryGetTarget(other, out IDamageable target) && _explosionTargets.Add(target))
|
||||
Hit(target, other.transform.position);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region PRIVATE METHODS
|
||||
|
||||
private bool TryGetTarget(Collider other, out IDamageable target)
|
||||
{
|
||||
target = other.GetComponentInParent<IDamageable>();
|
||||
|
||||
if (target == null)
|
||||
return false;
|
||||
|
||||
// The owner never hurts itself
|
||||
return !_references.Owner || ((Component)target).gameObject != _references.Owner;
|
||||
}
|
||||
|
||||
private void Hit(IDamageable target, Vector3 targetPosition)
|
||||
{
|
||||
float distance = Vector3.Distance(GetCenter(), targetPosition);
|
||||
float falloff = _settings.Falloff.Evaluate(Mathf.Clamp01(distance / GetRadius()));
|
||||
int amount = Mathf.RoundToInt(_settings.Damage * falloff);
|
||||
|
||||
if (amount <= 0)
|
||||
return;
|
||||
|
||||
GameObject source = _references.Owner ? _references.Owner : gameObject;
|
||||
target.TakeDamage(new DamageInfo(amount, _settings.DamageType, source));
|
||||
}
|
||||
|
||||
private Vector3 GetCenter()
|
||||
{
|
||||
return transform.TransformPoint(_references.Zone.center);
|
||||
}
|
||||
|
||||
private float GetRadius()
|
||||
{
|
||||
// The sphere radius follows the largest scale axis
|
||||
Vector3 scale = transform.lossyScale;
|
||||
float maxScale = Mathf.Max(Mathf.Abs(scale.x), Mathf.Abs(scale.y), Mathf.Abs(scale.z));
|
||||
return Mathf.Max(_references.Zone.radius * maxScale, 0.01f);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
2
Assets/_Content/Scripts/Combat/DamageZone.cs.meta
Normal file
2
Assets/_Content/Scripts/Combat/DamageZone.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 86310e0cb69dcf54cb7343a4e704cb12
|
||||
79
Assets/_Content/Scripts/Combat/Destructible.cs
Normal file
79
Assets/_Content/Scripts/Combat/Destructible.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Arena.Combat
|
||||
{
|
||||
/// <summary>
|
||||
/// Object destroyed when its health points reach zero: crate, barrel, turret...
|
||||
/// Raises OnDestroyed, spawns an optional prefab (debris, explosion with an instant DamageZone), then disappears.
|
||||
/// </summary>
|
||||
public class Destructible : MonoBehaviour, IDamageable
|
||||
{
|
||||
[System.Serializable]
|
||||
private class Settings
|
||||
{
|
||||
[Tooltip("Optional prefab spawned in place of the object: debris, explosion...")]
|
||||
public GameObject SpawnOnDestroyed;
|
||||
}
|
||||
|
||||
#region FIELDS
|
||||
|
||||
[SerializeField] private Settings _settings;
|
||||
[SerializeField] private Health _health;
|
||||
|
||||
/// <summary>
|
||||
/// Raised once, when the object is destroyed by damage.
|
||||
/// </summary>
|
||||
public event Action<Destructible> OnDestroyed;
|
||||
|
||||
public Health Health => _health;
|
||||
|
||||
#endregion
|
||||
|
||||
#region UNITY LIFECYCLES
|
||||
|
||||
void Awake()
|
||||
{
|
||||
_health.Initialize();
|
||||
_health.OnDied += HandleDied;
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
_health.OnDied -= HandleDied;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public void TakeDamage(DamageInfo damage)
|
||||
{
|
||||
_health.TakeDamage(damage);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region PRIVATE METHODS
|
||||
|
||||
private void HandleDied()
|
||||
{
|
||||
OnDestroyed?.Invoke(this);
|
||||
|
||||
if (_settings.SpawnOnDestroyed)
|
||||
Instantiate(_settings.SpawnOnDestroyed, transform.position, transform.rotation);
|
||||
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[ContextMenu("Debug/Take 25 Physical Damage")]
|
||||
private void DebugTakeDamage()
|
||||
{
|
||||
TakeDamage(new DamageInfo(25, DamageType.Physical, gameObject));
|
||||
}
|
||||
#endif
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
2
Assets/_Content/Scripts/Combat/Destructible.cs.meta
Normal file
2
Assets/_Content/Scripts/Combat/Destructible.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a59b2dd5620afef449293e11a903ae07
|
||||
@@ -1,34 +0,0 @@
|
||||
using UnityEngine;
|
||||
using Arena.Characters;
|
||||
|
||||
namespace Arena.Interactions
|
||||
{
|
||||
/// <summary>
|
||||
/// Heals the player. Apply is meant to be linked to a PlayerEvent.
|
||||
/// </summary>
|
||||
public class HealEffect : MonoBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
public class Settings
|
||||
{
|
||||
[Tooltip("Hit points given to the player.")]
|
||||
[Min(1)] public int Amount = 25;
|
||||
}
|
||||
|
||||
#region Fields
|
||||
|
||||
[SerializeField] private Settings _settings;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Apply()
|
||||
{
|
||||
if (Player.Instance != null)
|
||||
Player.Instance.Health.Heal(_settings.Amount);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b9353836241da04e9bb64cc87f89745
|
||||
@@ -3,81 +3,85 @@ using UnityEngine;
|
||||
|
||||
namespace Arena.Combat
|
||||
{
|
||||
/// <summary>
|
||||
/// Hit points of an entity. Serialized inside the component that owns it (Player, Enemy),
|
||||
/// which calls Initialize in its Awake.
|
||||
/// </summary>
|
||||
[System.Serializable]
|
||||
public class Health
|
||||
{
|
||||
#region Fields
|
||||
/// <summary>
|
||||
/// Health points of an entity. Serialized inside the component that owns it (Player, Destructible),
|
||||
/// which calls Initialize in its Awake.
|
||||
/// </summary>
|
||||
[System.Serializable]
|
||||
public class Health
|
||||
{
|
||||
#region FIELDS
|
||||
|
||||
[Tooltip("Hit points when full.")]
|
||||
[Min(1)] public int Max = 100;
|
||||
[Tooltip("Health points when full.")]
|
||||
[Min(1)] public int Max = 100;
|
||||
|
||||
[Tooltip("Current hit points, visible for debugging.")]
|
||||
[SerializeField] private int _current;
|
||||
[Tooltip("Current health points, visible for debugging.")]
|
||||
[SerializeField] private int _current;
|
||||
|
||||
/// <summary>
|
||||
/// Raised with the current and max hit points each time they change.
|
||||
/// </summary>
|
||||
public event Action<int, int> OnChange;
|
||||
/// <summary>
|
||||
/// Raised with the current and max health points each time they change.
|
||||
/// </summary>
|
||||
public event Action<int, int> OnChange;
|
||||
|
||||
/// <summary>
|
||||
/// Raised once, when the hit points reach zero.
|
||||
/// </summary>
|
||||
public event Action OnDied;
|
||||
/// <summary>
|
||||
/// Raised once, when the health points reach zero.
|
||||
/// </summary>
|
||||
public event Action OnDied;
|
||||
|
||||
public int Current => _current;
|
||||
public bool IsDead => _current <= 0;
|
||||
public int Current => _current;
|
||||
public bool IsDead => _current <= 0;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
#region PUBLIC METHODS
|
||||
|
||||
/// <summary>
|
||||
/// Fills the hit points. Called by the owner in its Awake.
|
||||
/// </summary>
|
||||
public void Initialize()
|
||||
{
|
||||
SetCurrent(Max);
|
||||
}
|
||||
/// <summary>
|
||||
/// Fills the health points. Called by the owner in its Awake.
|
||||
/// </summary>
|
||||
public void Initialize()
|
||||
{
|
||||
SetCurrent(Max);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes hit points and raises OnDied the first time they reach zero.
|
||||
/// </summary>
|
||||
public void TakeDamage(int amount)
|
||||
{
|
||||
if (IsDead || amount <= 0)
|
||||
return;
|
||||
/// <summary>
|
||||
/// Removes health points and raises OnDied the first time they reach zero.
|
||||
/// Returns the health points actually removed.
|
||||
/// </summary>
|
||||
public int TakeDamage(DamageInfo damage)
|
||||
{
|
||||
if (IsDead || damage.Amount <= 0)
|
||||
return 0;
|
||||
|
||||
SetCurrent(_current - amount);
|
||||
int previous = _current;
|
||||
SetCurrent(_current - damage.Amount);
|
||||
|
||||
if (IsDead)
|
||||
OnDied?.Invoke();
|
||||
}
|
||||
if (IsDead)
|
||||
OnDied?.Invoke();
|
||||
|
||||
/// <summary>
|
||||
/// Gives hit points back without exceeding Max. Has no effect once dead.
|
||||
/// </summary>
|
||||
public void Heal(int amount)
|
||||
{
|
||||
if (IsDead || amount <= 0)
|
||||
return;
|
||||
return previous - _current;
|
||||
}
|
||||
|
||||
SetCurrent(_current + amount);
|
||||
}
|
||||
/// <summary>
|
||||
/// Gives health points back without exceeding Max. Has no effect once dead.
|
||||
/// </summary>
|
||||
public void Heal(int amount)
|
||||
{
|
||||
if (IsDead || amount <= 0)
|
||||
return;
|
||||
|
||||
#endregion
|
||||
SetCurrent(_current + amount);
|
||||
}
|
||||
|
||||
#region Private Methods
|
||||
#endregion
|
||||
|
||||
private void SetCurrent(int value)
|
||||
{
|
||||
_current = Mathf.Clamp(value, 0, Max);
|
||||
OnChange?.Invoke(_current, Max);
|
||||
}
|
||||
#region PRIVATE METHODS
|
||||
|
||||
#endregion
|
||||
}
|
||||
private void SetCurrent(int value)
|
||||
{
|
||||
_current = Mathf.Clamp(value, 0, Max);
|
||||
OnChange?.Invoke(_current, Max);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace Arena.Combat
|
||||
{
|
||||
/// <summary>
|
||||
/// Anything that can receive damage: player, enemy, destructible object.
|
||||
/// </summary>
|
||||
public interface IDamageable
|
||||
{
|
||||
void TakeDamage(int amount);
|
||||
}
|
||||
/// <summary>
|
||||
/// Anything that can receive damage: player, destructible object.
|
||||
/// </summary>
|
||||
public interface IDamageable
|
||||
{
|
||||
void TakeDamage(DamageInfo damage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,67 +2,64 @@ using UnityEngine;
|
||||
|
||||
namespace Arena.Combat
|
||||
{
|
||||
/// <summary>
|
||||
/// Moves straight ahead and damages the first IDamageable it touches.
|
||||
/// Needs a trigger collider and a kinematic Rigidbody.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(Rigidbody))]
|
||||
public class Projectile : MonoBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
public class Settings
|
||||
{
|
||||
[Tooltip("Speed, in meters per second.")]
|
||||
[Min(0f)] public float Speed = 20f;
|
||||
/// <summary>
|
||||
/// Moves straight ahead and damages the first IDamageable it touches.
|
||||
/// Needs a trigger collider and a kinematic Rigidbody.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(Rigidbody))]
|
||||
public class Projectile : MonoBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
public class Settings
|
||||
{
|
||||
[Tooltip("Speed, in meters per second.")]
|
||||
[Min(0f)] public float Speed = 20f;
|
||||
|
||||
[Tooltip("Time before an unused projectile is destroyed, in seconds.")]
|
||||
[Min(0.1f)] public float Lifetime = 2f;
|
||||
}
|
||||
[Tooltip("Time before an unused projectile is destroyed, in seconds.")]
|
||||
[Min(0.1f)] public float Lifetime = 2f;
|
||||
}
|
||||
|
||||
#region Fields
|
||||
#region FIELDS
|
||||
|
||||
[SerializeField] private Settings _settings;
|
||||
[SerializeField] private Settings _settings;
|
||||
|
||||
private int _damage;
|
||||
private GameObject _owner;
|
||||
private DamageInfo _damage;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Unity Lifecycle
|
||||
#region UNITY LIFECYCLES
|
||||
|
||||
private void Update()
|
||||
{
|
||||
transform.position += transform.forward * _settings.Speed * Time.deltaTime;
|
||||
}
|
||||
private void Update()
|
||||
{
|
||||
transform.position += transform.forward * _settings.Speed * Time.deltaTime;
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
// Ignore the shooter and the other trigger zones
|
||||
if (other.isTrigger || other.gameObject == _owner)
|
||||
return;
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
// Ignore the shooter and the other trigger zones
|
||||
if (other.isTrigger || other.gameObject == _damage.Source)
|
||||
return;
|
||||
|
||||
if (other.TryGetComponent(out IDamageable target))
|
||||
target.TakeDamage(_damage);
|
||||
if (other.TryGetComponent(out IDamageable target))
|
||||
target.TakeDamage(_damage);
|
||||
|
||||
Destroy(gameObject);
|
||||
}
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
#region PUBLIC METHODS
|
||||
|
||||
/// <summary>
|
||||
/// Starts the projectile. Called right after Instantiate by whoever fires it.
|
||||
/// </summary>
|
||||
/// <param name="damage">Damage dealt to the IDamageable it touches.</param>
|
||||
/// <param name="owner">Shooter, ignored by the projectile.</param>
|
||||
public void Launch(int damage, GameObject owner)
|
||||
{
|
||||
_damage = damage;
|
||||
_owner = owner;
|
||||
Destroy(gameObject, _settings.Lifetime);
|
||||
}
|
||||
/// <summary>
|
||||
/// Starts the projectile. Called right after Instantiate by whoever fires it.
|
||||
/// </summary>
|
||||
/// <param name="damage">Damage dealt to the IDamageable it touches. Its source is the shooter, ignored by the projectile.</param>
|
||||
public void Launch(DamageInfo damage)
|
||||
{
|
||||
_damage = damage;
|
||||
Destroy(gameObject, _settings.Lifetime);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,105 +3,106 @@ using UnityEngine;
|
||||
|
||||
namespace Arena.Combat
|
||||
{
|
||||
/// <summary>
|
||||
/// Fires projectiles from a muzzle, limited by the fire interval and the ammo count.
|
||||
/// Placed on the root of the shooter, which the projectiles ignore.
|
||||
/// </summary>
|
||||
public class ProjectileLauncher : MonoBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
public class Settings
|
||||
{
|
||||
[Tooltip("Weapon data: damage, fire interval, ammo, projectile.")]
|
||||
public WeaponData Weapon;
|
||||
}
|
||||
/// <summary>
|
||||
/// Fires projectiles from a muzzle, limited by the fire interval and the ammo count.
|
||||
/// Placed on the root of the shooter, which the projectiles ignore.
|
||||
/// </summary>
|
||||
public class ProjectileLauncher : MonoBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
public class Settings
|
||||
{
|
||||
[Tooltip("Weapon data: damage, fire interval, ammo, projectile.")]
|
||||
public WeaponData Weapon;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public struct References
|
||||
{
|
||||
[Tooltip("Spawn point of the projectiles. Its forward axis gives the direction.")]
|
||||
public Transform Muzzle;
|
||||
}
|
||||
[System.Serializable]
|
||||
public struct References
|
||||
{
|
||||
[Tooltip("Spawn point of the projectiles. Its forward axis gives the direction.")]
|
||||
public Transform Muzzle;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class StateContainer
|
||||
{
|
||||
public int Ammo;
|
||||
}
|
||||
[System.Serializable]
|
||||
public class StateContainer
|
||||
{
|
||||
public int Ammo;
|
||||
}
|
||||
|
||||
#region Fields
|
||||
#region FIELDS
|
||||
|
||||
[SerializeField] private Settings _settings;
|
||||
[SerializeField] private References _references;
|
||||
[SerializeField] private StateContainer _state;
|
||||
[SerializeField] private Settings _settings;
|
||||
[SerializeField] private References _references;
|
||||
[SerializeField] private StateContainer _state;
|
||||
|
||||
/// <summary>
|
||||
/// Raised with the current and max ammo each time the ammo changes.
|
||||
/// </summary>
|
||||
public event Action<int, int> OnAmmoChange;
|
||||
/// <summary>
|
||||
/// Raised with the current and max ammo each time the ammo changes.
|
||||
/// </summary>
|
||||
public event Action<int, int> OnAmmoChange;
|
||||
|
||||
public StateContainer State => _state;
|
||||
public int MaxAmmo => _settings.Weapon.MaxAmmo;
|
||||
public StateContainer State => _state;
|
||||
public int MaxAmmo => _settings.Weapon.MaxAmmo;
|
||||
|
||||
private float _nextFireTime;
|
||||
private float _nextFireTime;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Unity Lifecycle
|
||||
#region UNITY LIFECYCLES
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_state.Ammo = MaxAmmo;
|
||||
}
|
||||
private void Awake()
|
||||
{
|
||||
_state.Ammo = MaxAmmo;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
#region PUBLIC METHODS
|
||||
|
||||
/// <summary>
|
||||
/// Fires one projectile if the weapon is ready and has ammo. Returns true if a shot was fired.
|
||||
/// </summary>
|
||||
public bool TryFire()
|
||||
{
|
||||
if (Time.time < _nextFireTime || _state.Ammo <= 0)
|
||||
return false;
|
||||
/// <summary>
|
||||
/// Fires one projectile if the weapon is ready and has ammo. Returns true if a shot was fired.
|
||||
/// </summary>
|
||||
public bool TryFire()
|
||||
{
|
||||
if (Time.time < _nextFireTime || _state.Ammo <= 0)
|
||||
return false;
|
||||
|
||||
_nextFireTime = Time.time + _settings.Weapon.FireInterval;
|
||||
SetAmmo(_state.Ammo - 1);
|
||||
_nextFireTime = Time.time + _settings.Weapon.FireInterval;
|
||||
|
||||
Transform muzzle = _references.Muzzle;
|
||||
Projectile projectile = Instantiate(_settings.Weapon.ProjectilePrefab, muzzle.position, muzzle.rotation);
|
||||
projectile.Launch(_settings.Weapon.Damage, gameObject);
|
||||
return true;
|
||||
}
|
||||
SetAmmo(_state.Ammo - 1);
|
||||
|
||||
/// <summary>
|
||||
/// Adds ammo without exceeding the weapon maximum.
|
||||
/// </summary>
|
||||
public void AddAmmo(int amount)
|
||||
{
|
||||
if (amount <= 0)
|
||||
return;
|
||||
Transform muzzle = _references.Muzzle;
|
||||
Projectile projectile = Instantiate(_settings.Weapon.ProjectilePrefab, muzzle.position, muzzle.rotation);
|
||||
projectile.Launch(new DamageInfo(_settings.Weapon.Damage, _settings.Weapon.DamageType, gameObject));
|
||||
return true;
|
||||
}
|
||||
|
||||
SetAmmo(Mathf.Min(_state.Ammo + amount, MaxAmmo));
|
||||
}
|
||||
/// <summary>
|
||||
/// Adds ammo without exceeding the weapon maximum.
|
||||
/// </summary>
|
||||
public void AddAmmo(int amount)
|
||||
{
|
||||
if (amount <= 0)
|
||||
return;
|
||||
|
||||
#endregion
|
||||
SetAmmo(Mathf.Min(_state.Ammo + amount, MaxAmmo));
|
||||
}
|
||||
|
||||
#region Private Methods
|
||||
#endregion
|
||||
|
||||
private void SetAmmo(int value)
|
||||
{
|
||||
_state.Ammo = value;
|
||||
OnAmmoChange?.Invoke(_state.Ammo, MaxAmmo);
|
||||
}
|
||||
#region PRIVATE METHODS
|
||||
|
||||
[ContextMenu("Debug/Try Fire")]
|
||||
private void DebugTryFire()
|
||||
{
|
||||
TryFire();
|
||||
}
|
||||
private void SetAmmo(int value)
|
||||
{
|
||||
_state.Ammo = value;
|
||||
OnAmmoChange?.Invoke(_state.Ammo, MaxAmmo);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
[ContextMenu("Debug/Try Fire")]
|
||||
private void DebugTryFire()
|
||||
{
|
||||
TryFire();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
using UnityEngine;
|
||||
using Arena.Characters;
|
||||
|
||||
namespace Arena.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// Single entry point of the UI: connects the views to the player and switches screens.
|
||||
/// </summary>
|
||||
public class UiManager : MonoBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
public struct References
|
||||
{
|
||||
[Tooltip("In-game screen: health, ammo.")]
|
||||
public GameObject Hud;
|
||||
public HealthView HealthView;
|
||||
public AmmoView AmmoView;
|
||||
public GameOverView GameOverView;
|
||||
}
|
||||
|
||||
#region Fields
|
||||
|
||||
[SerializeField] private References _references;
|
||||
|
||||
private Player _player;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Unity Lifecycle
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// Start: every Awake has run, so Player.Instance is set
|
||||
_player = Player.Instance;
|
||||
|
||||
if (_player == null)
|
||||
{
|
||||
Debug.LogError("UiManager: no Player in the scene.");
|
||||
return;
|
||||
}
|
||||
|
||||
_references.HealthView.Bind(_player.Health);
|
||||
_references.AmmoView.Bind(_player.Launcher);
|
||||
_player.Health.OnDied += HandlePlayerDied;
|
||||
|
||||
_references.Hud.SetActive(true);
|
||||
_references.GameOverView.Hide();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (_player != null)
|
||||
_player.Health.OnDied -= HandlePlayerDied;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void HandlePlayerDied()
|
||||
{
|
||||
_references.Hud.SetActive(false);
|
||||
_references.GameOverView.Show();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c6cb5ac8e4f8d0479afda241378ff0b
|
||||
@@ -2,31 +2,35 @@ using UnityEngine;
|
||||
|
||||
namespace Arena.Combat
|
||||
{
|
||||
/// <summary>
|
||||
/// Settings of a weapon, shared by every launcher that uses it.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "WeaponData_new", menuName = "Arena/Combat/Weapon Data")]
|
||||
public class WeaponData : ScriptableObject
|
||||
{
|
||||
#region Fields
|
||||
/// <summary>
|
||||
/// Settings of a weapon, shared by every launcher that uses it.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "WeaponData_new", menuName = "Arena/Combat/Weapon Data")]
|
||||
public class WeaponData : ScriptableObject
|
||||
{
|
||||
#region FIELDS
|
||||
|
||||
[Tooltip("Damage dealt by one projectile.")]
|
||||
[SerializeField, Min(0)] private int _damage = 10;
|
||||
[Tooltip("Damage dealt by one projectile.")]
|
||||
[SerializeField, Min(0)] private int _damage = 10;
|
||||
|
||||
[Tooltip("Time between two shots, in seconds.")]
|
||||
[SerializeField, Min(0.05f)] private float _fireInterval = 0.2f;
|
||||
[Tooltip("Type of the damage dealt by the projectiles.")]
|
||||
[SerializeField] private DamageType _damageType;
|
||||
|
||||
[Tooltip("Ammo when the weapon is full.")]
|
||||
[SerializeField, Min(1)] private int _maxAmmo = 30;
|
||||
[Tooltip("Time between two shots, in seconds.")]
|
||||
[SerializeField, Min(0.05f)] private float _fireInterval = 0.2f;
|
||||
|
||||
[Tooltip("Prefab fired by the weapon.")]
|
||||
[SerializeField] private Projectile _projectilePrefab;
|
||||
[Tooltip("Ammo when the weapon is full.")]
|
||||
[SerializeField, Min(1)] private int _maxAmmo = 30;
|
||||
|
||||
public int Damage => _damage;
|
||||
public float FireInterval => _fireInterval;
|
||||
public int MaxAmmo => _maxAmmo;
|
||||
public Projectile ProjectilePrefab => _projectilePrefab;
|
||||
[Tooltip("Prefab fired by the weapon.")]
|
||||
[SerializeField] private Projectile _projectilePrefab;
|
||||
|
||||
#endregion
|
||||
}
|
||||
public int Damage => _damage;
|
||||
public DamageType DamageType => _damageType;
|
||||
public float FireInterval => _fireInterval;
|
||||
public int MaxAmmo => _maxAmmo;
|
||||
public Projectile ProjectilePrefab => _projectilePrefab;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
8
Assets/_Content/Scripts/Interactions.meta
Normal file
8
Assets/_Content/Scripts/Interactions.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6f92dd718d963b04f81884b191f8d1ef
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
34
Assets/_Content/Scripts/Interactions/AmmoEffect.cs
Normal file
34
Assets/_Content/Scripts/Interactions/AmmoEffect.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
using Arena.Characters;
|
||||
|
||||
namespace Arena.Interactions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gives ammo to the player. Apply is meant to be linked to a PlayerEvent.
|
||||
/// </summary>
|
||||
public class AmmoEffect : MonoBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
public class Settings
|
||||
{
|
||||
[Tooltip("Ammo given to the player.")]
|
||||
[Min(1)] public int Amount = 10;
|
||||
}
|
||||
|
||||
#region FIELDS
|
||||
|
||||
[SerializeField] private Settings _settings;
|
||||
|
||||
#endregion
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public void Apply()
|
||||
{
|
||||
if (Player.Instance != null)
|
||||
Player.Instance.Launcher.AddAmmo(_settings.Amount);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
2
Assets/_Content/Scripts/Interactions/AmmoEffect.cs.meta
Normal file
2
Assets/_Content/Scripts/Interactions/AmmoEffect.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6739c594c812f4a4a84f51156853fc45
|
||||
34
Assets/_Content/Scripts/Interactions/HealEffect.cs
Normal file
34
Assets/_Content/Scripts/Interactions/HealEffect.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
using Arena.Characters;
|
||||
|
||||
namespace Arena.Interactions
|
||||
{
|
||||
/// <summary>
|
||||
/// Heals the player. Apply is meant to be linked to a PlayerEvent.
|
||||
/// </summary>
|
||||
public class HealEffect : MonoBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
public class Settings
|
||||
{
|
||||
[Tooltip("Health points given to the player.")]
|
||||
[Min(1)] public int Amount = 25;
|
||||
}
|
||||
|
||||
#region FIELDS
|
||||
|
||||
[SerializeField] private Settings _settings;
|
||||
|
||||
#endregion
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public void Apply()
|
||||
{
|
||||
if (Player.Instance != null)
|
||||
Player.Instance.Health.Heal(_settings.Amount);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
2
Assets/_Content/Scripts/Interactions/HealEffect.cs.meta
Normal file
2
Assets/_Content/Scripts/Interactions/HealEffect.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f7b07697ca242a4cbfd52a7158769ef
|
||||
90
Assets/_Content/Scripts/Interactions/PlayerEvent.cs
Normal file
90
Assets/_Content/Scripts/Interactions/PlayerEvent.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using Arena.Characters;
|
||||
|
||||
namespace Arena.Interactions
|
||||
{
|
||||
public class PlayerEvent : MonoBehaviour
|
||||
{
|
||||
public enum Trigger
|
||||
{
|
||||
OnPlayerEnter,
|
||||
OnPlayerInteract
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class Settings
|
||||
{
|
||||
[Tooltip("OnPlayerEnter: as soon as the player enters. OnPlayerInteract: when the player interacts inside the zone.")]
|
||||
public Trigger Trigger;
|
||||
}
|
||||
|
||||
[SerializeField] private Settings _settings;
|
||||
[SerializeField] private UnityEvent _onPlayer;
|
||||
|
||||
private bool _isListening;
|
||||
|
||||
#region UNITY LIFECYCLES
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
// The object can be hidden while the player is inside
|
||||
StopListening();
|
||||
}
|
||||
|
||||
void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (!IsPlayer(other))
|
||||
return;
|
||||
|
||||
if (_settings.Trigger == Trigger.OnPlayerEnter)
|
||||
_onPlayer.Invoke();
|
||||
else
|
||||
StartListening();
|
||||
}
|
||||
|
||||
void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (IsPlayer(other))
|
||||
StopListening();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private bool IsPlayer(Collider other)
|
||||
{
|
||||
return Player.Instance != null && other.gameObject == Player.Instance.gameObject;
|
||||
}
|
||||
|
||||
private void StartListening()
|
||||
{
|
||||
Player.Instance.OnInteract += HandleInteract;
|
||||
_isListening = true;
|
||||
}
|
||||
|
||||
private void StopListening()
|
||||
{
|
||||
if (!_isListening)
|
||||
return;
|
||||
|
||||
if (Player.Instance != null)
|
||||
Player.Instance.OnInteract -= HandleInteract;
|
||||
|
||||
_isListening = false;
|
||||
}
|
||||
|
||||
private void HandleInteract()
|
||||
{
|
||||
_onPlayer.Invoke();
|
||||
}
|
||||
|
||||
public void Teleport(Transform target)
|
||||
{
|
||||
if (!Player.Instance)
|
||||
return;
|
||||
|
||||
StopListening();
|
||||
Player.Instance.Teleport(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/_Content/Scripts/Interactions/PlayerEvent.cs.meta
Normal file
2
Assets/_Content/Scripts/Interactions/PlayerEvent.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7bed1a9cab72cda46bb8e8dd2d8c60a3
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user