Compare commits
4 Commits
0ad0c01249
...
95c5737cf0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95c5737cf0 | ||
|
|
4cd6881374 | ||
|
|
29f57a47b0 | ||
|
|
55bbe468df |
6
.idea/.idea.Project Reset/.idea/vcs.xml
generated
Normal file
6
.idea/.idea.Project Reset/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -1,168 +0,0 @@
|
|||||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="True">
|
|
||||||
<Style src="project://database/Assets/Core/UI/Editor/Stylesheets/WildsEditors.uss?fileID=7433441132597879392&guid=a6bd99e5b08b3de4190806c83ae5dfff&type=3#WildsEditors" />
|
|
||||||
<Style src="project://database/Assets/Core/UI/Editor/Stylesheets/PlayerMovementStyles.uss?fileID=7433441132597879392&guid=184c6057804f222428c94a16d4412e0c&type=3#PlayerMovementStyles" />
|
|
||||||
<ui:VisualElement style="flex-grow: 1; padding-bottom: 1px;">
|
|
||||||
<ui:Foldout text="Sprinting" data-source-type="PlayerMovement, Assembly-CSharp" class="sectionFoldout">
|
|
||||||
<ui:VisualElement name="VisualElement" class="statusViewer active" style="background-color: rgb(46, 46, 46);">
|
|
||||||
<ui:Label text="Sprinting" style="padding-right: 10px; padding-bottom: 5px; padding-top: 5px; padding-left: 10px;" />
|
|
||||||
<Bindings>
|
|
||||||
<ui:DataBinding property="style.backgroundColor" data-source-path="sprinting" binding-mode="ToTarget" source-to-ui-converters="Bool to Color" />
|
|
||||||
</Bindings>
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:Foldout>
|
|
||||||
<ui:Foldout text="Gravity & Jumping" toggle-on-label-click="true" data-source-type="PlayerMovement, Assembly-CSharp" name="Foldout" class="sectionFoldout" style="width: auto;">
|
|
||||||
<ui:FloatField label="Gravity Acceleration" value="42.2" class="property-fullwidth">
|
|
||||||
<Bindings>
|
|
||||||
<ui:DataBinding property="value" data-source-path="gravityAcceleration" data-source-type="PlayerMovement, Player" binding-mode="TwoWay" />
|
|
||||||
</Bindings>
|
|
||||||
</ui:FloatField>
|
|
||||||
<ui:FloatField label="Jump Height" value="42.2" class="property-fullwidth">
|
|
||||||
<Bindings>
|
|
||||||
<ui:DataBinding property="value" data-source-path="jumpHeight" data-source-type="PlayerMovement, Player" binding-mode="TwoWay" />
|
|
||||||
</Bindings>
|
|
||||||
</ui:FloatField>
|
|
||||||
<ui:FloatField label="Jump Deacceleration" value="42.2" class="property-fullwidth">
|
|
||||||
<Bindings>
|
|
||||||
<ui:DataBinding property="value" data-source-path="jumpDeacceleration" data-source-type="PlayerMovement, Player" binding-mode="TwoWay" />
|
|
||||||
</Bindings>
|
|
||||||
</ui:FloatField>
|
|
||||||
<ui:VisualElement name="JumpPower" class="group" style="flex-grow: 1;">
|
|
||||||
<ui:VisualElement name="VisualElement" style="flex-direction: row;">
|
|
||||||
<ui:Label text="Current Jump Power" enabled="true" enable-rich-text="true" class="title" style="margin-right: 11px;" />
|
|
||||||
<ui:Label text="0.000" style="width: 60px; color: rgba(210, 210, 210, 0.25);">
|
|
||||||
<Bindings>
|
|
||||||
<ui:DataBinding property="text" data-source-path="jumpPower" data-source-type="PlayerMovement, Player" binding-mode="ToTarget" update-trigger="OnSourceChanged" />
|
|
||||||
</Bindings>
|
|
||||||
</ui:Label>
|
|
||||||
</ui:VisualElement>
|
|
||||||
<ui:Slider high-value="20" fill="true" name="Slider" show-input-field="false" direction="Horizontal" inverted="false" enabled="false" style="flex-grow: 1;">
|
|
||||||
<Bindings>
|
|
||||||
<ui:DataBinding property="value" data-source-path="jumpPower" data-source-type="PlayerMovement, Player" binding-mode="ToTarget" />
|
|
||||||
</Bindings>
|
|
||||||
</ui:Slider>
|
|
||||||
</ui:VisualElement>
|
|
||||||
<ui:VisualElement name="JumpInfo" style="padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px;">
|
|
||||||
<ui:VisualElement name="VisualElement" enabled="true" style="flex-grow: 1;">
|
|
||||||
<ui:VisualElement name="GroundJumps" data-source-type="PlayerMovement, Player" data-source-path="groundJumpParams" enabled="true" class="gravityParameters" style="flex-direction: row;">
|
|
||||||
<ui:VisualElement data-source-path="active" style="flex-grow: 0; width: 20px; margin-right: 8px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(106, 106, 106);" />
|
|
||||||
<ui:VisualElement style="flex-grow: 1;">
|
|
||||||
<ui:Label text="Ground Jump" name="Name" />
|
|
||||||
<ui:VisualElement name="Properties" style="flex-direction: row;">
|
|
||||||
<ui:VisualElement name="GravityValue" class="property">
|
|
||||||
<ui:Label text="Gravity" name="VariableName" />
|
|
||||||
<ui:FloatField value="0">
|
|
||||||
<Bindings>
|
|
||||||
<ui:DataBinding property="value" data-source-path="jumpGravityMultiplier" binding-mode="ToSource" />
|
|
||||||
</Bindings>
|
|
||||||
</ui:FloatField>
|
|
||||||
</ui:VisualElement>
|
|
||||||
<ui:VisualElement name="HeightValue" class="property">
|
|
||||||
<ui:Label text="Height " name="VariableName" />
|
|
||||||
<ui:FloatField value="0">
|
|
||||||
<Bindings>
|
|
||||||
<ui:DataBinding property="value" data-source-path="jumpHeightMultiplier" data-source-type="PlayerMovement+JumpParameters, Player" binding-mode="ToSource" />
|
|
||||||
</Bindings>
|
|
||||||
</ui:FloatField>
|
|
||||||
</ui:VisualElement>
|
|
||||||
<ui:VisualElement name="DeaccelValue" class="property">
|
|
||||||
<ui:Label text="Deacceleration" name="VariableName" />
|
|
||||||
<ui:FloatField value="0">
|
|
||||||
<Bindings>
|
|
||||||
<ui:DataBinding property="value" data-source-path="jumpDeaccelMultiplier" binding-mode="ToSource" />
|
|
||||||
</Bindings>
|
|
||||||
</ui:FloatField>
|
|
||||||
</ui:VisualElement>
|
|
||||||
<ui:VisualElement name="AirJumpCount" class="property">
|
|
||||||
<ui:Label text="Count" name="VariableName" />
|
|
||||||
<ui:VisualElement name="VisualElement" style="flex-direction: row; align-items: center;">
|
|
||||||
<ui:Label text="-" style="font-size: 14px; -unity-font-style: bold; -unity-text-align: middle-left; color: rgba(210, 210, 210, 0.82);" />
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:VisualElement>
|
|
||||||
<ui:VisualElement name="GroundJumps" data-source-type="PlayerMovement, Player" data-source-path="initialAirJumpParams" enabled="true" class="gravityParameters" style="flex-direction: row;">
|
|
||||||
<ui:VisualElement data-source-path="active" style="flex-grow: 0; width: 20px; margin-right: 8px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(106, 106, 106);" />
|
|
||||||
<ui:VisualElement style="flex-grow: 1;">
|
|
||||||
<ui:Label text="Air Jump, Initial" name="Name" />
|
|
||||||
<ui:VisualElement name="Properties" style="flex-direction: row;">
|
|
||||||
<ui:VisualElement name="GravityValue" class="property">
|
|
||||||
<ui:Label text="Gravity" name="VariableName" />
|
|
||||||
<ui:FloatField value="0">
|
|
||||||
<Bindings>
|
|
||||||
<ui:DataBinding property="value" data-source-path="jumpGravityMultiplier" binding-mode="ToSource" />
|
|
||||||
</Bindings>
|
|
||||||
</ui:FloatField>
|
|
||||||
</ui:VisualElement>
|
|
||||||
<ui:VisualElement name="HeightValue" class="property">
|
|
||||||
<ui:Label text="Height " name="VariableName" />
|
|
||||||
<ui:FloatField value="0">
|
|
||||||
<Bindings>
|
|
||||||
<ui:DataBinding property="value" data-source-path="jumpHeightMultiplier" data-source-type="PlayerMovement+JumpParameters, Player" binding-mode="ToSource" />
|
|
||||||
</Bindings>
|
|
||||||
</ui:FloatField>
|
|
||||||
</ui:VisualElement>
|
|
||||||
<ui:VisualElement name="DeaccelValue" class="property">
|
|
||||||
<ui:Label text="Deacceleration" name="VariableName" />
|
|
||||||
<ui:FloatField value="0">
|
|
||||||
<Bindings>
|
|
||||||
<ui:DataBinding property="value" data-source-path="jumpDeaccelMultiplier" binding-mode="ToSource" />
|
|
||||||
</Bindings>
|
|
||||||
</ui:FloatField>
|
|
||||||
</ui:VisualElement>
|
|
||||||
<ui:VisualElement name="AirJumpCount" class="property">
|
|
||||||
<ui:Label text="Count" name="VariableName" />
|
|
||||||
<ui:VisualElement name="VisualElement" style="flex-direction: row; align-items: center;">
|
|
||||||
<ui:Label text="3" data-source-type="PlayerMovement, Player" style="font-size: 14px; -unity-font-style: bold; -unity-text-align: middle-left; color: rgba(210, 210, 210, 0.82);" />
|
|
||||||
<ui:Label text="/ " enable-rich-text="false" style="color: rgba(210, 210, 210, 0.41);" />
|
|
||||||
<ui:IntegerField value="3" data-source-type="PlayerMovement, Player" />
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:VisualElement>
|
|
||||||
<ui:VisualElement name="GroundJumps" data-source-type="PlayerMovement, Player" data-source-path="followupAirJumpParams" enabled="true" class="gravityParameters" style="flex-direction: row;">
|
|
||||||
<ui:VisualElement data-source-path="active" style="flex-grow: 0; width: 20px; margin-right: 8px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(106, 106, 106);" />
|
|
||||||
<ui:VisualElement style="flex-grow: 1;">
|
|
||||||
<ui:Label text="Air Jump, Follow-up" name="Name" />
|
|
||||||
<ui:VisualElement name="Properties" style="flex-direction: row;">
|
|
||||||
<ui:VisualElement name="GravityValue" class="property">
|
|
||||||
<ui:Label text="Gravity" name="VariableName" />
|
|
||||||
<ui:FloatField value="0">
|
|
||||||
<Bindings>
|
|
||||||
<ui:DataBinding property="value" data-source-path="jumpGravityMultiplier" binding-mode="ToSource" />
|
|
||||||
</Bindings>
|
|
||||||
</ui:FloatField>
|
|
||||||
</ui:VisualElement>
|
|
||||||
<ui:VisualElement name="HeightValue" class="property">
|
|
||||||
<ui:Label text="Height " name="VariableName" />
|
|
||||||
<ui:FloatField value="0">
|
|
||||||
<Bindings>
|
|
||||||
<ui:DataBinding property="value" data-source-path="jumpHeightMultiplier" data-source-type="PlayerMovement+JumpParameters, Player" binding-mode="ToSource" />
|
|
||||||
</Bindings>
|
|
||||||
</ui:FloatField>
|
|
||||||
</ui:VisualElement>
|
|
||||||
<ui:VisualElement name="DeaccelValue" class="property">
|
|
||||||
<ui:Label text="Deacceleration" name="VariableName" />
|
|
||||||
<ui:FloatField value="0">
|
|
||||||
<Bindings>
|
|
||||||
<ui:DataBinding property="value" data-source-path="jumpDeaccelMultiplier" binding-mode="ToSource" />
|
|
||||||
</Bindings>
|
|
||||||
</ui:FloatField>
|
|
||||||
</ui:VisualElement>
|
|
||||||
<ui:VisualElement name="AirJumpCount" class="property">
|
|
||||||
<ui:Label text="Count" name="VariableName" />
|
|
||||||
<ui:VisualElement name="VisualElement" style="flex-direction: row; align-items: center;">
|
|
||||||
<ui:Label text="3" style="font-size: 14px; -unity-font-style: bold; -unity-text-align: middle-left; color: rgba(210, 210, 210, 0.82);" />
|
|
||||||
<ui:Label text="/ " enable-rich-text="false" style="color: rgba(210, 210, 210, 0.41);" />
|
|
||||||
<ui:IntegerField value="3" />
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:Foldout>
|
|
||||||
</ui:VisualElement>
|
|
||||||
</ui:UXML>
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 50b1bee0d09a86b4ba186a7a2e264a78
|
|
||||||
ScriptedImporter:
|
|
||||||
internalIDToNameTable: []
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
|
||||||
@@ -80,18 +80,3 @@ public class PlayerControlsInspector: PlayerEditorWindow{
|
|||||||
player = target;
|
player = target;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[CustomEditor(typeof(PlayerMovement))]
|
|
||||||
public class PlayerMovementInspector : PlayerEditorWindow{
|
|
||||||
public PlayerControls script;
|
|
||||||
public Object player;
|
|
||||||
|
|
||||||
public override void BindEditor(VisualElement element){
|
|
||||||
SerializedObject so = new (player);
|
|
||||||
element.dataSource = player;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnEnable(){
|
|
||||||
player = target;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: f945e777233a59f4aba40aeca29093a6, type: 3}
|
m_Script: {fileID: 11500000, guid: f945e777233a59f4aba40aeca29093a6, type: 3}
|
||||||
m_Name: PlayerLocomotionFSM
|
m_Name: PlayerLocomotionFSM
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
_serializedGraph: '{"type":"NodeCanvas.StateMachines.FSM","nodes":[{"_actionList":{"executionMode":1,"actions":[{"baseMoveSpeed":{"_value":10.0},"sprintAdditionalSpeed":{},"moveDirection":{"_name":"groundMoveDirection","_targetVariableID":"16ae5ce4-097a-4c21-94a5-2c5d9ce73eb6"},"$type":"NodeCanvas.Tasks.Actions.ProcessFlatLocomotion"},{"valueA":{"_name":"rotationSpeed","_targetVariableID":"d888730f-97df-4288-bb99-1f6c8a34a7c5"},"valueB":{"_value":0.3},"$type":"NodeCanvas.Tasks.Actions.SetFloat"}]},"_repeatStateActions":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_position":{"x":559.9924,"y":711.7622},"$type":"NodeCanvas.StateMachines.ActionState","$id":"0"},{"_actionList":{"executionMode":1,"actions":[{"baseMoveSpeed":{"_value":17.0},"sprintAdditionalSpeed":{},"moveDirection":{"_name":"groundMoveDirection","_targetVariableID":"16ae5ce4-097a-4c21-94a5-2c5d9ce73eb6"},"$type":"NodeCanvas.Tasks.Actions.ProcessFlatLocomotion"},{"valueA":{"_name":"rotationSpeed","_targetVariableID":"d888730f-97df-4288-bb99-1f6c8a34a7c5"},"valueB":{"_value":0.2},"$type":"NodeCanvas.Tasks.Actions.SetFloat"}]},"_repeatStateActions":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_position":{"x":874.288,"y":572.152},"$type":"NodeCanvas.StateMachines.ActionState","$id":"1"},{"_position":{"x":430.6569,"y":381.1322},"$type":"NodeCanvas.StateMachines.AnyState","$id":"2"},{"_position":{"x":465.0,"y":561.0},"$type":"NodeCanvas.StateMachines.EmptyState","$id":"3"}],"connections":[{"_condition":{"actionName":{"_value":"Sprint"},"actionValue":{"_value":""},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"desiredVector3":{"_value":{"z":1.0}},"tolerance":{"_value":0.5},"negate":{},"$type":"NodeCanvas.Tasks.Conditions.GetMovementInputDotProduct"},"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"0"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"321e55c7-f93e-4667-a0dc-559eb61c6898"},"valueB":{},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"3"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"321e55c7-f93e-4667-a0dc-559eb61c6898"},"valueB":{"_value":true},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"0"},"$type":"NodeCanvas.StateMachines.FSMConnection"}],"canvasGroups":[],"localBlackboard":{"_variables":{"isGrounded":{"_propertyPath":"UnityEngine.CharacterController.isGrounded","_name":"isGrounded","_id":"321e55c7-f93e-4667-a0dc-559eb61c6898","$type":"NodeCanvas.Framework.Variable`1[[System.Boolean,
|
_serializedGraph: '{"type":"NodeCanvas.StateMachines.FSM","nodes":[{"_actionList":{"executionMode":1,"actions":[{"moveSpeed":{"_value":10.0},"moveDirection":{"_name":"groundMoveDirection","_targetVariableID":"16ae5ce4-097a-4c21-94a5-2c5d9ce73eb6"},"$type":"NodeCanvas.Tasks.Actions.CalculateGroundedLocomotion"},{"valueA":{"_name":"rotationSpeed","_targetVariableID":"d888730f-97df-4288-bb99-1f6c8a34a7c5"},"valueB":{"_value":0.3},"$type":"NodeCanvas.Tasks.Actions.SetFloat"}]},"_repeatStateActions":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_position":{"x":559.9924,"y":711.7622},"$type":"NodeCanvas.StateMachines.ActionState","$id":"0"},{"_actionList":{"executionMode":1,"actions":[{"moveSpeed":{"_value":15.0},"moveDirection":{"_name":"groundMoveDirection","_targetVariableID":"16ae5ce4-097a-4c21-94a5-2c5d9ce73eb6"},"$type":"NodeCanvas.Tasks.Actions.CalculateGroundedLocomotion"},{"valueA":{"_name":"rotationSpeed","_targetVariableID":"d888730f-97df-4288-bb99-1f6c8a34a7c5"},"valueB":{"_value":0.2},"$type":"NodeCanvas.Tasks.Actions.SetFloat"}]},"_repeatStateActions":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_position":{"x":874.288,"y":572.152},"$type":"NodeCanvas.StateMachines.ActionState","$id":"1"},{"_position":{"x":430.6569,"y":381.1322},"$type":"NodeCanvas.StateMachines.AnyState","$id":"2"},{"_position":{"x":465.0,"y":561.0},"$type":"NodeCanvas.StateMachines.EmptyState","$id":"3"}],"connections":[{"_condition":{"actionName":{"_value":"Sprint"},"actionValue":{"_value":""},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"desiredVector3":{"_value":{"z":1.0}},"tolerance":{"_value":0.5},"negate":{},"$type":"NodeCanvas.Tasks.Conditions.GetMovementInputDotProduct"},"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"0"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"321e55c7-f93e-4667-a0dc-559eb61c6898"},"valueB":{},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"3"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"321e55c7-f93e-4667-a0dc-559eb61c6898"},"valueB":{"_value":true},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"0"},"$type":"NodeCanvas.StateMachines.FSMConnection"}],"canvasGroups":[],"localBlackboard":{"_variables":{"isGrounded":{"_propertyPath":"UnityEngine.CharacterController.isGrounded","_name":"isGrounded","_id":"321e55c7-f93e-4667-a0dc-559eb61c6898","$type":"NodeCanvas.Framework.Variable`1[[System.Boolean,
|
||||||
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"groundMoveDirection":{"_name":"groundMoveDirection","_id":"16ae5ce4-097a-4c21-94a5-2c5d9ce73eb6","_isPublic":true,"$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.Vector3,
|
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"groundMoveDirection":{"_name":"groundMoveDirection","_id":"16ae5ce4-097a-4c21-94a5-2c5d9ce73eb6","_isPublic":true,"$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.Vector3,
|
||||||
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"rotationSpeed":{"_name":"rotationSpeed","_id":"d888730f-97df-4288-bb99-1f6c8a34a7c5","_isPublic":true,"$type":"NodeCanvas.Framework.Variable`1[[System.Single,
|
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"rotationSpeed":{"_name":"rotationSpeed","_id":"d888730f-97df-4288-bb99-1f6c8a34a7c5","_isPublic":true,"$type":"NodeCanvas.Framework.Variable`1[[System.Single,
|
||||||
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}}}}'
|
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}}}}'
|
||||||
@@ -21,7 +21,7 @@ MonoBehaviour:
|
|||||||
_version: 3.31
|
_version: 3.31
|
||||||
_category:
|
_category:
|
||||||
_comments:
|
_comments:
|
||||||
_translation: {x: 75, y: -142}
|
_translation: {x: 129, y: -157}
|
||||||
_zoomFactor: 0.9962392
|
_zoomFactor: 0.9962392
|
||||||
_haltSerialization: 0
|
_haltSerialization: 0
|
||||||
_externalSerializationFile: {fileID: 0}
|
_externalSerializationFile: {fileID: 0}
|
||||||
|
|||||||
@@ -6137,44 +6137,6 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: b3b4e13d59527d1429a62dde97c6a001, type: 3}
|
m_Script: {fileID: 11500000, guid: b3b4e13d59527d1429a62dde97c6a001, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
baseMoveSpeed: 8
|
|
||||||
sprinting: 0
|
|
||||||
sprintAddtnlSpeed: 8
|
|
||||||
sprintAcceleration: 10
|
|
||||||
gravityAcceleration: 0.2
|
|
||||||
groundJumpGravity: 0
|
|
||||||
airJumpGravity: 0
|
|
||||||
rotationSpeed: 0.5
|
|
||||||
justATest: 0
|
|
||||||
jumpHeight: 7
|
|
||||||
jumpDeacceleration: 5
|
|
||||||
airJumpsCount: 3
|
|
||||||
airJumpStrength: 2
|
|
||||||
airJumpDeacceleration: 0
|
|
||||||
groundJumpStrength: 1
|
|
||||||
groundJumpDeacceleration: 0
|
|
||||||
jumpPower: 0
|
|
||||||
airJumpsRemaining: 3
|
|
||||||
groundJumpParams:
|
|
||||||
jumpGravityMultiplier: 0
|
|
||||||
jumpHeightMultiplier: 5
|
|
||||||
jumpDeaccelMultiplier: 0
|
|
||||||
active: 0
|
|
||||||
initialAirJumpParams:
|
|
||||||
jumpGravityMultiplier: 0
|
|
||||||
jumpHeightMultiplier: 6
|
|
||||||
jumpDeaccelMultiplier: 0
|
|
||||||
active: 0
|
|
||||||
followupAirJumpParams:
|
|
||||||
jumpGravityMultiplier: 0
|
|
||||||
jumpHeightMultiplier: 7
|
|
||||||
jumpDeaccelMultiplier: 0
|
|
||||||
active: 0
|
|
||||||
currentJump:
|
|
||||||
jumpGravityMultiplier: 0
|
|
||||||
jumpHeightMultiplier: 5
|
|
||||||
jumpDeaccelMultiplier: 5
|
|
||||||
active: 0
|
|
||||||
--- !u!4 &1992890473
|
--- !u!4 &1992890473
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -6294,16 +6256,16 @@ MonoBehaviour:
|
|||||||
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},{"valueA":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"valueB":{"_name":"groundMoveDirection","_targetVariableID":"765d24b4-452d-4531-9fce-6cef7ba39634"},"$type":"NodeCanvas.Tasks.Actions.SetVariable`1[[UnityEngine.Vector3,
|
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},{"valueA":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"valueB":{"_name":"groundMoveDirection","_targetVariableID":"765d24b4-452d-4531-9fce-6cef7ba39634"},"$type":"NodeCanvas.Tasks.Actions.SetVariable`1[[UnityEngine.Vector3,
|
||||||
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[{"valueA":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"valueB":{"_name":"groundMoveDirection","_targetVariableID":"765d24b4-452d-4531-9fce-6cef7ba39634"},"$type":"NodeCanvas.Tasks.Actions.SetVariable`1[[UnityEngine.Vector3,
|
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[{"valueA":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"valueB":{"_name":"groundMoveDirection","_targetVariableID":"765d24b4-452d-4531-9fce-6cef7ba39634"},"$type":"NodeCanvas.Tasks.Actions.SetVariable`1[[UnityEngine.Vector3,
|
||||||
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}]},"foldEnter":true,"foldExit":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_name":"Ground
|
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}]},"foldEnter":true,"foldExit":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_name":"Ground
|
||||||
Idle","_position":{"x":437.0988,"y":161.9817},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"0"},{"_onEnterList":{"executionMode":1,"actions":[{"valueA":{"_name":"airJumpsRemaining","_targetVariableID":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d"},"Operation":2,"valueB":{"_value":1},"$type":"NodeCanvas.Tasks.Actions.SetInt"}]},"_onUpdateList":{"executionMode":1,"actions":[{"airMoveDirection":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"groundMoveDirection":{"_name":"groundMoveDirection","_targetVariableID":"765d24b4-452d-4531-9fce-6cef7ba39634"},"$type":"NodeCanvas.Tasks.Actions.CalculateAirMovement"}]},"_onExitList":{"executionMode":1,"actions":[]},"foldUpdate":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_name":"Airborn
|
Idle","_position":{"x":449.1072,"y":171.9887},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"0"},{"_onEnterList":{"executionMode":1,"actions":[{"valueA":{"_name":"airJumpsRemaining","_targetVariableID":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d"},"Operation":2,"valueB":{"_value":1},"$type":"NodeCanvas.Tasks.Actions.SetInt"}]},"_onUpdateList":{"executionMode":1,"actions":[{"airMoveDirection":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"groundMoveDirection":{"_name":"groundMoveDirection","_targetVariableID":"765d24b4-452d-4531-9fce-6cef7ba39634"},"$type":"NodeCanvas.Tasks.Actions.CalculateAirMovement"}]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"foldUpdate":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_name":"Airborn
|
||||||
(Actionable)","_position":{"x":606.037,"y":-147.5533},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"1"},{"_onEnterList":{"executionMode":1,"actions":[{"jumpStrength":{"_value":18.0},"airMoveDirection":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"standStillJumpStrength":{},"jumpPower":{"_name":"jumpPower","_targetVariableID":"9a82efee-e317-423c-ad6e-5ef7e6145396"},"currentVelocityInheritence":{"_value":0.2},"directionalForce":{"_value":{"y":1.0,"z":0.3}},"directionalForceStrength":{"_value":1.0},"$type":"NodeCanvas.Tasks.Actions.Jump"},{"valueA":{"_name":"gravityPower","_targetVariableID":"2221dc20-d9b3-4781-bd23-0b2038a7ff5e"},"valueB":{},"$type":"NodeCanvas.Tasks.Actions.SetFloat"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_name":"Wall
|
(Actionable)","_position":{"x":607.037,"y":-147.5533},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"1"},{"_onEnterList":{"executionMode":1,"actions":[{"jumpStrength":{"_value":18.0},"airMoveDirection":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"standStillJumpStrength":{},"jumpPower":{"_name":"jumpPower","_targetVariableID":"9a82efee-e317-423c-ad6e-5ef7e6145396"},"currentVelocityInheritence":{"_value":0.2},"directionalForce":{"_value":{"y":1.0,"z":0.3}},"directionalForceStrength":{"_value":1.0},"$type":"NodeCanvas.Tasks.Actions.AddJump"},{"valueA":{"_name":"gravityPower","_targetVariableID":"2221dc20-d9b3-4781-bd23-0b2038a7ff5e"},"valueB":{},"$type":"NodeCanvas.Tasks.Actions.SetFloat"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_name":"Wall
|
||||||
Climb Jump","_position":{"x":1082.0,"y":-276.0},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"2"},{"_onEnterList":{"executionMode":1,"actions":[{"jumpStrength":{},"airMoveDirection":{},"standStillJumpStrength":{},"jumpPower":{},"currentVelocityInheritence":{},"directionalForce":{},"directionalForceStrength":{},"$type":"NodeCanvas.Tasks.Actions.Jump"},{"valueA":{"_name":"gravityPower","_targetVariableID":"2221dc20-d9b3-4781-bd23-0b2038a7ff5e"},"valueB":{},"$type":"NodeCanvas.Tasks.Actions.SetFloat"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_name":"Wall
|
Climb Jump","_position":{"x":1082.0,"y":-276.0},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"2"},{"_onEnterList":{"executionMode":1,"actions":[{"jumpStrength":{},"airMoveDirection":{},"standStillJumpStrength":{},"jumpPower":{},"currentVelocityInheritence":{},"directionalForce":{},"directionalForceStrength":{},"$type":"NodeCanvas.Tasks.Actions.AddJump"},{"valueA":{"_name":"gravityPower","_targetVariableID":"2221dc20-d9b3-4781-bd23-0b2038a7ff5e"},"valueB":{},"$type":"NodeCanvas.Tasks.Actions.SetFloat"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_name":"Wall
|
||||||
Jump","_position":{"x":868.4374,"y":-418.9596},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"3"},{"_onEnterList":{"executionMode":1,"actions":[{"jumpStrength":{"_value":12.0},"airMoveDirection":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"standStillJumpStrength":{"_value":1.0},"jumpPower":{"_name":"jumpPower","_targetVariableID":"9a82efee-e317-423c-ad6e-5ef7e6145396"},"currentVelocityInheritence":{"_value":1.0},"directionalForce":{},"directionalForceStrength":{},"$type":"NodeCanvas.Tasks.Actions.Jump"},{"valueA":{"_name":"gravityPower","_targetVariableID":"2221dc20-d9b3-4781-bd23-0b2038a7ff5e"},"valueB":{},"$type":"NodeCanvas.Tasks.Actions.SetFloat"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_name":"Standard
|
Jump","_position":{"x":868.4374,"y":-418.9596},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"3"},{"_onEnterList":{"executionMode":1,"actions":[{"jumpStrength":{"_value":12.0},"airMoveDirection":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"standStillJumpStrength":{"_value":1.0},"jumpPower":{"_name":"jumpPower","_targetVariableID":"9a82efee-e317-423c-ad6e-5ef7e6145396"},"currentVelocityInheritence":{"_value":1.0},"directionalForce":{},"directionalForceStrength":{},"$type":"NodeCanvas.Tasks.Actions.AddJump"},{"valueA":{"_name":"gravityPower","_targetVariableID":"2221dc20-d9b3-4781-bd23-0b2038a7ff5e"},"valueB":{},"$type":"NodeCanvas.Tasks.Actions.SetFloat"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_name":"Standard
|
||||||
Jump","_position":{"x":831.2836,"y":45.40906},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"4"},{"_onEnterList":{"executionMode":1,"actions":[]},"_onUpdateList":{"executionMode":1,"actions":[{"airMoveDirection":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"groundMoveDirection":{"_name":"groundMoveDirection","_targetVariableID":"765d24b4-452d-4531-9fce-6cef7ba39634"},"$type":"NodeCanvas.Tasks.Actions.CalculateAirMovement"}]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"foldUpdate":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_name":"Airborn","_position":{"x":213.7761,"y":-7.08618},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"5"},{"_onEnterList":{"executionMode":1,"actions":[{"jumpStrength":{"_value":10.0},"airMoveDirection":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"standStillJumpStrength":{},"jumpPower":{"_name":"jumpPower","_targetVariableID":"9a82efee-e317-423c-ad6e-5ef7e6145396"},"currentVelocityInheritence":{"_value":0.3},"directionalForce":{"_value":{"x":1.0,"z":1.0}},"directionalForceStrength":{"_value":10.0},"$type":"NodeCanvas.Tasks.Actions.Jump"},{"valueA":{"_name":"gravityPower","_targetVariableID":"2221dc20-d9b3-4781-bd23-0b2038a7ff5e"},"valueB":{},"$type":"NodeCanvas.Tasks.Actions.SetFloat"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_name":"Wall
|
Jump","_position":{"x":831.2836,"y":45.40904},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"4"},{"_onEnterList":{"executionMode":1,"actions":[]},"_onUpdateList":{"executionMode":1,"actions":[{"airMoveDirection":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"groundMoveDirection":{"_name":"groundMoveDirection","_targetVariableID":"765d24b4-452d-4531-9fce-6cef7ba39634"},"$type":"NodeCanvas.Tasks.Actions.CalculateAirMovement"}]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"foldUpdate":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_name":"Airborn","_position":{"x":213.7761,"y":-7.08618},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"5"},{"_onEnterList":{"executionMode":1,"actions":[{"jumpStrength":{"_value":10.0},"airMoveDirection":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"standStillJumpStrength":{},"jumpPower":{"_name":"jumpPower","_targetVariableID":"9a82efee-e317-423c-ad6e-5ef7e6145396"},"currentVelocityInheritence":{"_value":0.3},"directionalForce":{"_value":{"x":1.0,"z":1.0}},"directionalForceStrength":{"_value":10.0},"$type":"NodeCanvas.Tasks.Actions.AddJump"},{"valueA":{"_name":"gravityPower","_targetVariableID":"2221dc20-d9b3-4781-bd23-0b2038a7ff5e"},"valueB":{},"$type":"NodeCanvas.Tasks.Actions.SetFloat"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_name":"Wall
|
||||||
Jump","_position":{"x":328.7507,"y":-415.5261},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"6"},{"_onEnterList":{"executionMode":1,"actions":[{"jumpStrength":{},"airMoveDirection":{},"standStillJumpStrength":{},"jumpPower":{},"currentVelocityInheritence":{},"directionalForce":{},"directionalForceStrength":{},"$type":"NodeCanvas.Tasks.Actions.Jump"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"foldUpdate":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_position":{"x":962.6703,"y":260.45},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"7"},{"_onEnterList":{"executionMode":1,"actions":[{"jumpStrength":{},"airMoveDirection":{},"standStillJumpStrength":{},"jumpPower":{},"currentVelocityInheritence":{},"directionalForce":{},"directionalForceStrength":{},"$type":"NodeCanvas.Tasks.Actions.Jump"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"foldUpdate":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_position":{"x":692.1729,"y":398.1862},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"8"},{"_subFSM":{"_value":1},"_variablesMap":[{"_targetSubGraphVariableID":"16ae5ce4-097a-4c21-94a5-2c5d9ce73eb6","_canRead":true,"_canWrite":true,"_type":"UnityEngine.Vector3","_name":"groundMoveDirection","_targetVariableID":"765d24b4-452d-4531-9fce-6cef7ba39634"},{"_targetSubGraphVariableID":"d888730f-97df-4288-bb99-1f6c8a34a7c5","_canRead":true,"_canWrite":true,"_type":"System.Single","_name":"rotationSpeed","_targetVariableID":"3a7d1c7c-8fb6-4a99-b25a-b434b62d4611"}],"_position":{"x":-56.29138,"y":405.3138},"$type":"NodeCanvas.StateMachines.ConcurrentSubFSM"},{"_conditionList":{"conditions":[{"$type":"NodeCanvas.Tasks.Conditions.DebugCondition"}]},"_actionList":{"executionMode":1,"actions":[{"gravityScale":{"_value":1.0},"gravityAcceleration":{"_value":1.0},"gravityMax":{"_value":8.0},"$type":"NodeCanvas.Tasks.Actions.ProcessGravity"}]},"_position":{"x":-52.0,"y":509.0},"$type":"NodeCanvas.StateMachines.OnFSMEnter"},{"_conditionList":{"conditions":[{"_invert":true,"$type":"NodeCanvas.Tasks.Conditions.DebugCondition"}]},"_actionList":{"executionMode":1,"actions":[{"groundMoveDirection":{"_name":"groundMoveDirection","_targetVariableID":"765d24b4-452d-4531-9fce-6cef7ba39634"},"airMoveDirection":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"gravityScale":{"_value":1.0},"gravityAcceleration":{"_value":1.0},"gravityMax":{"_value":8.0},"jumpPower":{"_name":"jumpPower","_targetVariableID":"9a82efee-e317-423c-ad6e-5ef7e6145396"},"jumpPowerDecay":{"_value":2.0},"rotationSpeed":{"_name":"rotationSpeed","_targetVariableID":"3a7d1c7c-8fb6-4a99-b25a-b434b62d4611"},"rotationSmoothing":{"_value":1.0},"gravityPower":{"_name":"gravityPower","_targetVariableID":"2221dc20-d9b3-4781-bd23-0b2038a7ff5e"},"$type":"NodeCanvas.Tasks.Actions.ProcessMovement"}]},"_position":{"x":133.0,"y":511.0},"$type":"NodeCanvas.StateMachines.OnFSMEnter"}],"connections":[{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"619300a4-be8b-4ad4-ba2a-978468094ba2"},"valueB":{},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"actionName":{"_value":"Jump"},"actionValue":{},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"4"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"conditions":[{"eventName":{"_value":"ForwardRay"},"value":{"_value":true},"$type":"NodeCanvas.Tasks.Conditions.CheckEventValue`1[[System.Boolean,
|
Jump","_position":{"x":328.7507,"y":-415.5261},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"6"},{"_subFSM":{"_value":1},"_variablesMap":[{"_targetSubGraphVariableID":"16ae5ce4-097a-4c21-94a5-2c5d9ce73eb6","_canRead":true,"_canWrite":true,"_type":"UnityEngine.Vector3","_name":"groundMoveDirection","_targetVariableID":"765d24b4-452d-4531-9fce-6cef7ba39634"},{"_targetSubGraphVariableID":"d888730f-97df-4288-bb99-1f6c8a34a7c5","_canRead":true,"_canWrite":true,"_type":"System.Single","_name":"rotationSpeed","_targetVariableID":"3a7d1c7c-8fb6-4a99-b25a-b434b62d4611"}],"_position":{"x":-51.59897,"y":405.3138},"$type":"NodeCanvas.StateMachines.ConcurrentSubFSM"},{"_conditionList":{"conditions":[{"_invert":true,"$type":"NodeCanvas.Tasks.Conditions.DebugCondition"}]},"_actionList":{"executionMode":1,"actions":[{"groundMoveDirection":{"_name":"groundMoveDirection","_targetVariableID":"765d24b4-452d-4531-9fce-6cef7ba39634"},"airMoveDirection":{"_name":"airMoveDirection","_targetVariableID":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2"},"gravityAcceleration":{"_value":1.0},"gravityMax":{"_value":8.0},"jumpPower":{"_name":"jumpPower","_targetVariableID":"9a82efee-e317-423c-ad6e-5ef7e6145396"},"jumpPowerDecay":{"_value":2.0},"rotationSpeed":{"_name":"rotationSpeed","_targetVariableID":"3a7d1c7c-8fb6-4a99-b25a-b434b62d4611"},"rotationSmoothing":{"_value":1.0},"gravityPower":{"_name":"gravityPower","_targetVariableID":"2221dc20-d9b3-4781-bd23-0b2038a7ff5e"},"$type":"NodeCanvas.Tasks.Actions.ProcessMovement"}]},"_position":{"x":-53.13061,"y":270.8315},"$type":"NodeCanvas.StateMachines.OnFSMEnter"}],"connections":[{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"619300a4-be8b-4ad4-ba2a-978468094ba2"},"valueB":{},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"actionName":{"_value":"Jump"},"actionValue":{},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"4"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"conditions":[{"eventName":{"_value":"ForwardRay"},"value":{"_value":true},"$type":"NodeCanvas.Tasks.Conditions.CheckEventValue`1[[System.Boolean,
|
||||||
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},{"actionName":{"_value":"Jump"},"actionValue":{},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"}],"$type":"NodeCanvas.Framework.ConditionList"},"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"2"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"conditions":[{"actionName":{"_value":"Jump"},"actionValue":{},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},{"eventName":{"_value":"RightRay"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent"}],"$type":"NodeCanvas.Framework.ConditionList"},"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"3"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"actionName":{"_value":"Jump"},"actionValue":{},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"4"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"valueA":{"_name":"airJumpsRemaining","_targetVariableID":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d"},"valueB":{},"$type":"NodeCanvas.Tasks.Conditions.CheckInt"},"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"5"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"619300a4-be8b-4ad4-ba2a-978468094ba2"},"valueB":{"_value":true},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"0"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"conditions":[{"actionName":{"_value":"Jump"},"actionValue":{},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},{"eventName":{"_value":"LeftRay"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent"}],"$type":"NodeCanvas.Framework.ConditionList"},"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"6"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_sourceNode":{"$ref":"4"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"619300a4-be8b-4ad4-ba2a-978468094ba2"},"valueB":{"_value":true},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"5"},"_targetNode":{"$ref":"0"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_sourceNode":{"$ref":"6"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"actionName":{"_value":"Jump"},"actionValue":{},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},"_sourceNode":{"$ref":"7"},"_targetNode":{"$ref":"8"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"619300a4-be8b-4ad4-ba2a-978468094ba2"},"valueB":{"_value":true},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"8"},"_targetNode":{"$ref":"0"},"$type":"NodeCanvas.StateMachines.FSMConnection"}],"canvasGroups":[],"localBlackboard":{"_variables":{"isGrounded":{"_propertyPath":"UnityEngine.CharacterController.isGrounded","_name":"isGrounded","_id":"619300a4-be8b-4ad4-ba2a-978468094ba2","$type":"NodeCanvas.Framework.Variable`1[[System.Boolean,
|
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},{"actionName":{"_value":"Jump"},"actionValue":{},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"}],"$type":"NodeCanvas.Framework.ConditionList"},"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"2"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"conditions":[{"actionName":{"_value":"Jump"},"actionValue":{},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},{"eventName":{"_value":"RightRay"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent"}],"$type":"NodeCanvas.Framework.ConditionList"},"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"3"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"actionName":{"_value":"Jump"},"actionValue":{},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"4"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"valueA":{"_name":"airJumpsRemaining","_targetVariableID":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d"},"valueB":{},"$type":"NodeCanvas.Tasks.Conditions.CheckInt"},"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"5"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"619300a4-be8b-4ad4-ba2a-978468094ba2"},"valueB":{"_value":true},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"0"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"conditions":[{"actionName":{"_value":"Jump"},"actionValue":{},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},{"eventName":{"_value":"LeftRay"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent"}],"$type":"NodeCanvas.Framework.ConditionList"},"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"6"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_sourceNode":{"$ref":"4"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"619300a4-be8b-4ad4-ba2a-978468094ba2"},"valueB":{"_value":true},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"5"},"_targetNode":{"$ref":"0"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_sourceNode":{"$ref":"6"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"}],"canvasGroups":[],"localBlackboard":{"_variables":{"isGrounded":{"_propertyPath":"UnityEngine.CharacterController.isGrounded","_name":"isGrounded","_id":"619300a4-be8b-4ad4-ba2a-978468094ba2","$type":"NodeCanvas.Framework.Variable`1[[System.Boolean,
|
||||||
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"airJumpsRemaining":{"_propertyPath":"PlayerMovement.airJumpsRemaining","_name":"airJumpsRemaining","_id":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d","$type":"NodeCanvas.Framework.Variable`1[[System.Int32,
|
|
||||||
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"forwardRay":{"_propertyPath":"PlayerMovement.forwardRay","_name":"forwardRay","_id":"a2506ca5-1b47-4820-9921-3ff4ecc18564","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.RaycastHit,
|
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"forwardRay":{"_propertyPath":"PlayerMovement.forwardRay","_name":"forwardRay","_id":"a2506ca5-1b47-4820-9921-3ff4ecc18564","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.RaycastHit,
|
||||||
UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"groundMoveDirection":{"_name":"groundMoveDirection","_id":"765d24b4-452d-4531-9fce-6cef7ba39634","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.Vector3,
|
UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"airJumpsRemaining":{"_name":"airJumpsRemaining","_id":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d","$type":"NodeCanvas.Framework.Variable`1[[System.Int32,
|
||||||
|
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"groundMoveDirection":{"_name":"groundMoveDirection","_id":"765d24b4-452d-4531-9fce-6cef7ba39634","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.Vector3,
|
||||||
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"airMoveDirection":{"_name":"airMoveDirection","_id":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.Vector3,
|
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"airMoveDirection":{"_name":"airMoveDirection","_id":"8f5f926f-618d-4bcb-87eb-0bcd02e405a2","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.Vector3,
|
||||||
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"rotationSpeed":{"_value":0.5,"_name":"rotationSpeed","_id":"3a7d1c7c-8fb6-4a99-b25a-b434b62d4611","$type":"NodeCanvas.Framework.Variable`1[[System.Single,
|
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"rotationSpeed":{"_value":0.5,"_name":"rotationSpeed","_id":"3a7d1c7c-8fb6-4a99-b25a-b434b62d4611","$type":"NodeCanvas.Framework.Variable`1[[System.Single,
|
||||||
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"jumpPower":{"_name":"jumpPower","_id":"9a82efee-e317-423c-ad6e-5ef7e6145396","$type":"NodeCanvas.Framework.Variable`1[[System.Single,
|
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"jumpPower":{"_name":"jumpPower","_id":"9a82efee-e317-423c-ad6e-5ef7e6145396","$type":"NodeCanvas.Framework.Variable`1[[System.Single,
|
||||||
@@ -6316,8 +6278,8 @@ MonoBehaviour:
|
|||||||
_version: 3.31
|
_version: 3.31
|
||||||
_category:
|
_category:
|
||||||
_comments:
|
_comments:
|
||||||
_translation: {x: 397, y: 389}
|
_translation: {x: 686, y: 205}
|
||||||
_zoomFactor: 0.7462549
|
_zoomFactor: 1
|
||||||
_firstActivation: 0
|
_firstActivation: 0
|
||||||
_enableAction: 0
|
_enableAction: 0
|
||||||
_disableAction: 0
|
_disableAction: 0
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ using UnityEngine.InputSystem;
|
|||||||
|
|
||||||
namespace NodeCanvas.Tasks.Actions {
|
namespace NodeCanvas.Tasks.Actions {
|
||||||
|
|
||||||
[Category("Reset/Actions")]
|
[Category("Reset/Movement")]
|
||||||
public class Jump : ActionTask<CharacterController> {
|
public class AddJump : ActionTask<CharacterController> {
|
||||||
public BBParameter<float> jumpStrength;
|
public BBParameter<float> jumpStrength;
|
||||||
public BBParameter<Vector3> airMoveDirection;
|
public BBParameter<Vector3> airMoveDirection;
|
||||||
|
|
||||||
@@ -25,7 +25,15 @@ namespace NodeCanvas.Tasks.Actions {
|
|||||||
public BBParameter<float> directionalForceStrength;
|
public BBParameter<float> directionalForceStrength;
|
||||||
|
|
||||||
protected override string info {
|
protected override string info {
|
||||||
get { return "Start Jump" ; }
|
get{
|
||||||
|
string dirStrength = "";
|
||||||
|
|
||||||
|
if (directionalForce.value != Vector3.zero && directionalForceStrength.value > 0f) {
|
||||||
|
dirStrength = $", towards <i>{directionalForce.value}</i> * {directionalForceStrength.value}";
|
||||||
|
}
|
||||||
|
|
||||||
|
return string.Format($"<b>Start Jump</b>, <i>{jumpStrength.value}</i> strength" + dirStrength);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Use for initialization. This is called only once in the lifetime of the task.
|
//Use for initialization. This is called only once in the lifetime of the task.
|
||||||
@@ -40,50 +48,6 @@ namespace NodeCanvas.Tasks.Actions {
|
|||||||
protected override void OnExecute(){
|
protected override void OnExecute(){
|
||||||
// Set jump power
|
// Set jump power
|
||||||
jumpPower.value = jumpStrength.value;
|
jumpPower.value = jumpStrength.value;
|
||||||
|
|
||||||
{ /* // The following creates an air movement direction initially constructed from the agent's velocity, but also from subsequent jump inputs
|
|
||||||
// // Create a vector 3 to hold velocity without jump power or gravity
|
|
||||||
// Vector3 velocityWithoutY = new(agent.velocity.x, 0f, agent.velocity.z);
|
|
||||||
// Vector3 jumpLeapVelocity = new (velocityWithoutY.x, velocityWithoutY.y, velocityWithoutY.z);
|
|
||||||
//
|
|
||||||
// float inputVelocityMagnitude = velocityWithoutY.magnitude;
|
|
||||||
// float usableVelocity = 0f;
|
|
||||||
//
|
|
||||||
// // Ungrounded players can input a jump command to take their relative velcity as input for the new direction
|
|
||||||
// if(!agent.isGrounded){
|
|
||||||
// // Get raw input direction
|
|
||||||
// Vector3 playerInputVector3 = new(agent.GetComponent<PlayerControls>().rawMoveInput.x, 0f, agent.GetComponent<PlayerControls>().rawMoveInput.y);
|
|
||||||
//
|
|
||||||
// // Compare current velocity magnitude against jump strength. This is so air movement with no inherit velocity can be overidden by the new jump.
|
|
||||||
// usableVelocity = Mathf.Abs(velocityWithoutY.magnitude - jumpStrength.value);
|
|
||||||
// usableVelocity = Mathf.Max(usableVelocity, 0f);
|
|
||||||
// usableVelocity /= jumpStrength.value;
|
|
||||||
// // Debug.Log(usableVelocity);
|
|
||||||
//
|
|
||||||
// // Lerp between leaping and adding the full jump strenght, or adding a portion of it
|
|
||||||
// Vector3 fullNewValueVelocity = agent.transform.rotation * playerInputVector3.normalized * jumpStrength.value;
|
|
||||||
// Vector3 fullOriginalValueVelocity = velocityWithoutY;
|
|
||||||
//
|
|
||||||
// jumpLeapVelocity = Vector3.Lerp(fullNewValueVelocity, fullOriginalValueVelocity, 1f - usableVelocity);
|
|
||||||
// } else {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // Add directional force, for things such as wall bounces
|
|
||||||
// Vector3 directionalForceDirection = new Vector3(directionalForce.value.x, 0f, directionalForce.value.y);
|
|
||||||
// jumpLeapVelocity += (agent.transform.rotation * directionalForce.value) * directionalForceStrength.value;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// jumpLeapVelocity *= currentVelocityInheritence.value;
|
|
||||||
// if (agent.isGrounded){
|
|
||||||
// jumpLeapVelocity = Vector3.ClampMagnitude(jumpLeapVelocity, velocityWithoutY.magnitude);
|
|
||||||
// } else {
|
|
||||||
// jumpLeapVelocity = Vector3.ClampMagnitude(jumpLeapVelocity, Mathf.Lerp(velocityWithoutY.magnitude, jumpStrength.value, usableVelocity));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // Debug.Log(jumpLeapVelocity);
|
|
||||||
//
|
|
||||||
// airMoveDirection.value = jumpLeapVelocity; */ }
|
|
||||||
|
|
||||||
// Save current velocity and get current input direction
|
// Save current velocity and get current input direction
|
||||||
Vector3 currentVelocityVector3 = new Vector3(agent.velocity.x, 0f, agent.velocity.z);
|
Vector3 currentVelocityVector3 = new Vector3(agent.velocity.x, 0f, agent.velocity.z);
|
||||||
@@ -4,7 +4,7 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace NodeCanvas.Tasks.Actions {
|
namespace NodeCanvas.Tasks.Actions {
|
||||||
|
|
||||||
[Category("Core/Movement")]
|
[Category("Reset/Movement")]
|
||||||
public class CalculateAirMovement : ActionTask<Transform>{
|
public class CalculateAirMovement : ActionTask<Transform>{
|
||||||
public BBParameter<Vector3> airMoveDirection;
|
public BBParameter<Vector3> airMoveDirection;
|
||||||
public BBParameter<Vector3> groundMoveDirection;
|
public BBParameter<Vector3> groundMoveDirection;
|
||||||
|
|||||||
@@ -5,15 +5,20 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace NodeCanvas.Tasks.Actions {
|
namespace NodeCanvas.Tasks.Actions {
|
||||||
|
|
||||||
[Category("Core/Movement")]
|
[Category("Reset/Movement")]
|
||||||
[Description("Unit flat ground movement")]
|
[Description("Unit flat ground movement")]
|
||||||
public class ProcessFlatLocomotion : ActionTask<CharacterController>{
|
public class CalculateGroundedLocomotion : ActionTask<CharacterController>{
|
||||||
public BBParameter<float> baseMoveSpeed;
|
public BBParameter<float> moveSpeed;
|
||||||
public BBParameter<float> sprintAdditionalSpeed;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public BBParameter<Vector3> moveDirection;
|
public BBParameter<Vector3> moveDirection;
|
||||||
|
|
||||||
|
protected override string info {
|
||||||
|
get{
|
||||||
|
return string.Format($"<b>Set ground movement</b>, <i>{moveSpeed.value}</i> speed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private float sprintPower;
|
private float sprintPower;
|
||||||
private bool sprinting;
|
private bool sprinting;
|
||||||
|
|
||||||
@@ -45,18 +50,8 @@ namespace NodeCanvas.Tasks.Actions {
|
|||||||
float outputSpeed = 0f;
|
float outputSpeed = 0f;
|
||||||
|
|
||||||
// Add base speed
|
// Add base speed
|
||||||
outputSpeed += baseMoveSpeed.value;
|
outputSpeed += moveSpeed.value;
|
||||||
|
|
||||||
// Add sprinting speed
|
|
||||||
// TODO: Take this sprinting section out and move it into it's own task. Sprinting should be a state in the ground locomotion graph.
|
|
||||||
if (sprinting) {
|
|
||||||
sprintPower = Mathf.Lerp(sprintPower, 1, sprintAdditionalSpeed.value * Time.deltaTime);
|
|
||||||
outputSpeed += (sprintAdditionalSpeed.value * sprintPower);
|
|
||||||
} else {
|
|
||||||
outputSpeed += (sprintAdditionalSpeed.value * sprintPower);
|
|
||||||
sprintPower = Mathf.Lerp(sprintPower, 0, sprintAdditionalSpeed.value * Time.deltaTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
return outputSpeed;
|
return outputSpeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5,7 +5,7 @@ using UnityEngine.InputSystem;
|
|||||||
|
|
||||||
namespace NodeCanvas.Tasks.Conditions {
|
namespace NodeCanvas.Tasks.Conditions {
|
||||||
|
|
||||||
[Category("Core")]
|
[Category("Reset/Input")]
|
||||||
[Description("Check if input condition was matched this frame")]
|
[Description("Check if input condition was matched this frame")]
|
||||||
public class CheckInput : ConditionTask<Transform>{
|
public class CheckInput : ConditionTask<Transform>{
|
||||||
public BBParameter<string> actionName;
|
public BBParameter<string> actionName;
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
using NodeCanvas.Framework;
|
|
||||||
using ParadoxNotion.Design;
|
|
||||||
using ParadoxNotion.Services;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace NodeCanvas.Tasks.Actions {
|
|
||||||
|
|
||||||
[Category("Core/Movement")]
|
|
||||||
public class ProcessGravity : ActionTask<CharacterController>{
|
|
||||||
public BBParameter<float> gravityScale = 1f;
|
|
||||||
public BBParameter<float> gravityAcceleration = 1f;
|
|
||||||
public BBParameter<float> gravityMax = 8f;
|
|
||||||
|
|
||||||
private Vector3 currentVelocity;
|
|
||||||
private bool freezeVelocity;
|
|
||||||
|
|
||||||
private float gravityPower;
|
|
||||||
//Use for initialization. This is called only once in the lifetime of the task.
|
|
||||||
//Return null if init was successfull. Return an error string otherwise
|
|
||||||
protected override string OnInit(){
|
|
||||||
MonoManager.current.onLateUpdate += LateUpdate;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//This is called once each time the task is enabled.
|
|
||||||
//Call EndAction() to mark the action as finished, either in success or failure.
|
|
||||||
//EndAction can be called from anywhere.
|
|
||||||
protected override void OnExecute() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//Called once per frame while the action is active.
|
|
||||||
protected override void OnUpdate() {
|
|
||||||
if (!freezeVelocity && agent.velocity != Vector3.zero){
|
|
||||||
currentVelocity = new Vector3(agent.velocity.x, 0f, agent.velocity.y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LateUpdate(){
|
|
||||||
if (agent.isGrounded) {
|
|
||||||
gravityPower = 0f;
|
|
||||||
currentVelocity = Vector3.zero;
|
|
||||||
freezeVelocity = true;
|
|
||||||
agent.Move(Physics.gravity * .1f * Time.deltaTime);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (currentVelocity == Vector3.zero && agent.velocity.y < 0f) {
|
|
||||||
freezeVelocity = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Debug.Log(currentVelocity);
|
|
||||||
|
|
||||||
agent.Move((Physics.gravity * gravityPower * Time.deltaTime));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Called when the task is disabled.
|
|
||||||
protected override void OnStop() {
|
|
||||||
EndAction(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Called when the task is paused.
|
|
||||||
protected override void OnPause() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 5c6c0f191ca8a3d4cb402d351413dff3
|
|
||||||
@@ -6,7 +6,7 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace NodeCanvas.Tasks.Actions {
|
namespace NodeCanvas.Tasks.Actions {
|
||||||
|
|
||||||
[Category("Core/Movement")]
|
[Category("Reset/Movement")]
|
||||||
[Description("Finalizes movement and sends the final move commands to the controller")]
|
[Description("Finalizes movement and sends the final move commands to the controller")]
|
||||||
public class ProcessMovement : ActionTask<CharacterController>{
|
public class ProcessMovement : ActionTask<CharacterController>{
|
||||||
public BBParameter<Vector3> groundMoveDirection;
|
public BBParameter<Vector3> groundMoveDirection;
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ public class PlayerControls : MonoBehaviour{
|
|||||||
graph = GetComponent<GraphOwner>();
|
graph = GetComponent<GraphOwner>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Start(){
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnMove(InputValue value){
|
public void OnMove(InputValue value){
|
||||||
rawMoveInput.x = value.Get<Vector2>().x;
|
rawMoveInput.x = value.Get<Vector2>().x;
|
||||||
rawMoveInput.y = value.Get<Vector2>().y;
|
rawMoveInput.y = value.Get<Vector2>().y;
|
||||||
@@ -36,17 +33,10 @@ public class PlayerControls : MonoBehaviour{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void OnSprint(){
|
public void OnSprint(){
|
||||||
SendMessage("StartSprint");
|
|
||||||
graph.SendEvent<string>("InputEvent", "Sprint", null);
|
graph.SendEvent<string>("InputEvent", "Sprint", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnJump(){
|
public void OnJump(){
|
||||||
SendMessage("StartJump");
|
|
||||||
graph.SendEvent<string>("InputEvent", "Jump", null);
|
graph.SendEvent<string>("InputEvent", "Jump", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update(){
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,112 +1,48 @@
|
|||||||
using System;
|
|
||||||
using Sirenix.OdinInspector;
|
|
||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Unity.Mathematics;
|
|
||||||
using NodeCanvas.Framework;
|
|
||||||
using Drawing;
|
using Drawing;
|
||||||
|
|
||||||
public class PlayerMovement : MonoBehaviour
|
public class PlayerMovement : MonoBehaviour
|
||||||
{
|
{
|
||||||
// Speed
|
|
||||||
public float baseMoveSpeed = 5f;
|
|
||||||
public bool sprinting;
|
|
||||||
|
|
||||||
public float sprintAddtnlSpeed = 3f;
|
|
||||||
public float sprintAcceleration = 5f;
|
|
||||||
private float sprintPower;
|
|
||||||
|
|
||||||
// Gravity
|
|
||||||
private float gravityScale = 0f;
|
|
||||||
public float gravityAcceleration = 1f;
|
|
||||||
public float groundJumpGravity; // TODO: If I add more types of jumps, turn this into a class that contains the gravity, strenghth, and deaccel of each jump
|
|
||||||
public float airJumpGravity;
|
|
||||||
|
|
||||||
// Rotation
|
|
||||||
public float rotationSpeed = 5f;
|
|
||||||
public bool justATest;
|
|
||||||
|
|
||||||
// Jumping
|
|
||||||
public float jumpHeight;
|
|
||||||
public float jumpDeacceleration;
|
|
||||||
|
|
||||||
public int airJumpsCount;
|
|
||||||
public float airJumpStrength;
|
|
||||||
public float airJumpDeacceleration;
|
|
||||||
|
|
||||||
public float groundJumpStrength;
|
|
||||||
public float groundJumpDeacceleration;
|
|
||||||
|
|
||||||
[SerializeField] private float jumpPower;
|
|
||||||
public int airJumpsRemaining;
|
|
||||||
|
|
||||||
public JumpProfile groundJumpParams;
|
|
||||||
public JumpProfile initialAirJumpParams;
|
|
||||||
public JumpProfile followupAirJumpParams;
|
|
||||||
|
|
||||||
public JumpProfile currentJump;
|
|
||||||
|
|
||||||
// Raycasts
|
// Raycasts
|
||||||
public RaycastHit forwardRay;
|
public RaycastHit forwardRay;
|
||||||
public RaycastHit leftRay;
|
public RaycastHit leftRay;
|
||||||
public RaycastHit rightRay;
|
public RaycastHit rightRay;
|
||||||
|
|
||||||
|
|
||||||
[Serializable]
|
|
||||||
public class JumpProfile{
|
|
||||||
public float jumpGravityMultiplier;
|
|
||||||
public float jumpHeightMultiplier;
|
|
||||||
public float jumpDeaccelMultiplier;
|
|
||||||
|
|
||||||
public bool active;
|
|
||||||
|
|
||||||
public void UpdateActive(JumpProfile _active){
|
|
||||||
// if (Mathf.Approximately(_active.jumpHeightMultiplier, jumpHeightMultiplier)) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
active = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// References
|
// References
|
||||||
private Player thisPlayer;
|
private Player thisPlayer;
|
||||||
private CharacterController controller;
|
|
||||||
|
|
||||||
void Awake(){
|
void Awake(){
|
||||||
thisPlayer = GetComponent<Player>();
|
thisPlayer = GetComponent<Player>();
|
||||||
controller = GetComponent<CharacterController>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnDrawGizmos(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Update(){
|
void Update(){
|
||||||
//CheckContinuedSprinting();
|
// Create Ray Colors
|
||||||
//ProcessFlatSurfaceMovement();
|
Color forwardRayStatus = Color.red;
|
||||||
//ProcessRotation();
|
Color leftRayStatus = Color.red;
|
||||||
|
Color rightRayStatus = Color.red;
|
||||||
// // Debug Visualization Tools
|
|
||||||
// groundJumpParams.UpdateActive(currentJump);
|
|
||||||
// initialAirJumpParams.UpdateActive(currentJump);
|
|
||||||
// followupAirJumpParams.UpdateActive(currentJump);
|
|
||||||
|
|
||||||
Color forwardRayStatus = Color.red;
|
|
||||||
|
|
||||||
if (forwardRay.collider&& forwardRay.transform.gameObject.layer == LayerMask.NameToLayer("Environment")){ forwardRayStatus = Color.green;}
|
if (forwardRay.collider&& forwardRay.transform.gameObject.layer == LayerMask.NameToLayer("Environment")){ forwardRayStatus = Color.green;}
|
||||||
|
if (leftRay.collider&& leftRay.transform.gameObject.layer == LayerMask.NameToLayer("Environment")){ leftRayStatus = Color.green;}
|
||||||
|
if (rightRay.collider&& rightRay.transform.gameObject.layer == LayerMask.NameToLayer("Environment")){ rightRayStatus = Color.green;}
|
||||||
|
|
||||||
using (Draw.WithColor(forwardRayStatus)) {
|
using (Draw.WithColor(forwardRayStatus)) {
|
||||||
Draw.Line(transform.position + transform.up, transform.position + transform.forward * 2.5f + transform.up);
|
Draw.Line(transform.position + transform.up, transform.position + transform.forward * 2.5f + transform.up);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using (Draw.WithColor(leftRayStatus)) {
|
||||||
|
Draw.Line(transform.position + transform.up, transform.position + -transform.right * 2f + transform.up);
|
||||||
|
}
|
||||||
|
|
||||||
|
using (Draw.WithColor(rightRayStatus)) {
|
||||||
|
Draw.Line(transform.position + transform.up, transform.position + transform.right * 2f + transform.up);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FixedUpdate(){
|
void FixedUpdate(){
|
||||||
LayerMask environmentLayer = LayerMask.NameToLayer("Environment");
|
LayerMask environmentLayer = LayerMask.NameToLayer("Environment");
|
||||||
|
|
||||||
if (Physics.Raycast(transform.position + Vector3.up, transform.forward, out forwardRay, 2.5f, ~environmentLayer)){
|
if (Physics.Raycast(transform.position + Vector3.up, transform.forward, out forwardRay, 2.5f, ~environmentLayer)){
|
||||||
thisPlayer.controls.graph.SendEvent<bool>("ForwardRay", true, null);
|
thisPlayer.controls.graph.SendEvent("ForwardRay", true, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Physics.Raycast(transform.position + Vector3.up, transform.position + Vector3.left, out leftRay, maxDistance: 2f, ~environmentLayer )) {
|
if (Physics.Raycast(transform.position + Vector3.up, transform.position + Vector3.left, out leftRay, maxDistance: 2f, ~environmentLayer )) {
|
||||||
@@ -117,134 +53,4 @@ public class PlayerMovement : MonoBehaviour
|
|||||||
thisPlayer.controls.graph.SendEvent("RightRay", true, null);
|
thisPlayer.controls.graph.SendEvent("RightRay", true, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void ProcessFlatSurfaceMovement(){
|
|
||||||
// Get current input direction
|
|
||||||
Vector3 flatSurfaceDirection = Vector3.zero;
|
|
||||||
|
|
||||||
if (controller.isGrounded) {
|
|
||||||
Vector2 rawInput = thisPlayer.controls.rawMoveInput;
|
|
||||||
flatSurfaceDirection = new(rawInput.x, 0, rawInput.y);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Rotate input to forward direction for flat surface
|
|
||||||
flatSurfaceDirection = transform.rotation * flatSurfaceDirection;
|
|
||||||
|
|
||||||
// Finalize flat surface direction by adding speed
|
|
||||||
flatSurfaceDirection *= CalculateSpeed();
|
|
||||||
|
|
||||||
// Calculate gravity
|
|
||||||
if (!controller.isGrounded) {
|
|
||||||
gravityScale = Mathf.Lerp(gravityScale, Physics.gravity.y, gravityAcceleration * Time.deltaTime);
|
|
||||||
} else {
|
|
||||||
gravityScale = -.01f;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector3 gravityDirection = -Physics.gravity * gravityScale;
|
|
||||||
|
|
||||||
// Add and deteriorate jump
|
|
||||||
Vector3 jumpDirection = Vector3.zero;
|
|
||||||
|
|
||||||
jumpPower = Mathf.Lerp(jumpPower, 0f, jumpDeacceleration * Time.deltaTime);
|
|
||||||
|
|
||||||
jumpDirection = new Vector3(0, jumpPower, 0);
|
|
||||||
|
|
||||||
// Move character
|
|
||||||
// controller.Move((flatSurfaceDirection + gravityDirection) * Time.deltaTime);
|
|
||||||
|
|
||||||
// Reset Air Jumps and Jump Power on Grounded
|
|
||||||
if (controller.isGrounded) {
|
|
||||||
airJumpsRemaining = airJumpsCount;
|
|
||||||
jumpPower = 0f;
|
|
||||||
currentJump = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset Gravity Scale upon gaining air
|
|
||||||
if (!controller.isGrounded) {
|
|
||||||
//gravityScale = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AllocationTest(){
|
|
||||||
justATest = !justATest;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ProcessRotation(){
|
|
||||||
// Get current input direction
|
|
||||||
Vector2 rawInput = thisPlayer.controls.rawLookInput;
|
|
||||||
|
|
||||||
// Rotate character (times 360 to account for a full rotation taking 360 seconds otherwise)
|
|
||||||
// transform.Rotate(new Vector3(0, rawInput.x * rotationSpeed * 360f * Time.deltaTime));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void StartSprint(){
|
|
||||||
sprinting = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float CalculateSpeed(){
|
|
||||||
// Calculate sprinting speed
|
|
||||||
float outputSpeed = 0f;
|
|
||||||
|
|
||||||
// Add base speed
|
|
||||||
outputSpeed += baseMoveSpeed;
|
|
||||||
|
|
||||||
// Add sprinting speed
|
|
||||||
if (sprinting) {
|
|
||||||
sprintPower = Mathf.Lerp(sprintPower, 1, sprintAcceleration * Time.deltaTime);
|
|
||||||
outputSpeed += (sprintAddtnlSpeed * sprintPower);
|
|
||||||
} else {
|
|
||||||
outputSpeed += (sprintAddtnlSpeed * sprintPower);
|
|
||||||
sprintPower = Mathf.Lerp(sprintPower, 0, sprintAcceleration * Time.deltaTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
return outputSpeed;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CheckContinuedSprinting(){
|
|
||||||
if (sprinting) {
|
|
||||||
// Disable sprinting if analog stick is released too far
|
|
||||||
if (thisPlayer.controls.rawMoveInput.sqrMagnitude < .5f) {
|
|
||||||
sprinting = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disable sprinting if analog stick direction is not forward
|
|
||||||
Vector2 rawInput = thisPlayer.controls.rawMoveInput;
|
|
||||||
Vector3 rawInputToVector3 = new(rawInput.x, 0, rawInput.y);
|
|
||||||
float sprintVectorDot = Vector3.Dot(transform.InverseTransformVector(transform.forward), rawInputToVector3);
|
|
||||||
|
|
||||||
if (sprintVectorDot < 0.3f) {
|
|
||||||
sprinting = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartJump(){
|
|
||||||
// Replaced with Jump Type System
|
|
||||||
// if (controller.isGrounded) {
|
|
||||||
// jumpPower = jumpHeight * groundJumpStrength;
|
|
||||||
// } else if (!controller.isGrounded && airJumpsRemaining > 0) {
|
|
||||||
// Debug.Log(controller.isGrounded);
|
|
||||||
// jumpPower = jumpHeight * airJumpStrength;
|
|
||||||
// airJumpsRemaining--;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (controller.isGrounded) {
|
|
||||||
// currentJump = groundJumpParams;
|
|
||||||
// } else if (airJumpsRemaining > 2){
|
|
||||||
// currentJump = initialAirJumpParams;
|
|
||||||
// airJumpsRemaining--;
|
|
||||||
// } else if (airJumpsRemaining > 0) {
|
|
||||||
// currentJump = followupAirJumpParams;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (currentJump != null) {
|
|
||||||
// jumpPower = currentJump.jumpHeightMultiplier;
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user