Add the players models and animations blending

This commit is contained in:
Patrice Vignola 2016-01-30 12:35:04 -05:00
parent dbf913a02f
commit 2f3eca693c
8 changed files with 3925 additions and 300 deletions

View File

@ -13,7 +13,10 @@ MonoBehaviour:
m_EditorClassIdentifier:
Contexts:
- name: Normal
ButtonActions: []
ButtonActions:
- name: Dash
XboxButtons: 02000000
KeyboardKeys:
AxisRanges:
- name: MoveLeft
Axis: 00000000
@ -28,3 +31,7 @@ MonoBehaviour:
Axis: 03000000
KeyboardKeys:
ButtonStates: []
- name: Dashing
ButtonActions: []
AxisRanges: []
ButtonStates: []

View File

@ -13,25 +13,31 @@ AnimatorController:
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: Turn
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: Run
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: Jump
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: Dash
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
@ -145,30 +151,6 @@ AnimatorStateTransition:
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &110131827
AnimatorStateTransition:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 4
m_ConditionEvent: Walk
m_EventTreshold: .100000001
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 110233808}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: .466804981
m_TransitionOffset: 0
m_ExitTime: .899999976
m_HasExitTime: 0
m_HasFixedDuration: 0
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &110152758
AnimatorStateTransition:
m_ObjectHideFlags: 3
@ -221,18 +203,18 @@ AnimatorStateTransition:
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 3
m_ConditionEvent: Run
m_EventTreshold: .100000001
- m_ConditionMode: 1
m_ConditionEvent: Dash
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 110291569}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: .246981323
m_TransitionOffset: 0
m_ExitTime: .899999976
m_TransitionDuration: .579091549
m_TransitionOffset: .0121050328
m_ExitTime: .00589594105
m_HasExitTime: 0
m_HasFixedDuration: 0
m_InterruptionSource: 0
@ -259,27 +241,75 @@ AnimatorStateTransition:
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &110166621
--- !u!1101 &110164332
AnimatorStateTransition:
m_ObjectHideFlags: 3
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: Dash
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 110291569}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: .111634426
m_TransitionOffset: 0
m_ExitTime: 3.80561804e-09
m_HasExitTime: 0
m_HasFixedDuration: 0
m_InterruptionSource: 0
m_OrderedInterruption: 0
m_CanTransitionToSelf: 1
--- !u!1101 &110169686
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 4
m_ConditionEvent: Run
m_EventTreshold: .100000001
m_ConditionEvent: Walk
m_EventTreshold: .200000003
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 110200000}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: .25723207
m_TransitionOffset: 0
m_ExitTime: .521006107
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &110182386
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 3
m_ConditionEvent: Walk
m_EventTreshold: .200000003
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 110233808}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: .421348363
m_TransitionDuration: .25
m_TransitionOffset: 0
m_ExitTime: .899999976
m_HasExitTime: 0
m_HasFixedDuration: 0
m_ExitTime: .533195019
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
@ -317,6 +347,7 @@ AnimatorState:
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 110164332}
- {fileID: 110100000}
m_StateMachineBehaviours: []
m_Position: {x: 36, y: 156, z: 0}
@ -432,13 +463,13 @@ AnimatorState:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Running
m_Speed: 1
m_Name: Dashing
m_Speed: 1.20000005
m_CycleOffset: 0
m_Transitions:
- {fileID: 110166621}
- {fileID: 110131827}
- {fileID: 110152758}
- {fileID: 110169686}
- {fileID: 110182386}
m_StateMachineBehaviours: []
m_Position: {x: 36, y: -72, z: 0}
m_IKOnFeet: 1
@ -462,13 +493,13 @@ AnimatorStateMachine:
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 110200000}
m_Position: {x: 36, y: 156, z: 0}
m_Position: {x: 360, y: 156, z: 0}
- serializedVersion: 1
m_State: {fileID: 110291569}
m_Position: {x: 36, y: -72, z: 0}
- serializedVersion: 1
m_State: {fileID: 110233808}
m_Position: {x: 36, y: 48, z: 0}
m_Position: {x: 36, y: 36, z: 0}
- serializedVersion: 1
m_State: {fileID: 110205513}
m_Position: {x: 336, y: -72, z: 0}
@ -482,3 +513,21 @@ AnimatorStateMachine:
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 110200000}
--- !u!1107 &110701438
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: New Layer
m_ChildStates: []
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 0}

View File

@ -10,6 +10,7 @@ function Start () {
}
function Update () {
/*
v=Input.GetAxis("Vertical"+playerNumber);
h=Input.GetAxis("Horizontal"+playerNumber);
if (animator.GetFloat("Run")==0.2){
@ -17,22 +18,24 @@ function Update () {
animator.SetBool("Jump",true);
}
}
Sprinting();
Sprinting();*/
}
function FixedUpdate (){
/*
animator.SetFloat("Walk",v);
animator.SetFloat("Run",run);
animator.SetFloat("Turn",h);
animator.SetFloat("Turn",h);*/
}
function Sprinting(){
/*
if (Input.GetKey(KeyCode.LeftShift)){
run=0.2;
}
else
{
run=0.0;
}
}*/
}

File diff suppressed because it is too large Load Diff

View File

@ -85,47 +85,72 @@ NavMeshSettings:
cellSize: .166666672
manualCellSize: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &745232258
GameObject:
--- !u!1001 &215144255
Prefab:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 745232260}
- 114: {fileID: 745232259}
m_Layer: 0
m_Name: CharacterController
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &745232259
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalPosition.x
value: .666631162
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalPosition.y
value: .145443216
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 117118, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_Name
value: CharacterController (1)
objectReference: {fileID: 0}
- target: {fileID: 11495336, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: character
value:
objectReference: {fileID: 977341308}
- target: {fileID: 11495336, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: playerNumber
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
m_IsPrefabParent: 0
--- !u!114 &488783779 stripped
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 745232258}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8cb928dc47bb84343830c964dd63c454, type: 3}
m_Name:
m_EditorClassIdentifier:
character: {fileID: 1721247737}
playerNumber: 0
--- !u!4 &745232260
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 745232258}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: .666631162, y: .145443216, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_PrefabParentObject: {fileID: 11431374, guid: d9aa98efb3480c8438047a4565cd1893,
type: 2}
m_PrefabInternal: {fileID: 1229110618}
m_Script: {fileID: 11500000, guid: 0f36f7c8f7d8e03418efcbf2c3645cd8, type: 3}
--- !u!114 &977341308 stripped
MonoBehaviour:
m_PrefabParentObject: {fileID: 11431374, guid: d9aa98efb3480c8438047a4565cd1893,
type: 2}
m_PrefabInternal: {fileID: 1778514724}
m_Script: {fileID: 11500000, guid: 0f36f7c8f7d8e03418efcbf2c3645cd8, type: 3}
--- !u!1 &1008797114
GameObject:
m_ObjectHideFlags: 0
@ -211,7 +236,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_RootOrder: 2
--- !u!1 &1018231122
GameObject:
m_ObjectHideFlags: 0
@ -312,138 +337,263 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
--- !u!1 &1574512656
GameObject:
m_RootOrder: 6
--- !u!1001 &1229110618
Prefab:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1574512657}
- 33: {fileID: 1574512660}
- 65: {fileID: 1574512659}
- 23: {fileID: 1574512658}
m_Layer: 0
m_Name: Mesh
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1574512657
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1574512656}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: .529999971, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1721247739}
m_RootOrder: 0
--- !u!23 &1574512658
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1574512656}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 1
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_ImportantGI: 0
m_AutoUVMaxDistance: .5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!65 &1574512659
BoxCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1574512656}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &1574512660
MeshFilter:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalPosition.x
value: 5.17000008
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalPosition.y
value: .140000001
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_RootOrder
value: 9
objectReference: {fileID: 0}
- target: {fileID: 198936, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_Name
value: BlackBeard
objectReference: {fileID: 0}
- target: {fileID: 13757278, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 65f141b41fd397d4db600540cd8db42d, type: 2}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &1344668562
Prefab:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1574512656}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1721247736
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1721247739}
- 54: {fileID: 1721247738}
- 114: {fileID: 1721247737}
m_Layer: 0
m_Name: Character
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1721247737
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalPosition.x
value: .666631162
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalPosition.y
value: .145443216
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 117118, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_Name
value: CharacterController (2)
objectReference: {fileID: 0}
- target: {fileID: 11495336, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: character
value:
objectReference: {fileID: 488783779}
- target: {fileID: 11495336, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: playerNumber
value: 2
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
m_IsPrefabParent: 0
--- !u!114 &1454034002 stripped
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1721247736}
m_Enabled: 1
m_EditorHideFlags: 0
m_PrefabParentObject: {fileID: 11431374, guid: d9aa98efb3480c8438047a4565cd1893,
type: 2}
m_PrefabInternal: {fileID: 1682839029}
m_Script: {fileID: 11500000, guid: 0f36f7c8f7d8e03418efcbf2c3645cd8, type: 3}
m_Name:
m_EditorClassIdentifier:
MoveSpeed: 5
TurnSpeed: 0
--- !u!54 &1721247738
Rigidbody:
--- !u!1001 &1682839029
Prefab:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1721247736}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: .0500000007
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 80
m_CollisionDetection: 0
--- !u!4 &1721247739
Transform:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalPosition.y
value: .189999998
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_RootOrder
value: 8
objectReference: {fileID: 0}
- target: {fileID: 198936, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_Name
value: YellowBeard
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &1777326589
Prefab:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1721247736}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: .569999993, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1574512657}
m_Father: {fileID: 0}
m_RootOrder: 2
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalPosition.x
value: .666631162
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalPosition.y
value: .145443216
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 422570, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
- target: {fileID: 11495336, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
propertyPath: character
value:
objectReference: {fileID: 1454034002}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 0a3031db8d5701f47984a4267336a83f, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &1778514724
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalPosition.x
value: 2.9000001
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalPosition.y
value: .140000001
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 473846, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_RootOrder
value: 7
objectReference: {fileID: 0}
- target: {fileID: 198936, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_Name
value: RedBeard
objectReference: {fileID: 0}
- target: {fileID: 13757278, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 5bf9d6eaf690b0d48b78d8d20c7960e3, type: 2}
- target: {fileID: 5463890, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
propertyPath: m_IsKinematic
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: d9aa98efb3480c8438047a4565cd1893, type: 2}
m_IsPrefabParent: 0
--- !u!1 &2024085281
GameObject:
m_ObjectHideFlags: 0

View File

@ -1,15 +1,23 @@
using UnityEngine;
using System.Collections;
using System;
[RequireComponent(typeof(Rigidbody))]
public class Character : MonoBehaviour
{
public Animator animator;
public float MoveSpeed;
public float TurnSpeed;
public float DashForce;
public float DashCooldown;
private Rigidbody rb;
private Quaternion targetRot;
private float dashRemainingTime = 0f;
private bool isDashing = false;
void Awake()
{
rb = GetComponent<Rigidbody>();
@ -17,11 +25,21 @@ public class Character : MonoBehaviour
void Update()
{
rb.rotation = Quaternion.RotateTowards(rb.rotation, targetRot, TurnSpeed * Time.deltaTime);
if (dashRemainingTime > 0)
{
dashRemainingTime = Mathf.Clamp(dashRemainingTime - Time.deltaTime, 0f, DashCooldown);
}
if (!isDashing)
{
rb.rotation = Quaternion.RotateTowards(rb.rotation, targetRot, TurnSpeed * Time.deltaTime);
}
}
public void Move(float xValue, float zValue)
{
if (isDashing) return;
Vector3 forwardDir = Camera.main.transform.forward;
Vector3 rightDir = Camera.main.transform.right;
@ -42,5 +60,31 @@ public class Character : MonoBehaviour
newVelocity.y = rb.velocity.y;
rb.velocity = newVelocity;
animator.SetFloat("Walk", rb.velocity.magnitude);
}
public bool Dash()
{
if (dashRemainingTime > 0f) return false;
dashRemainingTime = DashCooldown;
StartCoroutine(DashCoroutine());
return true;
}
private IEnumerator DashCoroutine()
{
isDashing = true;
Vector3 fwd = GetComponent<Transform>().forward;
rb.velocity = Vector3.zero;
rb.AddForce(fwd * DashForce, ForceMode.Impulse);
animator.SetTrigger("Dash");
yield return new WaitForSeconds(0.9f);
isDashing = false;
}
}

View File

@ -9,12 +9,11 @@ public class CharacterController : MonoBehaviour
public Character character;
public PlayerNumber playerNumber;
// Use this for initialization
void Start ()
{
InputManager.Instance.PushActiveContext("Normal", (int)playerNumber);
InputManager.Instance.AddCallback((int)playerNumber, HandlePlayerButtons);
InputManager.Instance.AddCallback((int)playerNumber, HandlePlayerAxis);
InputManager.Instance.AddCallback((int)playerNumber, HandlePlayerButtons);
}
private void HandlePlayerAxis(MappedInput input)
@ -50,6 +49,9 @@ public class CharacterController : MonoBehaviour
{
if (character == null) return;
if (input.Actions.Contains("Dash"))
{
character.Dash();
}
}
}

View File

@ -3,18 +3,18 @@
--- !u!129 &1
PlayerSettings:
m_ObjectHideFlags: 0
serializedVersion: 8
serializedVersion: 7
AndroidProfiler: 0
defaultScreenOrientation: 4
targetDevice: 2
targetResolution: 0
useOnDemandResources: 0
accelerometerFrequency: 60
companyName: DefaultCompany
productName: GameJamProject
defaultCursor: {fileID: 0}
cursorHotspot: {x: 1.1467608e-13, y: 1.1467608e-13}
cursorHotspot: {x: 1.14676077e-13, y: 1.14676077e-13}
m_ShowUnitySplashScreen: 1
m_VirtualRealitySplashScreen: {fileID: 0}
defaultScreenWidth: 1024
defaultScreenHeight: 768
defaultScreenWidthWeb: 960
@ -56,19 +56,15 @@ PlayerSettings:
xboxEnableKinectAutoTracking: 0
xboxEnableFitness: 0
visibleInBackground: 0
allowFullscreenSwitch: 1
macFullscreenMode: 2
d3d9FullscreenMode: 1
d3d11FullscreenMode: 1
xboxSpeechDB: 0
xboxEnableHeadOrientation: 0
xboxEnableGuest: 0
xboxEnablePIXSampling: 0
n3dsDisableStereoscopicView: 0
n3dsEnableSharedListOpt: 1
n3dsEnableVSync: 0
uiUse16BitDepthBuffer: 0
ignoreAlphaClear: 0
xboxOneResolution: 0
ps3SplashScreen: {fileID: 0}
videoMemoryForVertexBuffers: 0
@ -119,7 +115,6 @@ PlayerSettings:
iPhoneTargetOSVersion: 22
uIPrerenderedIcon: 0
uIRequiresPersistentWiFi: 0
uIRequiresFullScreen: 1
uIStatusBarHidden: 1
uIExitOnSuspend: 0
uIStatusBarStyle: 0
@ -133,10 +128,6 @@ PlayerSettings:
iPadHighResPortraitSplashScreen: {fileID: 0}
iPadLandscapeSplashScreen: {fileID: 0}
iPadHighResLandscapeSplashScreen: {fileID: 0}
appleTVSplashScreen: {fileID: 0}
tvOSSmallIconLayers: []
tvOSLargeIconLayers: []
tvOSTopShelfImageLayers: []
iOSLaunchScreenType: 0
iOSLaunchScreenPortrait: {fileID: 0}
iOSLaunchScreenLandscape: {fileID: 0}
@ -264,12 +255,7 @@ PlayerSettings:
playerPrefsSupport: 0
ps4ReprojectionSupport: 0
ps4UseAudio3dBackend: 0
ps4SocialScreenEnabled: 0
ps4Audio3dVirtualSpeakerCount: 14
ps4attribCpuUsage: 0
ps4PatchPkgPath:
ps4PatchLatestPkgPath:
ps4PatchChangeinfoPath:
ps4attribUserManagement: 0
ps4attribMoveSupport: 0
ps4attrib3DSupport: 0
@ -326,6 +312,10 @@ PlayerSettings:
spritePackerPolicy:
scriptingDefineSymbols: {}
metroPackageName: GameJamProject
metroPackageLogo:
metroPackageLogo140:
metroPackageLogo180:
metroPackageLogo240:
metroPackageVersion:
metroCertificatePath:
metroCertificatePassword:
@ -333,7 +323,44 @@ PlayerSettings:
metroCertificateIssuer:
metroCertificateNotAfter: 0000000000000000
metroApplicationDescription: GameJamProject
wsaImages: {}
metroStoreTileLogo80:
metroStoreTileLogo:
metroStoreTileLogo140:
metroStoreTileLogo180:
metroStoreTileWideLogo80:
metroStoreTileWideLogo:
metroStoreTileWideLogo140:
metroStoreTileWideLogo180:
metroStoreTileSmallLogo80:
metroStoreTileSmallLogo:
metroStoreTileSmallLogo140:
metroStoreTileSmallLogo180:
metroStoreSmallTile80:
metroStoreSmallTile:
metroStoreSmallTile140:
metroStoreSmallTile180:
metroStoreLargeTile80:
metroStoreLargeTile:
metroStoreLargeTile140:
metroStoreLargeTile180:
metroStoreSplashScreenImage:
metroStoreSplashScreenImage140:
metroStoreSplashScreenImage180:
metroPhoneAppIcon:
metroPhoneAppIcon140:
metroPhoneAppIcon240:
metroPhoneSmallTile:
metroPhoneSmallTile140:
metroPhoneSmallTile240:
metroPhoneMediumTile:
metroPhoneMediumTile140:
metroPhoneMediumTile240:
metroPhoneWideTile:
metroPhoneWideTile140:
metroPhoneWideTile240:
metroPhoneSplashScreenImage:
metroPhoneSplashScreenImage140:
metroPhoneSplashScreenImage240:
metroTileShortName:
metroCommandLineArgsFile:
metroTileShowName: 0
@ -409,28 +436,45 @@ PlayerSettings:
XboxOneAllowedProductIds: []
XboxOnePersistentLocalStorageSize: 0
intPropertyNames:
- Android::ScriptingBackend
- Metro::ScriptingBackend
- Standalone::ScriptingBackend
- WP8::ScriptingBackend
- WebGL::ScriptingBackend
- WebGL::audioCompressionFormat
- WebGL::exceptionSupport
- WebGL::memorySize
- iOS::Architecture
- iOS::EnableIncrementalBuildSupportForIl2cpp
- iOS::ScriptingBackend
Android::ScriptingBackend: 0
Metro::ScriptingBackend: 2
Standalone::ScriptingBackend: 0
WP8::ScriptingBackend: 2
WebGL::ScriptingBackend: 1
WebGL::audioCompressionFormat: 4
WebGL::exceptionSupport: 1
WebGL::memorySize: 256
iOS::Architecture: 2
iOS::EnableIncrementalBuildSupportForIl2cpp: 0
iOS::ScriptingBackend: 1
boolPropertyNames:
- WebGL::analyzeBuildSize
- WebGL::dataCaching
- WebGL::useEmbeddedResources
- XboxOne::enus
WebGL::analyzeBuildSize: 0
WebGL::dataCaching: 0
WebGL::useEmbeddedResources: 0
XboxOne::enus: 1
stringPropertyNames:
- WebGL::emscriptenArgs
- WebGL::template
- additionalIl2CppArgs::additionalIl2CppArgs
WebGL::emscriptenArgs:
WebGL::template: APPLICATION:Default
additionalIl2CppArgs::additionalIl2CppArgs:
firstStreamedSceneWithResources: 0
cloudProjectId:
projectName:
organizationId: