Skip to content
Snippets Groups Projects
Commit 08753517 authored by Matthewit Dechatech's avatar Matthewit Dechatech
Browse files

Disable control in rolling jump, fix pushing, modularize moves

parent 98f8fb8a
No related branches found
No related tags found
No related merge requests found
Showing
with 750 additions and 782 deletions
Loading
Loading
@@ -132,13 +132,6 @@ GameObject:
- 4: {fileID: 424606}
- 50: {fileID: 5083970}
- 114: {fileID: 11405618}
- 114: {fileID: 11453498}
- 114: {fileID: 11497264}
- 114: {fileID: 11429268}
- 114: {fileID: 11405630}
- 114: {fileID: 11470654}
- 114: {fileID: 11474560}
- 114: {fileID: 11443282}
m_Layer: 0
m_Name: S3K Sonic
m_TagString: Untagged
Loading
Loading
@@ -192,6 +185,29 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &174116
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 481582}
- 114: {fileID: 11451016}
- 114: {fileID: 11489168}
- 114: {fileID: 11498508}
- 114: {fileID: 11426138}
- 114: {fileID: 11472608}
- 114: {fileID: 11416224}
- 114: {fileID: 11493570}
- 114: {fileID: 11477054}
m_Layer: 0
m_Name: Moves
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &174442
GameObject:
m_ObjectHideFlags: 1
Loading
Loading
@@ -340,7 +356,7 @@ Transform:
- {fileID: 470720}
- {fileID: 479926}
m_Father: {fileID: 424606}
m_RootOrder: 1
m_RootOrder: 2
--- !u!4 &410208
Transform:
m_ObjectHideFlags: 1
Loading
Loading
@@ -364,7 +380,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 424606}
m_RootOrder: 0
m_RootOrder: 1
--- !u!4 &414772
Transform:
m_ObjectHideFlags: 1
Loading
Loading
@@ -408,9 +424,10 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 151248}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -.5, y: 3.13000011, z: 0}
m_LocalPosition: {x: -3.53999996, y: .529999971, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 481582}
- {fileID: 411496}
- {fileID: 404068}
- {fileID: 438320}
Loading
Loading
@@ -451,7 +468,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 424606}
m_RootOrder: 2
m_RootOrder: 3
--- !u!4 &440814
Transform:
m_ObjectHideFlags: 1
Loading
Loading
@@ -548,6 +565,18 @@ Transform:
m_Children: []
m_Father: {fileID: 404068}
m_RootOrder: 15
--- !u!4 &481582
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 174116}
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_Children: []
m_Father: {fileID: 424606}
m_RootOrder: 0
--- !u!4 &486686
Transform:
m_ObjectHideFlags: 1
Loading
Loading
@@ -629,12 +658,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 273d5567b7e8f0f4892de869d9b03b70, type: 3}
m_Name:
m_EditorClassIdentifier:
MoveManager: {fileID: 11451016}
RendererObject: {fileID: 105384}
Animator: {fileID: 9594506}
GroundControl: {fileID: 11453498}
AirControl: {fileID: 11497264}
AutoFindMoves: 1
Moves: []
Paths:
- Always Collide
- Path 1
Loading
Loading
@@ -648,7 +674,7 @@ MonoBehaviour:
MaxSpeed: 9001
LedgeClimbHeight: .159999996
LedgeDropHeight: .159999996
AntiTunnelingSpeed: 4
AntiTunnelingSpeed: 2
SlopeGravityBeginAngle: 10
DetachSpeed: 1.5
MaxClimbAngle: 70
Loading
Loading
@@ -679,10 +705,8 @@ MonoBehaviour:
PublicKeyToken=null
Interrupted: 0
InterruptTimer: 0
ControlState: {fileID: 0}
ActiveMoves: []
AvailableMoves: []
UnavailableMoves: []
GroundControl: {fileID: 0}
AirControl: {fileID: 0}
ApplySlopeGravity: 1
ApplyGroundFriction: 1
DetachWhenSlow: 1
Loading
Loading
@@ -704,33 +728,51 @@ MonoBehaviour:
PrimarySurface: {fileID: 0}
SecondarySurface: {fileID: 0}
QueuedTranslation: {x: 0, y: 0, z: 0}
--- !u!114 &11405630
--- !u!114 &11416224
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 151248}
m_GameObject: {fileID: 174116}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7514d680ed0ac744d87004eb35fc4580, type: 3}
m_Script: {fileID: 11500000, guid: 4c1095e8583f53d4c9de57a4156eb719, type: 3}
m_Name:
m_EditorClassIdentifier:
CurrentState: 0
InputActivated: 0
OnActive:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnEnd:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnAvailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnUnavailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
ActiveTrigger:
ActiveBool: Jumping
ActiveBool: Ducking
AvailableBool:
ActivateInput: Jump
ClearanceHeight: .25
ActivateSpeed: 3.9000001
ReleaseSpeed: 2.4000001
Used: 0
--- !u!114 &11429268
ActivateAxis: Vertical
RequireNegative: 1
MaxActivateSpeed: .618749976
--- !u!114 &11426138
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 151248}
m_GameObject: {fileID: 174116}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 797331bf56043af418fcd734e955b173, type: 3}
Loading
Loading
@@ -738,10 +780,30 @@ MonoBehaviour:
m_EditorClassIdentifier:
CurrentState: 0
InputActivated: 0
OnActive:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnEnd:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnAvailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnUnavailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
ActiveTrigger:
ActiveBool: Rolling
AvailableBool:
ActivateInput: Vertical
ActivateAxis: Vertical
RequireNegative: 1
MinActivateSpeed: .618749976
WidthChange: -.0399999991
Loading
Loading
@@ -750,12 +812,101 @@ MonoBehaviour:
DownhillGravity: 11.25
Deceleration: 4.5
Friction: .845099986
--- !u!114 &11443282
--- !u!114 &11451016
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 151248}
m_GameObject: {fileID: 174116}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a0bde06da48532d4d88d7e6dafe028ea, type: 3}
m_Name:
m_EditorClassIdentifier:
Controller: {fileID: 11405618}
Moves:
- {fileID: 11489168}
- {fileID: 11498508}
- {fileID: 11426138}
- {fileID: 11472608}
- {fileID: 11416224}
- {fileID: 11493570}
- {fileID: 11477054}
ActiveMoves: []
AvailableMoves: []
UnavailableMoves: []
OnPerform:
m_PersistentCalls:
m_Calls: []
m_TypeName: Hedgehog.Core.Moves.MoveEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnInterrupted:
m_PersistentCalls:
m_Calls: []
m_TypeName: Hedgehog.Core.Moves.MoveEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnEnd:
m_PersistentCalls:
m_Calls: []
m_TypeName: Hedgehog.Core.Moves.MoveEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnAvailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: Hedgehog.Core.Moves.MoveEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnUnavailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: Hedgehog.Core.Moves.MoveEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
--- !u!114 &11472608
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 174116}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7514d680ed0ac744d87004eb35fc4580, type: 3}
m_Name:
m_EditorClassIdentifier:
CurrentState: 0
InputActivated: 0
OnActive:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnEnd:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnAvailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnUnavailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
ActiveTrigger:
ActiveBool: Jumping
AvailableBool:
ActivateButton: Jump
ClearanceHeight: .25
ActivateSpeed: 3.9000001
ReleaseSpeed: 2.4000001
Used: 0
--- !u!114 &11477054
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 174116}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b99b237d3dc3e1d40b435ab74ce992c3, type: 3}
Loading
Loading
@@ -763,23 +914,95 @@ MonoBehaviour:
m_EditorClassIdentifier:
CurrentState: 0
InputActivated: 0
OnActive:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnEnd:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnAvailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnUnavailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
ActiveTrigger:
ActiveBool: Looking Up
AvailableBool:
InputAxis: Vertical
--- !u!114 &11453498
ActivateAxis: Vertical
--- !u!114 &11487382
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 151248}
m_GameObject: {fileID: 194366}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a7406431d84d33e44b62e26a55c3d66c, type: 3}
m_Name:
m_EditorClassIdentifier:
BoxCollider: {fileID: 6118484}
TopLeft: {fileID: 463510}
TopLeftStart: {fileID: 496620}
TopCenter: {fileID: 414772}
TopCenterStart: {fileID: 486686}
TopRight: {fileID: 410208}
TopRightStart: {fileID: 425550}
CenterLeft: {fileID: 418314}
Center: {fileID: 454566}
CenterRight: {fileID: 455234}
BottomLeft: {fileID: 414798}
BottomCenter: {fileID: 440814}
BottomRight: {fileID: 474138}
LedgeClimbLeft: {fileID: 470720}
LedgeClimbRight: {fileID: 479926}
LedgeDropLeft: {fileID: 474326}
LedgeDropRight: {fileID: 430194}
--- !u!114 &11489168
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 174116}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cdb2f0e4529104042a3b39f3ae84b062, type: 3}
m_Name:
m_EditorClassIdentifier:
IsCurrent: 0
InputAxis: Horizontal
CurrentState: 0
InputActivated: 0
OnActive:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnEnd:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnAvailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnUnavailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
ActiveTrigger:
ActiveBool:
AvailableBool:
MovementAxis: Horizontal
InvertAxis: 0
Acceleration: 1.6875
AccelerationLocked: 0
Loading
Loading
@@ -798,31 +1021,12 @@ MonoBehaviour:
ControlLockTimerFloat:
ControlLocked: 0
ControlLockTimer: 0
--- !u!114 &11470654
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 151248}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4c1095e8583f53d4c9de57a4156eb719, type: 3}
m_Name:
m_EditorClassIdentifier:
CurrentState: 0
InputActivated: 0
ActiveTrigger:
ActiveBool: Ducking
AvailableBool:
ActivateInput: Vertical
RequireNegative: 1
MaxActivateSpeed: .618749976
--- !u!114 &11474560
--- !u!114 &11493570
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 151248}
m_GameObject: {fileID: 174116}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3f2eca7c11782a34aaf5564a40ddbf71, type: 3}
Loading
Loading
@@ -830,6 +1034,26 @@ MonoBehaviour:
m_EditorClassIdentifier:
CurrentState: 0
InputActivated: 0
OnActive:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnEnd:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnAvailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnUnavailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
ActiveTrigger:
ActiveBool: Spindashing
AvailableBool:
Loading
Loading
@@ -839,53 +1063,49 @@ MonoBehaviour:
ChargePowerDecay: 1.875
MaxChargePower: 2.4000001
CurrentChargePower: 0
--- !u!114 &11487382
--- !u!114 &11498508
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 194366}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a7406431d84d33e44b62e26a55c3d66c, type: 3}
m_Name:
m_EditorClassIdentifier:
BoxCollider: {fileID: 6118484}
TopLeft: {fileID: 463510}
TopLeftStart: {fileID: 496620}
TopCenter: {fileID: 414772}
TopCenterStart: {fileID: 486686}
TopRight: {fileID: 410208}
TopRightStart: {fileID: 425550}
CenterLeft: {fileID: 418314}
Center: {fileID: 454566}
CenterRight: {fileID: 455234}
BottomLeft: {fileID: 414798}
BottomCenter: {fileID: 440814}
BottomRight: {fileID: 474138}
LedgeClimbLeft: {fileID: 470720}
LedgeClimbRight: {fileID: 479926}
LedgeDropLeft: {fileID: 474326}
LedgeDropRight: {fileID: 430194}
--- !u!114 &11497264
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 151248}
m_GameObject: {fileID: 174116}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 95703b2ef2f45d14283e6492815cf5de, type: 3}
m_Name:
m_EditorClassIdentifier:
IsCurrent: 0
InputAxis: Horizontal
CurrentState: 0
InputActivated: 0
OnActive:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnEnd:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnAvailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
OnUnavailable:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
ActiveTrigger:
ActiveBool:
AvailableBool:
MovementAxis: Horizontal
InvertAxis: 0
Acceleration: 3.375
Deceleration: 3.375
TopSpeed: 3.5999999
HorizontalSpeedParameter: Air Speed X
VerticalSpeedParameter: Air Speed Y
HorizontalSpeedFloat: Air Speed X
VerticalSpeedFloat: Air Speed Y
--- !u!212 &21216568
SpriteRenderer:
m_ObjectHideFlags: 1
Loading
Loading
Loading
Loading
@@ -12,18 +12,7 @@ AnimationClip:
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_PositionCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: {x: 0, y: -.0500000007, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
path:
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
Loading
Loading
@@ -59,12 +48,6 @@ AnimationClip:
classID: 212
customType: 23
isPPtrCurve: 1
- path: 0
attribute: 1
script: {fileID: 0}
classID: 4
customType: 0
isPPtrCurve: 0
pptrCurveMapping:
- {fileID: 21300000, guid: f49bbfa1fdd3cef4f8f09d4c2789ab34, type: 3}
- {fileID: 21300000, guid: 12b2ea6113a1a104a860830709e6edcc, type: 3}
Loading
Loading
@@ -90,51 +73,9 @@ AnimationClip:
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 10
m_PreInfinity: 2
m_PostInfinity: 2
attribute: m_LocalPosition.x
path:
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: -.0500000007
inSlope: 0
outSlope: 0
tangentMode: 10
m_PreInfinity: 2
m_PostInfinity: 2
attribute: m_LocalPosition.y
path:
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 10
m_PreInfinity: 2
m_PostInfinity: 2
attribute: m_LocalPosition.z
path:
classID: 4
script: {fileID: 0}
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 1
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_Events: []
Loading
Loading
@@ -1915,6 +1915,10 @@ Prefab:
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 5940b610296105e48a4040356aac62d1, type: 2}
m_IsPrefabParent: 0
--- !u!4 &295067703 stripped
Transform:
m_PrefabParentObject: {fileID: 424606, guid: dbca39c759708bb4dbdc512f0b2a13b2, type: 2}
m_PrefabInternal: {fileID: 1923966913}
--- !u!1001 &300124560
Prefab:
m_ObjectHideFlags: 0
Loading
Loading
@@ -3995,8 +3999,8 @@ Transform:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 742798714}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -4.80000019, y: 0, z: 0}
m_LocalRotation: {x: 0, y: 0, z: .297882527, w: .954602599}
m_LocalPosition: {x: -4.32999992, y: .49000001, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1139116792}
Loading
Loading
@@ -6227,7 +6231,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_RootOrder: 1
--- !u!114 &995063790
MonoBehaviour:
m_ObjectHideFlags: 0
Loading
Loading
@@ -6239,7 +6243,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8579349f574e1ea4b8b3c238ef8a81ba, type: 3}
m_Name:
m_EditorClassIdentifier:
FollowTarget: {fileID: 0}
FollowTarget: {fileID: 295067703}
Smoothness: 0
RotateToGravity: 1
RotationSmoothness: .200000003
Loading
Loading
@@ -8083,6 +8087,48 @@ SpriteRenderer:
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 86f5b3997c933a8438590cafe45112f2, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
--- !u!1001 &1264973306
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 493880, guid: 370e282936671974980b8674b29b3ba8, type: 2}
propertyPath: m_LocalPosition.x
value: -1.55999994
objectReference: {fileID: 0}
- target: {fileID: 493880, guid: 370e282936671974980b8674b29b3ba8, type: 2}
propertyPath: m_LocalPosition.y
value: .920000017
objectReference: {fileID: 0}
- target: {fileID: 493880, guid: 370e282936671974980b8674b29b3ba8, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 493880, guid: 370e282936671974980b8674b29b3ba8, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 493880, guid: 370e282936671974980b8674b29b3ba8, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 493880, guid: 370e282936671974980b8674b29b3ba8, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 493880, guid: 370e282936671974980b8674b29b3ba8, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 493880, guid: 370e282936671974980b8674b29b3ba8, type: 2}
propertyPath: m_RootOrder
value: 22
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 370e282936671974980b8674b29b3ba8, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &1274796970
Prefab:
m_ObjectHideFlags: 0
Loading
Loading
@@ -11531,8 +11577,8 @@ Transform:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1876871767}
m_LocalRotation: {x: 0, y: 0, z: .338526309, w: -.94095695}
m_LocalPosition: {x: -5.73999977, y: .219999999, z: 0}
m_LocalRotation: {x: 0, y: 0, z: .464370996, w: -.8856408}
m_LocalPosition: {x: -5.38999987, y: .540000021, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1139116792}
Loading
Loading
@@ -11631,11 +11677,11 @@ Prefab:
m_Modifications:
- target: {fileID: 424606, guid: dbca39c759708bb4dbdc512f0b2a13b2, type: 2}
propertyPath: m_LocalPosition.x
value: -.5
value: -3.53999996
objectReference: {fileID: 0}
- target: {fileID: 424606, guid: dbca39c759708bb4dbdc512f0b2a13b2, type: 2}
propertyPath: m_LocalPosition.y
value: 3.13000011
value: .529999971
objectReference: {fileID: 0}
- target: {fileID: 424606, guid: dbca39c759708bb4dbdc512f0b2a13b2, type: 2}
propertyPath: m_LocalPosition.z
Loading
Loading
Loading
Loading
@@ -15,12 +15,6 @@ public class HedgehogControllerEditor : UnityEditor.Editor
[SerializeField] private SerializedObject _serializedInstance;
#endregion
#region Foldout Variables
protected static bool ShowMoves
{
get { return EditorPrefs.GetBool("HedgehogController.ShowMoves", false); }
set { EditorPrefs.SetBool("HedgehogController.ShowMoves", value); }
}
protected static bool ShowCollision
{
get { return EditorPrefs.GetBool("HedgehogControllerEditor.ShowCollision", false); }
Loading
Loading
@@ -134,16 +128,8 @@ public override void OnInspectorGUI()
GUILayout.Label("<color=\"#0000ff\">Hedgehog Controller</color>", titleStyle);
#endregion
 
HedgehogEditorGUIUtility.DrawProperties(serializedObject, "RendererObject", "Animator");
#region Moves Foldout
ShowMoves = EditorGUILayout.Foldout(ShowMoves, "Moves", foldoutStyle);
if (ShowMoves)
{
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"GroundControl", "AirControl", "AutoFindMoves", "Moves");
}
#endregion
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"MoveManager", "RendererObject", "Animator");
#region Collision Foldout
ShowCollision = EditorGUILayout.Foldout(ShowCollision, "Collision", foldoutStyle);
if (ShowCollision)
Loading
Loading
@@ -230,8 +216,8 @@ public override void OnInspectorGUI()
ShowEvents = EditorGUILayout.Foldout(ShowEvents, "Events", foldoutStyle);
if (ShowEvents)
{
HedgehogEditorGUIUtility.DrawProperties(serializedObject, "OnCrush", "OnAttach",
"OnDetach", "OnSteepDetach", "OnPerformMove", "OnInterruptedMove");
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"OnCrush", "OnAttach", "OnDetach", "OnSteepDetach");
}
#endregion
#region Debug Foldout
Loading
Loading
@@ -245,11 +231,6 @@ public override void OnInspectorGUI()
 
GUI.enabled = Application.isPlaying;
 
HedgehogEditorGUIUtility.DrawProperties(serializedObject, "ControlState", "ActiveMoves",
"AvailableMoves", "UnavailableMoves");
EditorGUILayout.Space();
EditorGUILayout.LabelField("Collision", headerStyle);
 
HedgehogEditorGUIUtility.DrawProperties(serializedObject, "Paths");
Loading
Loading
This diff is collapsed.
Loading
Loading
@@ -2,7 +2,7 @@
 
namespace Hedgehog.Core.Moves
{
public class AirControl : ControlState
public class AirControl : Move
{
#region Control Fields
/// <summary>
Loading
Loading
@@ -10,7 +10,7 @@ public class AirControl : ControlState
/// </summary>
[SerializeField]
[Tooltip("The name of the input axis.")]
public string InputAxis;
public string MovementAxis;
 
/// <summary>
/// Whether to invert the axis input.
Loading
Loading
@@ -50,47 +50,78 @@ public class AirControl : ControlState
/// </summary>
[SerializeField]
[Tooltip("Name of an Animator float set to horizontal ground speed in units per second.")]
public string HorizontalSpeedParameter;
public string HorizontalSpeedFloat;
 
/// <summary>
/// Name of an Animator float set to vertical ground speed in units per second.
/// </summary>
[SerializeField]
[Tooltip("Name of an Animator float set to vertical ground speed in units per second.")]
public string VerticalSpeedParameter;
public string VerticalSpeedFloat;
#endregion
 
private float _axisMagnitude;
private float _axis;
 
public void Reset()
public override void Reset()
{
InputAxis = "Horizontal";
base.Reset();
MovementAxis = "Horizontal";
InvertAxis = false;
 
Acceleration = 3.375f;
Deceleration = 3.375f;
TopSpeed = 3.6f;
 
HorizontalSpeedParameter = VerticalSpeedParameter = "";
HorizontalSpeedFloat = VerticalSpeedFloat = "";
}
public override void Awake()
{
base.Awake();
_axis = 0.0f;
}
public override void OnEnable()
{
Controller.OnAttach.AddListener(OnAttach);
Controller.OnDetach.AddListener(OnDetach);
}
public override void OnDisable()
{
Controller.OnAttach.RemoveListener(OnAttach);
Controller.OnDetach.RemoveListener(OnDetach);
}
private void OnDetach()
{
Perform(true);
}
private void OnAttach()
{
End();
}
 
public override void SetAnimatorParameters()
{
if(HorizontalSpeedParameter.Length > 0)
Animator.SetFloat(HorizontalSpeedParameter, Controller.Velocity.x);
if(HorizontalSpeedFloat.Length > 0)
Animator.SetFloat(HorizontalSpeedFloat, Controller.Velocity.x);
 
if(VerticalSpeedParameter.Length > 0)
Animator.SetFloat(VerticalSpeedParameter, Controller.Velocity.y);
if(VerticalSpeedFloat.Length > 0)
Animator.SetFloat(VerticalSpeedFloat, Controller.Velocity.y);
}
 
public override void GetInput()
public override void OnActiveUpdate()
{
_axisMagnitude = Input.GetAxis(InputAxis);
_axis = InvertAxis ? -Input.GetAxis(MovementAxis) : Input.GetAxis(MovementAxis);
}
 
public override void OnStateFixedUpdate()
public override void OnActiveFixedUpdate()
{
Accelerate(_axisMagnitude);
Accelerate(_axis);
}
 
/// <summary>
Loading
Loading
@@ -120,7 +151,7 @@ public void AccelerateBackward(float magnitude = 1.0f)
/// it back.</param>
public void Accelerate(float magnitude)
{
Accelerate(magnitude, Time.fixedDeltaTime);
Accelerate(magnitude, Time.deltaTime);
}
 
/// <summary>
Loading
Loading
using Hedgehog.Core.Actors;
using UnityEngine;
namespace Hedgehog.Core.Moves
{
public class ControlState : MonoBehaviour
{
public bool IsCurrent;
protected HedgehogController Controller;
protected Animator Animator;
public virtual void Awake()
{
IsCurrent = false;
Controller = GetComponent<HedgehogController>();
Animator = Controller.Animator;
}
public virtual void Update()
{
GetInput();
if(Animator != null)
SetAnimatorParameters();
}
/// <summary>
/// Get and store input for the next FixedUpdate here.
/// </summary>
public virtual void GetInput()
{
}
/// <summary>
/// Set animator parameters here. Called only if the object has an Animator component.
/// </summary>
public virtual void SetAnimatorParameters()
{
}
/// <summary>
/// Called when the state is entered.
/// </summary>
/// <param name="previousState">The control state before </param>
public virtual void OnControlStateEnter(ControlState previousState)
{
}
/// <summary>
/// Called when the state is exited.
/// </summary>
/// <param name="nextState">The control state that will be entered next.</param>
public virtual void OnControlStateExit(ControlState nextState)
{
}
/// <summary>
/// Called on Update while this is the current state.
/// </summary>
public virtual void OnControlStateUpdate()
{
}
/// <summary>
/// Called on FixedUpdate while this is current state.
/// </summary>
public virtual void OnStateFixedUpdate()
{
}
}
}
Loading
Loading
@@ -10,7 +10,7 @@ public class Duck : Move
/// </summary>
[SerializeField]
[Tooltip("Input string used for activation.")]
public string ActivateInput;
public string ActivateAxis;
 
/// <summary>
/// Whether to activate when the input is in the opposite direction (if ActivateInput is "Vertical" and this
Loading
Loading
@@ -34,26 +34,28 @@ public override void Reset()
base.Reset();
MaxActivateSpeed = 0.61875f;
ActivateInput = "Vertical";
ActivateAxis = "Vertical";
RequireNegative = true;
}
 
public override bool Available()
{
var groundControl = Controller.GetMove<GroundControl>();
return Mathf.Abs(Controller.GroundVelocity) < MaxActivateSpeed &&
!Controller.GroundControl.Accelerating;
(groundControl == null || !groundControl.Accelerating);
}
 
public override bool InputActivate()
{
return RequireNegative
? Input.GetAxis(ActivateInput) < 0.0f
: Input.GetAxis(ActivateInput) > 0.0f;
? Input.GetAxis(ActivateAxis) < 0.0f
: Input.GetAxis(ActivateAxis) > 0.0f;
}
 
public override bool InputDeactivate()
{
return !Input.GetButton(ActivateInput) || !Available();
return !Input.GetButton(ActivateAxis) || !Available();
}
}
}
Loading
Loading
@@ -4,52 +4,27 @@
namespace Hedgehog.Core.Moves.Editor
{
[CustomEditor(typeof(AirControl))]
public class AirControlEditor : UnityEditor.Editor
public class AirControlEditor : MoveEditor
{
protected bool ShowControlsFoldout
protected override void DrawAnimationProperties()
{
get { return EditorPrefs.GetBool("AirControlEditor.ShowControlsFoldout", false); }
set { EditorPrefs.SetBool("AirControlEditor.ShowControlsFoldout", value); }
base.DrawAnimationProperties();
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"HorizontalSpeedFloat", "VerticalSpeedFloat");
}
 
protected bool ShowPhysicsFoldout
protected override void DrawControlProperties()
{
get { return EditorPrefs.GetBool("AirControlEditor.ShowPhysicsFoldout", false); }
set { EditorPrefs.SetBool("AirControlEditor.ShowPhysicsFoldout", value); }
base.DrawControlProperties();
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"MovementAxis", "InvertAxis");
}
 
protected bool ShowAnimationFoldout
protected override void DrawPhysicsProperties()
{
get { return EditorPrefs.GetBool("AirControlEditor.ShowAnimationFoldout", false); }
set { EditorPrefs.SetBool("AirControlEditor.ShowAnimationFoldout", value); }
}
public override void OnInspectorGUI()
{
serializedObject.Update();
ShowControlsFoldout = EditorGUILayout.Foldout(ShowControlsFoldout, "Controls");
if (ShowControlsFoldout)
{
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"InputAxis", "InvertAxis");
}
ShowPhysicsFoldout = EditorGUILayout.Foldout(ShowPhysicsFoldout, "Physics");
if (ShowPhysicsFoldout)
{
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"Acceleration", "Deceleration", "TopSpeed");
}
ShowAnimationFoldout = EditorGUILayout.Foldout(ShowAnimationFoldout, "Animation");
if (ShowAnimationFoldout)
{
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"HorizontalSpeedParameter", "VerticalSpeedParameter");
}
serializedObject.ApplyModifiedProperties();
base.DrawPhysicsProperties();
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"Acceleration", "Deceleration", "TopSpeed");
}
}
}
\ No newline at end of file
Loading
Loading
@@ -8,7 +8,7 @@ public class DuckEditor : MoveEditor
{
protected override void DrawControlProperties()
{
HedgehogEditorGUIUtility.DrawProperties(serializedObject, "ActivateInput", "RequireNegative",
HedgehogEditorGUIUtility.DrawProperties(serializedObject, "ActivateAxis", "RequireNegative",
"MaxActivateSpeed");
}
}
Loading
Loading
Loading
Loading
@@ -4,54 +4,26 @@
namespace Hedgehog.Core.Moves.Editor
{
[CustomEditor(typeof(GroundControl))]
public class GroundControlEditor : UnityEditor.Editor
public class GroundControlEditor : MoveEditor
{
protected bool ShowControlsFoldout
protected override void DrawAnimationProperties()
{
get { return EditorPrefs.GetBool("GroundControlEditor.ShowControlsFoldout", false); }
set { EditorPrefs.SetBool("GroundControlEditor.ShowControlsFoldout", value); }
}
protected bool ShowPhysicsFoldout
{
get { return EditorPrefs.GetBool("GroundControlEditor.ShowPhysicsFoldout", false); }
set { EditorPrefs.SetBool("GroundControlEditor.ShowPhysicsFoldout", value); }
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"InputAxisFloat", "GroundedBool", "AcceleratingBool", "BrakingBool",
"SpeedFloat", "AbsoluteSpeedFloat", "SurfaceAngleFloat", "ControlLockBool",
"ControlLockTimerFloat", "TopSpeedBool");
}
 
protected bool ShowAnimationFoldout
protected override void DrawControlProperties()
{
get { return EditorPrefs.GetBool("GroundControlEditor.ShowAnimationFoldout", false); }
set { EditorPrefs.SetBool("GroundControlEditor.ShowAnimationFoldout", value); }
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"MovementAxis", "InvertAxis");
}
 
public override void OnInspectorGUI()
protected override void DrawPhysicsProperties()
{
serializedObject.Update();
ShowControlsFoldout = EditorGUILayout.Foldout(ShowControlsFoldout, "Controls");
if (ShowControlsFoldout)
{
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"InputAxis", "InvertAxis");
}
ShowPhysicsFoldout = EditorGUILayout.Foldout(ShowPhysicsFoldout, "Physics");
if (ShowPhysicsFoldout)
{
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"Acceleration", "Deceleration", "TopSpeed");
}
ShowAnimationFoldout = EditorGUILayout.Foldout(ShowAnimationFoldout, "Animation");
if (ShowAnimationFoldout)
{
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"InputAxisFloat", "GroundedBool", "AcceleratingBool", "BrakingBool",
"SpeedFloat", "AbsoluteSpeedFloat", "SurfaceAngleFloat", "ControlLockBool",
"ControlLockTimerFloat", "TopSpeedBool");
}
serializedObject.ApplyModifiedProperties();
}
}
}
\ No newline at end of file
Loading
Loading
@@ -8,7 +8,7 @@ public class JumpEditor : MoveEditor
{
protected override void DrawControlProperties()
{
HedgehogEditorGUIUtility.DrawProperties(serializedObject, "ActivateInput", "ClearanceHeight");
HedgehogEditorGUIUtility.DrawProperties(serializedObject, "ActivateButton", "ClearanceHeight");
}
 
protected override void DrawPhysicsProperties()
Loading
Loading
Loading
Loading
@@ -8,7 +8,7 @@ public class LookUpEditor : MoveEditor
{
protected override void DrawControlProperties()
{
HedgehogEditorGUIUtility.DrawProperties(serializedObject, "InputAxis");
HedgehogEditorGUIUtility.DrawProperties(serializedObject, "ActivateAxis");
}
 
protected override void DrawPhysicsFoldout()
Loading
Loading
using Hedgehog.Core.Utils.Editor;
using UnityEditor;
using UnityEngine;
 
namespace Hedgehog.Core.Moves.Editor
{
[CustomEditor(typeof(Move), true)]
[CanEditMultipleObjects]
public class MoveEditor : UnityEditor.Editor
{
protected bool ShowControlFoldout
Loading
Loading
@@ -15,13 +15,19 @@ protected bool ShowControlFoldout
 
protected bool ShowPhysicsFoldout
{
get { return EditorPrefs.GetBool(GetType().Name + ".ShowPhysicsFoldout"); }
get { return EditorPrefs.GetBool(GetType().Name + ".ShowPhysicsFoldout", false); }
set { EditorPrefs.SetBool(GetType().Name + ".ShowPhysicsFoldout", value); }
}
 
protected bool ShowEventsFoldout
{
get { return EditorPrefs.GetBool(GetType().Name + ".ShowEventsFoldout", false); }
set { EditorPrefs.SetBool(GetType().Name + ".ShowEventsFoldout", value); }
}
protected bool ShowAnimationFoldout
{
get { return EditorPrefs.GetBool(GetType().Name + ".ShowAnimationFoldout"); }
get { return EditorPrefs.GetBool(GetType().Name + ".ShowAnimationFoldout", false); }
set { EditorPrefs.SetBool(GetType().Name + ".ShowAnimationFoldout", value); }
}
 
Loading
Loading
@@ -36,6 +42,10 @@ public override void OnInspectorGUI()
DrawPhysicsFoldout();
if(ShowPhysicsFoldout)
DrawPhysicsProperties();
DrawEventsFoldout();
if (ShowEventsFoldout)
DrawEventsProperties();
 
DrawAnimationFoldout();
if(ShowAnimationFoldout)
Loading
Loading
@@ -61,7 +71,18 @@ protected virtual void DrawPhysicsFoldout()
 
protected virtual void DrawPhysicsProperties()
{
}
 
protected virtual void DrawEventsFoldout()
{
ShowEventsFoldout = EditorGUILayout.Foldout(ShowEventsFoldout, "Events");
}
protected virtual void DrawEventsProperties()
{
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"OnActive", "OnEnd", "OnAvailable", "OnUnavailable");
}
 
protected virtual void DrawAnimationFoldout()
Loading
Loading
using System.Linq;
using Hedgehog.Core.Utils.Editor;
using UnityEditor;
using UnityEngine;
namespace Hedgehog.Core.Moves.Editor
{
[CustomEditor(typeof(MoveManager))]
public class MoveManagerEditor : UnityEditor.Editor
{
protected bool ShowEventsFoldout
{
get { return EditorPrefs.GetBool("MoveManagerEditor.ShowEventsFoldout", false); }
set { EditorPrefs.SetBool("MoveManagerEditor.ShowEventsFoldout", value); }
}
public override void OnInspectorGUI()
{
serializedObject.Update();
if (targets.Count() == 1)
{
var moveManager = target as MoveManager;
moveManager.GetComponents(moveManager.Moves);
}
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"Controller", "Moves");
ShowEventsFoldout = EditorGUILayout.Foldout(ShowEventsFoldout, "Events");
if (ShowEventsFoldout)
{
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"OnPerform", "OnEnd", "OnAvailable", "OnUnavailable", "OnInterrupted");
}
var enabled = GUI.enabled;
GUI.enabled = Application.isPlaying;
HedgehogEditorGUIUtility.DrawProperties(serializedObject,
"ActiveMoves",
"AvailableMoves",
"UnavailableMoves");
GUI.enabled = enabled;
serializedObject.ApplyModifiedProperties();
}
}
}
fileFormatVersion: 2
guid: b1267601732b74d4ebd00886aabe9060
timeCreated: 1446000882
guid: 2a3892249c6d50f4e9dfaa452f9527d4
timeCreated: 1447787616
licenseType: Free
MonoImporter:
serializedVersion: 2
Loading
Loading
Loading
Loading
@@ -8,7 +8,7 @@ public class RollEditor : MoveEditor
{
protected override void DrawControlProperties()
{
HedgehogEditorGUIUtility.DrawProperties(serializedObject, "ActivateInput", "RequireNegative",
HedgehogEditorGUIUtility.DrawProperties(serializedObject, "ActivateAxis", "RequireNegative",
"MinActivateSpeed");
}
 
Loading
Loading
Loading
Loading
@@ -3,7 +3,7 @@
 
namespace Hedgehog.Core.Moves
{
public class GroundControl : ControlState
public class GroundControl : Move
{
#region Control Fields
/// <summary>
Loading
Loading
@@ -11,7 +11,7 @@ public class GroundControl : ControlState
/// </summary>
[SerializeField]
[Tooltip("The name of the input axis.")]
public string InputAxis;
public string MovementAxis;
 
/// <summary>
/// Whether to invert the axis input.
Loading
Loading
@@ -132,8 +132,8 @@ public bool Accelerating
get
{
return !ControlLocked &&
(Controller.GroundVelocity > 0.0f && _axisMagnitude > 0.0f ||
Controller.GroundVelocity < 0.0f && _axisMagnitude < 0.0f);
(Controller.GroundVelocity > 0.0f && _axis > 0.0f ||
Controller.GroundVelocity < 0.0f && _axis < 0.0f);
}
}
 
Loading
Loading
@@ -145,8 +145,8 @@ public bool Braking
get
{
return !ControlLocked &&
(Controller.GroundVelocity > 0.0f && _axisMagnitude < 0.0f ||
Controller.GroundVelocity < 0.0f && _axisMagnitude > 0.0f);
(Controller.GroundVelocity > 0.0f && _axis < 0.0f ||
Controller.GroundVelocity < 0.0f && _axis > 0.0f);
}
}
 
Loading
Loading
@@ -158,7 +158,8 @@ public bool AtTopSpeed
get { return Mathf.Abs(Controller.GroundVelocity) - TopSpeed > -0.1f; }
}
#endregion
private float _axisMagnitude;
private float _axis;
 
/// <summary>
/// Whether the control lock is on.
Loading
Loading
@@ -170,9 +171,11 @@ public bool AtTopSpeed
/// </summary>
public float ControlLockTimer;
 
public void Reset()
public override void Reset()
{
InputAxis = "Horizontal";
base.Reset();
MovementAxis = "Horizontal";
InvertAxis = false;
 
Acceleration = 1.6875f;
Loading
Loading
@@ -188,19 +191,43 @@ public void Reset()
public override void Awake()
{
base.Awake();
_axisMagnitude = 0.0f;
_axis = 0.0f;
 
ControlLocked = false;
ControlLockTimer = 0.0f;
}
 
public override void OnControlStateEnter(ControlState previousState)
public override void OnEnable()
{
base.OnEnable();
Controller.OnAttach.AddListener(OnAttach);
Controller.OnDetach.AddListener(OnDetach);
}
public override void OnDisable()
{
base.OnDisable();
Controller.OnAttach.RemoveListener(OnAttach);
Controller.OnDetach.RemoveListener(OnDetach);
}
private void OnAttach()
{
Perform(true);
}
private void OnDetach()
{
End();
}
public override void OnActiveEnter(State previousState)
{
Controller.OnSteepDetach.AddListener(OnSteepDetach);
Controller.AutoFlip = false;
}
 
public override void OnControlStateExit(ControlState nextState)
public override void OnActiveExit()
{
Controller.OnSteepDetach.RemoveListener(OnSteepDetach);
Controller.AutoFlip = true;
Loading
Loading
@@ -213,21 +240,20 @@ public override void OnControlStateExit(ControlState nextState)
Animator.SetBool(BrakingBool, false);
}
 
public override void OnControlStateUpdate()
public override void OnActiveUpdate()
{
ControlLockTimer -= Time.deltaTime;
if (ControlLockTimer < 0.0f)
{
Unlock();
}
if (ControlLocked)
return;
_axis = InvertAxis ? -Input.GetAxis(MovementAxis) : Input.GetAxis(MovementAxis);
}
 
public override void OnStateFixedUpdate()
public override void OnActiveFixedUpdate()
{
UpdateControlLockTimer();
if (!ControlLocked)
{
Controller.ApplyGroundFriction = !Accelerate(_axisMagnitude);
Controller.ApplyGroundFriction = !Accelerate(_axis);
}
 
if (Mathf.Abs(Controller.GroundVelocity) < Controller.DetachSpeed &&
Loading
Loading
@@ -236,19 +262,14 @@ public override void OnStateFixedUpdate()
Lock();
}
 
if (!DMath.Equalsf(_axisMagnitude))
if (!DMath.Equalsf(_axis))
Controller.FacingForward = Controller.GroundVelocity >= 0.0f;
}
 
public override void GetInput()
{
_axisMagnitude = Input.GetAxis(InputAxis)*(InvertAxis ? -1.0f : 1.0f);
}
public override void SetAnimatorParameters()
{
if(InputAxisFloat.Length > 0)
Animator.SetFloat(InputAxisFloat, _axisMagnitude);
Animator.SetFloat(InputAxisFloat, _axis);
 
if(GroundedBool.Length > 0)
Animator.SetBool(GroundedBool, Controller.Grounded);
Loading
Loading
namespace Hedgehog.Core.Moves
{
public class InstaShield
{
}
}
fileFormatVersion: 2
guid: b10b9cb1540747945be44ff63f2157fe
timeCreated: 1447048269
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment