4 Commits

Author SHA1 Message Date
Desmond Cheeseboro
f71ba6f5fe hai :3 2025-12-06 19:48:35 -05:00
Desmond Cheeseboro
92f9ef731b hai :3 2025-12-06 19:47:21 -05:00
Desmond Cheeseboro
59ab310615 hai :3 2025-12-06 19:43:40 -05:00
Chris
bbb735c9c1 maint: updated to unity 6.2 2025-08-31 17:37:36 -04:00
99 changed files with 1586 additions and 103119 deletions

View File

@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 9
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8

File diff suppressed because one or more lines are too long

View File

@@ -12,13 +12,13 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7a686a47eee2fa44cb0a34b5d86e4d5e, type: 3}
m_Name: GroundedCheckBT
m_EditorClassIdentifier:
_serializedGraph: '{"type":"NodeCanvas.BehaviourTrees.BehaviourTree","nodes":[{"repeaterMode":2,"repeatTimes":{"_value":1},"_position":{"x":476.0,"y":327.0},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"0"},{"_position":{"x":550.0,"y":433.0},"$type":"NodeCanvas.BehaviourTrees.Sequencer","$id":"1"},{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"09b3259f-8b50-439a-ab86-ea3d8a4916f1"},"valueB":{},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_position":{"x":458.0,"y":521.0},"$type":"NodeCanvas.BehaviourTrees.WaitUntil","$id":"2"},{"_position":{"x":478.0,"y":709.0},"$type":"NodeCanvas.BehaviourTrees.Sequencer","$id":"3"},{"_action":{"airMoveDirection":{"_name":"airMoveDirection","_targetVariableID":"2fc91db6-09dd-4a1f-9195-426a0c44de31"},"inputVector3":{"_name":"groundMoveDirection","_targetVariableID":"a2c4fe25-9549-4bdd-8cec-2dbfc4a8856f"},"$type":"NodeCanvas.Tasks.Actions.SetAirMovement"},"_position":{"x":294.0,"y":816.0},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"4"},{"_action":{"airMoveDirection":{"_name":"groundMoveDirection","_targetVariableID":"a2c4fe25-9549-4bdd-8cec-2dbfc4a8856f"},"inputVector3":{},"$type":"NodeCanvas.Tasks.Actions.SetAirMovement"},"_position":{"x":471.0,"y":817.0},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"5"},{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"09b3259f-8b50-439a-ab86-ea3d8a4916f1"},"valueB":{"_value":true},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_position":{"x":715.0,"y":523.0},"$type":"NodeCanvas.BehaviourTrees.WaitUntil","$id":"6"}],"connections":[{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"2"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"6"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"3"},"_isDisabled":true,"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"4"},"_isDisabled":true,"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"5"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"}],"canvasGroups":[],"localBlackboard":{"_variables":{}},"derivedData":{"repeat":true,"$type":"NodeCanvas.BehaviourTrees.BehaviourTree+DerivedSerializationData"}}'
_serializedGraph: '{"type":"NodeCanvas.BehaviourTrees.BehaviourTree","nodes":[{"repeaterMode":2,"repeatTimes":{"_value":1},"_position":{"x":476.0,"y":327.0},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"0"},{"_position":{"x":550.0,"y":433.0},"$type":"NodeCanvas.BehaviourTrees.Sequencer","$id":"1"},{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"09b3259f-8b50-439a-ab86-ea3d8a4916f1"},"valueB":{},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_position":{"x":458.0,"y":522.0},"$type":"NodeCanvas.BehaviourTrees.WaitUntil","$id":"2"},{"_action":{"airMoveDirection":{"_name":"airMoveDirection","_targetVariableID":"2fc91db6-09dd-4a1f-9195-426a0c44de31"},"inputVector3":{"_name":"groundMoveDirection","_targetVariableID":"a2c4fe25-9549-4bdd-8cec-2dbfc4a8856f"},"$type":"NodeCanvas.Tasks.Actions.SetAirMovement"},"_position":{"x":396.0,"y":655.0},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"3"},{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"09b3259f-8b50-439a-ab86-ea3d8a4916f1"},"valueB":{"_value":true},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_position":{"x":715.0,"y":523.0},"$type":"NodeCanvas.BehaviourTrees.WaitUntil","$id":"4"}],"connections":[{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"2"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"4"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"3"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"}],"canvasGroups":[],"localBlackboard":{"_variables":{}},"derivedData":{"repeat":true,"$type":"NodeCanvas.BehaviourTrees.BehaviourTree+DerivedSerializationData"}}'
_objectReferences: []
_graphSource:
_version: 3.31
_category:
_comments:
_translation: {x: 444, y: -12}
_translation: {x: 150, y: -43}
_zoomFactor: 1
_haltSerialization: 0
_externalSerializationFile: {fileID: 0}

View File

@@ -12,22 +12,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: f945e777233a59f4aba40aeca29093a6, type: 3}
m_Name: PlayerLocomotionFSM
m_EditorClassIdentifier:
_serializedGraph: '{"type":"NodeCanvas.StateMachines.FSM","nodes":[{"_actionList":{"executionMode":1,"actions":[]},"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_position":{"x":327.7592,"y":812.7609},"$type":"NodeCanvas.StateMachines.ActionState"},{"_actionList":{"executionMode":1,"actions":[{"moveSpeed":{"_value":12.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":10.0},"$type":"NodeCanvas.Tasks.Actions.SetFloat"},{"valueA":{"_name":"facingDirection","_targetVariableID":"c713d622-aafb-43e7-ae0e-ac0b86a85a37"},"valueB":{"_value":1},"$type":"NodeCanvas.Tasks.Actions.SetVariable`1[[PlayerFacingDirection,
Core, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}]},"_repeatStateActions":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_position":{"x":389.9924,"y":1029.762},"$type":"NodeCanvas.StateMachines.ActionState"},{"_position":{"x":218.6569,"y":475.1322},"$type":"NodeCanvas.StateMachines.AnyState","$id":"2"},{"_position":{"x":253.0,"y":606.9789},"$type":"NodeCanvas.StateMachines.EmptyState","$id":"3"},{"_onEnterList":{"executionMode":1,"actions":[{"valueA":{"_name":"facingDirection","_targetVariableID":"c713d622-aafb-43e7-ae0e-ac0b86a85a37"},"valueB":{"_value":1},"$type":"NodeCanvas.Tasks.Actions.SetVariable`1[[PlayerFacingDirection,
Core, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}]},"_onUpdateList":{"executionMode":1,"actions":[{"moveSpeed":{"_value":12.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":10.0},"$type":"NodeCanvas.Tasks.Actions.SetFloat"}]},"_onExitList":{"executionMode":1,"actions":[]},"foldEnter":true,"foldUpdate":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_position":{"x":535.0,"y":768.0},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"4"},{"_actionList":{"executionMode":1,"actions":[{"moveSpeed":{"_value":30.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":1.0},"$type":"NodeCanvas.Tasks.Actions.SetFloat"},{"valueA":{"_name":"facingDirection","_targetVariableID":"c713d622-aafb-43e7-ae0e-ac0b86a85a37"},"valueB":{"_value":2},"$type":"NodeCanvas.Tasks.Actions.SetVariable`1[[PlayerFacingDirection,
Core, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}]},"_repeatStateActions":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_position":{"x":917.0839,"y":852.7302},"$type":"NodeCanvas.StateMachines.ActionState","$id":"5"},{"_actionList":{"executionMode":1,"actions":[{"moveSpeed":{"_value":20.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":2.0},"$type":"NodeCanvas.Tasks.Actions.SetFloat"}]},"_repeatStateActions":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_position":{"x":1161.288,"y":522.152},"$type":"NodeCanvas.StateMachines.ActionState","$id":"6"},{"_actionList":{"executionMode":1,"actions":[{"moveSpeed":{"_value":5.0},"moveDirection":{"_name":"groundMoveDirection","_targetVariableID":"16ae5ce4-097a-4c21-94a5-2c5d9ce73eb6"},"$type":"NodeCanvas.Tasks.Actions.CalculateGroundedLocomotion"}]},"_repeatStateActions":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_position":{"x":602.0,"y":269.0},"$type":"NodeCanvas.StateMachines.ActionState","$id":"7"},{"_actionList":{"executionMode":1,"actions":[{"moveSpeed":{},"moveDirection":{"_name":"groundMoveDirection","_targetVariableID":"16ae5ce4-097a-4c21-94a5-2c5d9ce73eb6"},"$type":"NodeCanvas.Tasks.Actions.CalculateGroundedLocomotion"}]},"_repeatStateActions":true,"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_position":{"x":402.0,"y":177.0},"$type":"NodeCanvas.StateMachines.ActionState","$id":"8"}],"connections":[{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"321e55c7-f93e-4667-a0dc-559eb61c6898"},"valueB":{},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"3"},"_isDisabled":true,"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"eventName":{"_value":"Grapple
Aimed"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent"},"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"7"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"eventName":{"_value":"Grapple
Confirmed"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent"},"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"8"},"$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":"4"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"actionName":{"_value":"Sprint"},"actionPhase":{"_value":3},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},"_sourceNode":{"$ref":"4"},"_targetNode":{"$ref":"5"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"timeout":{"_value":0.1},"$type":"NodeCanvas.Tasks.Conditions.Timeout"},"_sourceNode":{"$ref":"5"},"_targetNode":{"$ref":"6"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"checkAgainst":2,"checkAgainstValue":{"_value":{"z":1.0}},"desiredValue":{"_value":1.0},"tolerance":{"_value":0.32},"considerCameraRotation":{},"negate":{},"$type":"NodeCanvas.Tasks.Conditions.GetMovementInputDotProduct"},"_sourceNode":{"$ref":"6"},"_targetNode":{"$ref":"4"},"$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":1161.288,"y":522.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,
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]]"},"facingDirection":{"_name":"facingDirection","_id":"c713d622-aafb-43e7-ae0e-ac0b86a85a37","_isPublic":true,"$type":"NodeCanvas.Framework.Variable`1[[PlayerFacingDirection,
Core, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}}}}'
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}}}}'
_objectReferences: []
_graphSource:
_version: 3.31
_category:
_comments:
_translation: {x: 467, y: -132}
_zoomFactor: 0.9793777
_translation: {x: 1, y: -175}
_zoomFactor: 0.9967056
_haltSerialization: 0
_externalSerializationFile: {fileID: 0}

View File

@@ -1,19 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1726182683, guid: a4865f1ab4504ed8a368670db22f409c, type: 3}
m_Name: AOTGenerationConfig
m_EditorClassIdentifier:
automateBeforeBuilds: 0
deleteDllAfterBuilds: 1
AutomateForAllAOTPlatforms: 1
automateForPlatforms: 0900000014000000
supportSerializedTypes: []

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 516c69467762d38429c69cc7107c0555
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,136 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 772478971, guid: a4865f1ab4504ed8a368670db22f409c, type: 3}
m_Name: ColorPaletteManager
m_EditorClassIdentifier:
colorPalettes:
- name: Country
showAlpha: 0
colors:
- {r: 0.776, g: 0.651, b: 0.349, a: 1}
- {r: 0.863, g: 0.761, b: 0.631, a: 1}
- {r: 0.91, g: 0.831, b: 0.686, a: 1}
- {r: 0.961, g: 0.902, b: 0.788, a: 1}
- {r: 0.753, g: 0.714, b: 0.667, a: 1}
- {r: 0.478, g: 0.573, b: 0.431, a: 1}
- {r: 0.314, g: 0.427, b: 0.31, a: 1}
- {r: 0.596, g: 0.345, b: 0.235, a: 1}
- {r: 0.545, g: 0.329, b: 0.318, a: 1}
- {r: 0.647, g: 0.204, b: 0.227, a: 1}
- {r: 0.435, g: 0.161, b: 0.063, a: 1}
- {r: 0.357, g: 0.333, b: 0.278, a: 1}
- {r: 0.976, g: 0.98, b: 0.961, a: 1}
- {r: 0.165, g: 0.271, b: 0.11, a: 1}
- name: Beach
showAlpha: 0
colors:
- {r: 0.996, g: 0.906, b: 0.459, a: 1}
- {r: 0.314, g: 0.592, b: 0.035, a: 1}
- {r: 0.486, g: 0.953, b: 0.875, a: 1}
- {r: 0.996, g: 0.82, b: 0.212, a: 1}
- {r: 1, g: 0.769, b: 0.165, a: 1}
- {r: 0.804, g: 0.835, b: 0.753, a: 1}
- {r: 1, g: 0.769, b: 0.165, a: 1}
- {r: 1, g: 0.702, b: 0.063, a: 1}
- {r: 1, g: 0.898, b: 0.569, a: 1}
- name: Fall
showAlpha: 0
colors:
- {r: 0.82, g: 0.722, b: 0.318, a: 1}
- {r: 0.537, g: 0.192, b: 0.153, a: 1}
- {r: 0.996, g: 0.812, b: 0.012, a: 1}
- {r: 1, g: 0.431, b: 0.02, a: 1}
- {r: 0.937, g: 0.267, b: 0.094, a: 1}
- {r: 0.42, g: 0.212, b: 0.18, a: 1}
- {r: 0.992, g: 0.651, b: 0.004, a: 1}
- {r: 0.89, g: 0.353, b: 0.086, a: 1}
- {r: 1, g: 0.443, b: 0.004, a: 1}
- {r: 0.682, g: 0.275, b: 0.137, a: 1}
- {r: 0.306, g: 0.231, b: 0.114, a: 1}
- {r: 0.384, g: 0.416, b: 0.082, a: 1}
- {r: 0.165, g: 0.157, b: 0.008, a: 1}
- {r: 0.906, g: 0.635, b: 0.227, a: 1}
- {r: 0.82, g: 0.722, b: 0.318, a: 1}
- {r: 0.745, g: 0.435, b: 0.031, a: 1}
- {r: 0.765, g: 0.682, b: 0.569, a: 1}
- {r: 0.18, g: 0.149, b: 0.075, a: 1}
- {r: 0.702, g: 0.451, b: 0.059, a: 1}
- name: Passion
showAlpha: 0
colors:
- {r: 0.925, g: 0.682, b: 0.624, a: 1}
- {r: 0.188, g: 0.114, b: 0.224, a: 1}
- {r: 0.349, g: 0.11, b: 0.231, a: 1}
- {r: 0.435, g: 0.267, b: 0.357, a: 1}
- name: Sepia
showAlpha: 0
colors:
- {r: 0.353, g: 0.098, b: 0.02, a: 1}
- {r: 0.663, g: 0.188, b: 0.114, a: 1}
- {r: 0.906, g: 0.643, b: 0.082, a: 1}
- {r: 0.996, g: 0.839, b: 0.322, a: 1}
- {r: 0.486, g: 0.392, b: 0.02, a: 1}
- {r: 0.294, g: 0.235, b: 0.012, a: 1}
- name: Floral
showAlpha: 0
colors:
- {r: 0.855, g: 0.518, b: 0.412, a: 1}
- {r: 0.827, g: 0.294, b: 0.333, a: 1}
- {r: 0.737, g: 0.118, b: 0.208, a: 1}
- {r: 0.549, g: 0.149, b: 0.235, a: 1}
- {r: 0.949, g: 0.925, b: 0.784, a: 1}
- {r: 0.945, g: 0.882, b: 0.69, a: 1}
- {r: 0.871, g: 0.812, b: 0.698, a: 1}
- {r: 0.4, g: 0.196, b: 0.243, a: 1}
- {r: 0.271, g: 0.157, b: 0.227, a: 1}
- name: Underwater
showAlpha: 0
colors:
- {r: 0.663, g: 0.416, b: 0.733, a: 1}
- {r: 0.2, g: 0.6, b: 0.698, a: 1}
- {r: 0.11, g: 0.49, b: 0.698, a: 1}
- {r: 0.439, g: 0.627, b: 0.227, a: 1}
- {r: 0, g: 0.357, b: 0.604, a: 1}
- {r: 0.067, g: 0.271, b: 0.353, a: 1}
- name: Breeze
showAlpha: 0
colors:
- {r: 0.706, g: 1, b: 0, a: 1}
- {r: 0.651, g: 1, b: 0.404, a: 1}
- {r: 0.122, g: 1, b: 0.514, a: 1}
- {r: 0.216, g: 0.894, b: 0.961, a: 1}
- {r: 0.4, g: 1, b: 0.882, a: 1}
- {r: 0.027, g: 0.792, b: 0.8, a: 1}
- name: Clovers
showAlpha: 0
colors:
- {r: 0.431, g: 0.549, b: 0.102, a: 1}
- {r: 0.671, g: 0.714, b: 0.071, a: 1}
- {r: 0.969, g: 0.949, b: 0.831, a: 1}
- {r: 0.886, g: 0.902, b: 0.702, a: 1}
- {r: 0.753, g: 0.824, b: 0.627, a: 1}
- {r: 0.404, g: 0.6, b: 0.4, a: 1}
- name: Tropical
showAlpha: 0
colors:
- {r: 0.953, g: 0.647, b: 0.804, a: 1}
- {r: 0.965, g: 0.741, b: 0.871, a: 1}
- {r: 0.949, g: 0.549, b: 0.643, a: 1}
- {r: 0.992, g: 0.659, b: 0.498, a: 1}
- {r: 0.976, g: 0.792, b: 0.729, a: 1}
- {r: 0.984, g: 0.855, b: 0.725, a: 1}
- {r: 0.259, g: 0.882, b: 0.663, a: 1}
- {r: 0.349, g: 0.753, b: 0.78, a: 1}
- {r: 0.725, g: 0.976, b: 0.91, a: 1}
- {r: 0.647, g: 0.745, b: 0.957, a: 1}
- {r: 0.725, g: 0.863, b: 0.973, a: 1}
- {r: 0.89, g: 0.945, b: 0.996, a: 1}

View File

@@ -1,15 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 188390376, guid: a4865f1ab4504ed8a368670db22f409c, type: 3}
m_Name: ImportSettingsConfig
m_EditorClassIdentifier:
automateBeforeBuild: 1

View File

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

View File

@@ -1,21 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b8d78c77b27bcee4792dedf004b44012, type: 3}
m_Name: InputSignal
m_EditorClassIdentifier:
_parameters:
- _ID: e1c42702-42ed-4f84-b52d-4e72b42a7de5
_name: action
_type: UnityEngine.InputSystem.InputAction
- _ID: 95540415-c9c3-4b53-87b6-97dcfb13cf6e
_name: phase
_type: UnityEngine.InputSystem.InputActionPhase

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,14 @@
using System;
using UnityEngine;
public class GenericLockOnTarget : MonoBehaviour, ILockOnTarget{
public float lockonTargetRadius{ get; set; } = 1f;
public void OnTargetDelete(){
GetComponent<ILockOnTarget>().SafelyDeleteTarget();
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start(){
}
void OnDestroy(){
OnTargetDelete();
void Update(){
}
}

View File

@@ -10,21 +10,19 @@ using Reset.Player.Movement;
namespace NodeCanvas.Tasks.Actions {
[Category("Reset/Movement")]
public class AddJump : ActionTask<CharacterController> {
public BBParameter<Vector3> airMoveDirection;
public BBParameter<float> jumpPower;
[Space(5)]
public BBParameter<float> jumpStrength;
public BBParameter<Vector3> airMoveDirection;
public BBParameter<PlayerFacingDirection> playerFacingDirection;
[SliderField(0, 1)]
[Range(0f, 1f)]
public BBParameter<float> standStillJumpStrength;
public BBParameter<float> jumpPower;
[Tooltip("Determines how much current movement vectors into jump direction")]
[SliderField(0, 1)]
public BBParameter<float> currentVelocityInheritence;
public BBParameter<Vector3> directionalForce;
[SliderField(0, 1)]
public BBParameter<float> directionalForceStrength;
protected override string info {
@@ -74,12 +72,9 @@ namespace NodeCanvas.Tasks.Actions {
// Check threshold of current XZ velocity- if it's too close to zero, use the jumpStrength for jumping velocity. If it's not, use the current velocity
float velocityThreshold = 4f;
float magnitudeZeroDifference = Mathf.Clamp(currentVelocityVector3.magnitude - velocityThreshold, 0f, Mathf.Infinity) / velocityThreshold; // Divided by maximum to return a 0-1 value. Clamping not required.
float outputHoritontalVelocity = Mathf.Lerp(jumpStrength.value, currentVelocityVector3.magnitude, Math.Clamp(magnitudeZeroDifference, 0f, 1f));
outputHoritontalVelocity = Mathf.Min(outputHoritontalVelocity, Mathf.Lerp(standStillJumpStrength.value * jumpStrength.value, jumpStrength.value * .4f, magnitudeZeroDifference));
float outputVelocity = Mathf.Lerp(jumpStrength.value, currentVelocityVector3.magnitude, Math.Clamp(magnitudeZeroDifference, 0f, 1f));
// Do the same for directional jump strength
outputHoritontalVelocity = Mathf.Lerp(outputHoritontalVelocity, jumpStrength.value, directionalForceStrength.value);
outputVelocity = Mathf.Min(outputVelocity, Mathf.Lerp(standStillJumpStrength.value * jumpStrength.value, jumpStrength.value * .4f, magnitudeZeroDifference));
// Remap the dot to set -1 (opposing direction) to -.5f, and 1 (same direciton) to 1.2f
// This is done to allow some sideways jumping direction change, but none backwards, and all forwards
@@ -99,7 +94,7 @@ namespace NodeCanvas.Tasks.Actions {
outputDirection = Camera.main.transform.rotation.Flatten(0, null, 0) * outputDirection;
// Set air move direction
airMoveDirection.value += outputDirection * outputHoritontalVelocity;
airMoveDirection.value += outputDirection * outputVelocity;
}
EndAction(true);
}

View File

@@ -3,13 +3,16 @@ using ParadoxNotion.Design;
using UnityEngine;
using Reset.Player.Movement;
namespace NodeCanvas.Tasks.Actions {
[Category("Reset/Movement")]
public class CalculateAirMovement : ActionTask<Transform>{
public BBParameter<Vector3> airMoveDirection;
public BBParameter<Vector3> groundMoveDirection; // Unused on 7/29/25, delete if still unusued later
public BBParameter<Vector3> groundMoveDirection;
public BBParameter<PlayerFacingDirection> playerFacingDirection;
private float airControlPower = 1f;
//Use for initialization. This is called only once in the lifetime of the task.
@@ -22,7 +25,7 @@ namespace NodeCanvas.Tasks.Actions {
//Call EndAction() to mark the action as finished, either in success or failure.
//EndAction can be called from anywhere.
protected override void OnExecute(){
airControlPower = 1f;
}
//Called once per frame while the action is active.
@@ -31,7 +34,7 @@ namespace NodeCanvas.Tasks.Actions {
airMoveDirection.value = Vector3.Lerp(airMoveDirection.value, Vector3.zero, .7f * Time.deltaTime);
// Decay Air Control power
airControlPower = Mathf.Lerp(airControlPower, 0f, 2f * Time.deltaTime);
airControlPower = Mathf.Lerp(airControlPower, 0f, 3f * Time.deltaTime);
// Add air control
Vector3 inputVector3 = new(agent.GetComponent<PlayerControls>().rawMoveInput.x, 0f, agent.GetComponent<PlayerControls>().rawMoveInput.y);
@@ -44,7 +47,7 @@ namespace NodeCanvas.Tasks.Actions {
//Called when the task is disabled.
protected override void OnStop() {
// groundMoveDirection.value = agent.GetComponent<CharacterController>().velocity;
groundMoveDirection.value = agent.GetComponent<CharacterController>().velocity;
EndAction(true);
}

View File

@@ -0,0 +1,47 @@
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
namespace NodeCanvas.Tasks.Conditions {
[Category("Core/Input")]
[Description("Returns a float from two Vector3s")]
public class GetMovementInputDotProduct : ConditionTask<PlayerControls>{
[SliderField(0f,1f)]
public BBParameter<Vector3> desiredVector3;
public BBParameter<float> tolerance;
public BBParameter<bool> negate;
//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(){
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 bool OnCheck(){
Vector3 rawInputVector3 = new(agent.rawMoveInput.x, 0f, agent.rawMoveInput.y);
float dotProduct = Vector3.Dot(desiredVector3.value, rawInputVector3);
//Debug.Log(dotProduct);
if (dotProduct < tolerance.value) {
return true;
}
return false;
}
//Called when the task is disabled.
protected override void OnEnable() {
}
//Called when the task is paused.
protected override void OnDisable() {
}
}
}

View File

@@ -1,121 +0,0 @@
using System;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using ParadoxNotion.Serialization.FullSerializer;
using Sirenix.OdinInspector;
using UnityEngine;
namespace NodeCanvas.Tasks.Actions {
[Category("Reset")]
[Description("Update the agent's position and rotation (scale too, sure whynot) either instantly or over time.")]
public class ChangeAgentTransform : ActionTask<CharacterController>{
public enum TransformProperty{
Position,
Rotation,
Scale
}
protected override string info {
get{
string basicText = string.Format($"Player {targetProperty.ToString()} to {(targetValue.isPresumedDynamic ? targetValue.name : targetValue.value)}");
basicText += relativeToSelf.value ? ", relative to Self" : "";
return basicText;
}
}
public TransformProperty targetProperty;
[ParadoxNotion.Design.ShowIf("targetProperty", 1), Space(5)]
public BBParameter<bool> forcePositionChange;
public BBParameter<Vector3> targetValue;
public BBParameter<bool> relativeToSelf;
[Tooltip("Set this to the current position if you're trying to rotate by 'this much'. Keep it zero for world space values.")]
public BBParameter<Vector3> relativeValue;
public BBParameter<bool> changeInstantly;
public BBParameter<float> smoothing;
private Vector3 currentVel;
//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() {
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() {
switch (targetProperty) {
case TransformProperty.Position:
Vector3 relativeUseValue = relativeValue.value;
if (relativeToSelf.value) {
relativeUseValue = agent.transform.position;
}
if (changeInstantly.value) {
agent.Move(agent.transform.position.DirectionTo(relativeUseValue + targetValue.value));
}
break;
case TransformProperty.Rotation:
agent.transform.rotation = Quaternion.LookRotation(relativeValue.value) * Quaternion.Euler(targetValue.value);
break;
case TransformProperty.Scale:
break;
default:
throw new ArgumentOutOfRangeException();
}
if (changeInstantly.value) {
EndAction(true);
}
}
//Called once per frame while the action is active.
protected override void OnUpdate() {
switch (targetProperty) {
case TransformProperty.Position:
Vector3 relativeUseValue = relativeValue.value;
if (relativeToSelf.value) {
relativeUseValue = agent.transform.position;
}
if (!changeInstantly.value) {
Vector3 targetPosition = relativeUseValue + targetValue.value;
// agent.transform.position = Vector3.SmoothDamp(agent.transform.position, targetPosition,
// ref currentVel, smoothing.value * Time.deltaTime);
agent.Move((agent.transform.position.DirectionTo(targetPosition)).normalized * .5f * Mathf.Lerp(0, 1, Vector3.Distance(agent.transform.position, targetPosition)) * smoothing.value * Time.deltaTime);
EndAction();
}
break;
case TransformProperty.Rotation:
agent.transform.rotation = Quaternion.Euler(relativeValue.value) * Quaternion.Euler(targetValue.value);
break;
case TransformProperty.Scale:
break;
default:
throw new ArgumentOutOfRangeException();
}
}
//Called when the task is disabled.
protected override void OnStop() {
}
//Called when the task is paused.
protected override void OnPause() {
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: b77e2b9ac9aad644480508d5a86f4006

View File

@@ -1,36 +1,342 @@
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using Reset.Core;
using Unity.Cinemachine;
using UnityEditor;
using UnityEngine;
// Individual bool setting for each ring. Three of these will be used.
public struct OrbitalFollowValueGroup{
public string label;
public CameraSettingsToggle changeHeight;
public float height;
public CameraSettingsToggle changeRadius;
public float radius;
public OrbitalFollowValueGroup(string newLabel){
label = newLabel;
changeHeight = CameraSettingsToggle.NoChange;
height = 0f;
changeRadius = CameraSettingsToggle.NoChange;
radius = 0f;
}
}
// Setting for any X and Y based values
public struct CinemachineVectorValueGroup{
public CameraSettingsToggle changeX;
public float xValue;
public CameraSettingsToggle changeY;
public float yValue;
}
// Enum options for individual camera settings
public enum CameraSettingsToggle{
NoChange,
NewValue,
ResetValue,
}
public struct Vector3CameraValueGroup{
public string label;
public Vector3 newValue;
public CameraSettingsToggle changeX;
public CameraSettingsToggle changeY;
public CameraSettingsToggle changeZ;
public Vector3CameraValueGroup(string newLabel){
changeX = CameraSettingsToggle.NoChange;
changeY = CameraSettingsToggle.NoChange;
changeZ = CameraSettingsToggle.NoChange;
newValue = Vector3.zero;
label = newLabel;
}
}
public struct Vector2CameraValueGroup{
public string label;
public Vector2 newValue;
public CameraSettingsToggle changeX;
public CameraSettingsToggle changeY;
public Vector2CameraValueGroup(string newLabel){
changeX = CameraSettingsToggle.NoChange;
changeY = CameraSettingsToggle.NoChange;
newValue = Vector2.zero;
label = newLabel;
}
}
public struct FloatCameraValueGroup{
public string label;
public float value;
public CameraSettingsToggle changeValue;
public FloatCameraValueGroup(string newLabel){
label = newLabel;
value = 0f;
changeValue = CameraSettingsToggle.NoChange;
}
}
#if UNITY_EDITOR
public class FloatCameraValueGroupDrawer : ObjectDrawer<FloatCameraValueGroup> {
public override FloatCameraValueGroup OnGUI(GUIContent _content, FloatCameraValueGroup _instance){
// Remove label for floats
EditorGUIUtility.labelWidth = 50;
// Set layout options for the label and the float fields
GUILayoutOption[] floatOptions = new GUILayoutOption[] {
GUILayout.Width(80.0f),
GUILayout.MinWidth(20.0f),
GUILayout.ExpandWidth(true),
};
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
GUILayout.Width(200.0f),
};
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
GUILayout.BeginVertical();
GUILayout.Label(_instance.ToString(), labelOptions);
GUILayout.BeginHorizontal();
// Create the x settings enum
_instance.changeValue = (CameraSettingsToggle)EditorGUILayout.EnumPopup("", instance.changeValue);
// Create the value/disabled information field
if (_instance.changeValue == CameraSettingsToggle.NewValue){
_instance.value = EditorGUILayout.FloatField(_instance.value, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeValue == CameraSettingsToggle.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// Close this line up
GUILayout.EndHorizontal();
GUILayout.EndVertical();
// Reset to default so the rest of things don't get messed up
EditorGUIUtility.labelWidth = 0;
return _instance;
}
}
public class Vector3CameraValueGroupDrawer : ObjectDrawer<Vector3CameraValueGroup> {
public override Vector3CameraValueGroup OnGUI(GUIContent _content, Vector3CameraValueGroup _instance){
// Remove label for floats
EditorGUIUtility.labelWidth = 20;
// Set layout options for the label and the float fields
GUILayoutOption[] floatOptions = new GUILayoutOption[] {
GUILayout.Width(300.0f),
GUILayout.MinWidth(20.0f),
GUILayout.ExpandWidth(true),
};
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
GUILayout.Width(200.0f),
};
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
GUILayout.BeginVertical();
GUILayout.Label(_instance.ToString(), labelOptions);
GUILayout.BeginHorizontal();
// Create the x settings enum
_instance.changeX = (CameraSettingsToggle)EditorGUILayout.EnumPopup("", instance.changeX);
// Create the value/disabled information field
if (_instance.changeX == CameraSettingsToggle.NewValue){
_instance.newValue.x = EditorGUILayout.FloatField(_instance.newValue.x, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeX == CameraSettingsToggle.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// It do what it do.
GUILayout.Space(5);
// Create the y settings enum
_instance.changeY = (CameraSettingsToggle)EditorGUILayout.EnumPopup("", _instance.changeY);
// Create the value/disabled information field
if (_instance.changeY == CameraSettingsToggle.NewValue){
_instance.newValue.y = EditorGUILayout.FloatField(_instance.newValue.y, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeY == CameraSettingsToggle.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// It do what it do.
GUILayout.Space(5);
// Create the y settings enum
_instance.changeZ = (CameraSettingsToggle)EditorGUILayout.EnumPopup("", _instance.changeZ);
// Create the value/disabled information field
if (_instance.changeZ == CameraSettingsToggle.NewValue){
_instance.newValue.z = EditorGUILayout.FloatField(_instance.newValue.z, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeZ == CameraSettingsToggle.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// Close this line up
GUILayout.EndHorizontal();
GUILayout.EndVertical();
// Reset to default so the rest of things don't get messed up
EditorGUIUtility.labelWidth = 0;
return _instance;
}
}
public class Vector2CameraValueGroupDrawer : ObjectDrawer<Vector2CameraValueGroup> {
public override Vector2CameraValueGroup OnGUI(GUIContent _content, Vector2CameraValueGroup _instance){
// Remove label for floats
EditorGUIUtility.labelWidth = 50;
// Set layout options for the label and the float fields
GUILayoutOption[] floatOptions = new GUILayoutOption[] {
GUILayout.Width(300.0f),
GUILayout.MinWidth(20.0f),
GUILayout.ExpandWidth(true),
};
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
GUILayout.Width(200.0f),
};
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
GUILayout.BeginVertical();
GUILayout.Label(_instance.ToString(), labelOptions);
GUILayout.BeginHorizontal();
// Create the x settings enum
_instance.changeX = (CameraSettingsToggle)EditorGUILayout.EnumPopup("", instance.changeX);
// Create the value/disabled information field
if (_instance.changeX == CameraSettingsToggle.NewValue){
_instance.newValue.x = EditorGUILayout.FloatField(_instance.newValue.x, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeX == CameraSettingsToggle.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// It do what it do.
GUILayout.Space(5);
// Create the y settings enum
_instance.changeY = (CameraSettingsToggle)EditorGUILayout.EnumPopup("", _instance.changeY);
// Create the value/disabled information field
if (_instance.changeY == CameraSettingsToggle.NewValue){
_instance.newValue.y = EditorGUILayout.FloatField(_instance.newValue.y, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeY == CameraSettingsToggle.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// Close this line up
GUILayout.EndHorizontal();
GUILayout.EndVertical();
// Reset to default so the rest of things don't get messed up
EditorGUIUtility.labelWidth = 0;
return _instance;
}
}
// Custom editor for each orbital follow ring setting
public class OrbitalFollowValueGroupDrawer : ObjectDrawer<OrbitalFollowValueGroup>{
public override OrbitalFollowValueGroup OnGUI(GUIContent _content, OrbitalFollowValueGroup _instance){
// Remove label for floats
EditorGUIUtility.labelWidth = 1;
// Set layout options for the label and the float fields
GUILayoutOption[] floatOptions = new GUILayoutOption[] {
GUILayout.Width(300.0f),
GUILayout.MinWidth(20.0f),
GUILayout.ExpandWidth(true),
};
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
GUILayout.Width(60.0f),
};
// Start a Horiztonal Section
GUILayout.BeginHorizontal();
// Add the left side label
GUILayout.Label(_instance.label, labelOptions);
// Create the height settings enum
_instance.changeHeight = (CameraSettingsToggle)EditorGUILayout.EnumPopup("", _instance.changeHeight);
// Create the value/disabled information field
if (_instance.changeHeight == CameraSettingsToggle.NewValue){
_instance.height = EditorGUILayout.FloatField(_instance.height, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeHeight == CameraSettingsToggle.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// It do what it do.
GUILayout.Space(5);
// Create the radius settings enum
_instance.changeRadius = (CameraSettingsToggle)EditorGUILayout.EnumPopup("", _instance.changeRadius);
// Create the value/disabled information field
if (_instance.changeRadius == CameraSettingsToggle.NewValue){
_instance.radius = EditorGUILayout.FloatField(_instance.radius, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeRadius == CameraSettingsToggle.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// Close this line up
GUILayout.EndHorizontal();
// Reset to default so the rest of things don't get messed up
EditorGUIUtility.labelWidth = 0;
return _instance;
}
}
#endif
namespace NodeCanvas.Tasks.Actions {
[Category("Reset")]
[Description("Change Cinemachine camera settings for the player")]
public class ChangeCameraSettings : ActionTask{
[ParadoxNotion.Design.Header("Main Settings")]
public FloatValueGroup fieldOfView = new (newLabel: "FOV");
[ParadoxNotion.Design.Header("Orbit Follow Ring Settings"), Space (5)]
public Vector3ValueGroup orbitTargetOffset = new(newLabel: "Target Offset");
[Space(5)]public Vector3ValueGroup orbitPositionDamping = new(newLabel: "Position Damping");
public FloatCameraValueGroup fieldOfView = new (newLabel: "FOV");
[ParadoxNotion.Design.Header("Orbit Follow Ring Settings")]
public OrbitalFollowValueGroup orbitFollowTop = new (newLabel: "Top");
public OrbitalFollowValueGroup orbitFollowCenter = new (newLabel: "Center");
public OrbitalFollowValueGroup orbitFollowBottom = new (newLabel: "Bottom");
public BoolValueGroup enableXAxis = new (newLabel: "Input Axis X Enabled");
public BoolValueGroup enableYAxis = new (newLabel: "Input Axis Y Enabled");
public FloatValueGroup axisLookXGain = new (newLabel: "Look Orbit X Gain");
public FloatValueGroup axisLookYGain = new (newLabel: "Look Orbit Y Gain");
[ParadoxNotion.Design.Header("Rotation Composer Settings")]
public Vector2ValueGroup screenPosition = new (newLabel: "Screen Position");
public Vector2CameraValueGroup screenPosition = new (newLabel: "Screen Position");
[ParadoxNotion.Design.Header("Camera Offset Settings")]
public Vector3ValueGroup cameraOffset = new (newLabel: "Offset");
public Vector3CameraValueGroup cameraOffset = new (newLabel: "Screen Position");
//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
@@ -42,119 +348,122 @@ namespace NodeCanvas.Tasks.Actions {
//Call EndAction() to mark the action as finished, either in success or failure.
//EndAction can be called from anywhere.
protected override void OnExecute(){
UpdateOrbitFollowValue(orbitFollowTop, ref CameraSettingsProcessor.values.orbitFollowTopHeight, ref CameraSettingsProcessor.values.orbitFollowTopRadius);
UpdateOrbitFollowValue(orbitFollowCenter, ref CameraSettingsProcessor.values.orbitFollowCenterHeight, ref CameraSettingsProcessor.values.orbitFollowCenterRadius);
UpdateOrbitFollowValue(orbitFollowBottom, ref CameraSettingsProcessor.values.orbitFollowBottomHeight, ref CameraSettingsProcessor.values.orbitFollowBottomRadius);
// Switch case farm for checking if values should be changed and what to
// Field of view
switch (fieldOfView.changeValue) {
case CameraSettingsToggle.NewValue:
CameraSettingsProcessor.values.mainFieldOfView.targetValue = fieldOfView.value;
break;
case CameraSettingsToggle.ResetValue:
CameraSettingsProcessor.values.mainFieldOfView.Reset();
break;
}
UpdateVector3Value(cameraOffset, ref CameraSettingsProcessor.values.cameraOffsetOffset);
// Orbit follow rings
switch (orbitFollowTop.changeHeight) {
case CameraSettingsToggle.NewValue:
CameraSettingsProcessor.values.orbitFollowTopHeight.targetValue = orbitFollowTop.height;
break;
case CameraSettingsToggle.ResetValue:
CameraSettingsProcessor.values.orbitFollowTopHeight.Reset();
break;
}
UpdateVector3Value(orbitPositionDamping, ref CameraSettingsProcessor.values.orbitPositionDamping);
UpdateVector3Value(orbitTargetOffset, ref CameraSettingsProcessor.values.orbitTargetOffset);
switch (orbitFollowTop.changeRadius) {
case CameraSettingsToggle.NewValue:
CameraSettingsProcessor.values.orbitFollowTopRadius.targetValue = orbitFollowTop.radius;
break;
case CameraSettingsToggle.ResetValue:
CameraSettingsProcessor.values.orbitFollowTopRadius.Reset();
break;
}
UpdateVector2Value(screenPosition, ref CameraSettingsProcessor.values.rotationComposerScreenPos);
UpdateFloatValue(fieldOfView, ref CameraSettingsProcessor.values.mainFieldOfView);
switch (orbitFollowCenter.changeHeight) {
case CameraSettingsToggle.NewValue:
CameraSettingsProcessor.values.orbitFollowCenterHeight.targetValue = orbitFollowCenter.height;
break;
case CameraSettingsToggle.ResetValue:
CameraSettingsProcessor.values.orbitFollowCenterHeight.Reset();
break;
}
UpdateFloatValue(axisLookXGain, ref CameraSettingsProcessor.values.axisLookGainX);
UpdateFloatValue(axisLookYGain, ref CameraSettingsProcessor.values.axisLookGainY);
switch (orbitFollowCenter.changeRadius) {
case CameraSettingsToggle.NewValue:
CameraSettingsProcessor.values.orbitFollowCenterRadius.targetValue = orbitFollowCenter.radius;
break;
case CameraSettingsToggle.ResetValue:
CameraSettingsProcessor.values.orbitFollowCenterRadius.Reset();
break;
}
UpdateBoolValue(enableXAxis, ref CameraSettingsProcessor.values.axisLookEnabledX);
UpdateBoolValue(enableYAxis, ref CameraSettingsProcessor.values.axisLookEnabledY);
switch (orbitFollowBottom.changeHeight) {
case CameraSettingsToggle.NewValue:
CameraSettingsProcessor.values.orbitFollowBottomHeight.targetValue = orbitFollowBottom.height;
break;
case CameraSettingsToggle.ResetValue:
CameraSettingsProcessor.values.orbitFollowBottomHeight.Reset();
break;
}
switch (orbitFollowBottom.changeRadius) {
case CameraSettingsToggle.NewValue:
CameraSettingsProcessor.values.orbitFollowBottomRadius.targetValue = orbitFollowBottom.radius;
break;
case CameraSettingsToggle.ResetValue:
CameraSettingsProcessor.values.orbitFollowBottomRadius.Reset();
break;
}
// Screen Position
switch (screenPosition.changeX) {
case CameraSettingsToggle.NewValue:
CameraSettingsProcessor.values.rotationComposerScreenPos.targetValue.x = screenPosition.newValue.x;
break;
case CameraSettingsToggle.ResetValue:
CameraSettingsProcessor.values.rotationComposerScreenPos.targetValue.x = CameraSettingsProcessor.values.rotationComposerScreenPos.originalValue.x;
break;
}
switch (screenPosition.changeY) {
case CameraSettingsToggle.NewValue:
CameraSettingsProcessor.values.rotationComposerScreenPos.targetValue.y = screenPosition.newValue.y;
break;
case CameraSettingsToggle.ResetValue:
CameraSettingsProcessor.values.rotationComposerScreenPos.targetValue.y = CameraSettingsProcessor.values.rotationComposerScreenPos.originalValue.y;
break;
}
// Camera Offset
switch (cameraOffset.changeX) {
case CameraSettingsToggle.NewValue:
CameraSettingsProcessor.values.cameraOffsetOffset.targetValue.x = cameraOffset.newValue.x;
break;
case CameraSettingsToggle.ResetValue:
CameraSettingsProcessor.values.cameraOffsetOffset.targetValue.x = CameraSettingsProcessor.values.cameraOffsetOffset.originalValue.x;
break;
}
switch (cameraOffset.changeY) {
case CameraSettingsToggle.NewValue:
CameraSettingsProcessor.values.cameraOffsetOffset.targetValue.y = cameraOffset.newValue.y;
break;
case CameraSettingsToggle.ResetValue:
CameraSettingsProcessor.values.cameraOffsetOffset.targetValue.y = CameraSettingsProcessor.values.cameraOffsetOffset.originalValue.y;
break;
}
switch (cameraOffset.changeZ) {
case CameraSettingsToggle.NewValue:
CameraSettingsProcessor.values.cameraOffsetOffset.targetValue.z = cameraOffset.newValue.z;
break;
case CameraSettingsToggle.ResetValue:
CameraSettingsProcessor.values.cameraOffsetOffset.targetValue.z = CameraSettingsProcessor.values.cameraOffsetOffset.originalValue.z;
break;
}
EndAction(true);
}
public void UpdateVector3Value(Vector3ValueGroup valueGroup, ref CameraSettingSingleValue<Vector3> targetProperty){
switch (valueGroup.changeX) {
case ValueChangeAction.NewValue:
targetProperty.targetValue.x = valueGroup.newValue.x;
break;
case ValueChangeAction.ResetValue:
targetProperty.targetValue.x = targetProperty.originalValue.x;
break;
}
switch (valueGroup.changeY) {
case ValueChangeAction.NewValue:
targetProperty.targetValue.y = valueGroup.newValue.y;
break;
case ValueChangeAction.ResetValue:
targetProperty.targetValue.y = targetProperty.originalValue.y;
break;
}
switch (valueGroup.changeZ) {
case ValueChangeAction.NewValue:
targetProperty.targetValue.z = valueGroup.newValue.z;
break;
case ValueChangeAction.ResetValue:
targetProperty.targetValue.z = targetProperty.originalValue.z;
break;
}
}
public void UpdateVector2Value(Vector2ValueGroup valueGroup, ref CameraSettingSingleValue<Vector2> targetProperty){
switch (valueGroup.changeX) {
case ValueChangeAction.NewValue:
targetProperty.targetValue.x = valueGroup.newValue.x;
break;
case ValueChangeAction.ResetValue:
targetProperty.targetValue.x = targetProperty.originalValue.x;
break;
}
switch (valueGroup.changeY) {
case ValueChangeAction.NewValue:
targetProperty.targetValue.y = valueGroup.newValue.y;
break;
case ValueChangeAction.ResetValue:
targetProperty.targetValue.y = targetProperty.originalValue.y;
break;
}
}
public void UpdateOrbitFollowValue(OrbitalFollowValueGroup valueGroup, ref CameraSettingSingleValue<float> targetHeight, ref CameraSettingSingleValue<float> targetRadius){
switch (valueGroup.changeHeight) {
case ValueChangeAction.NewValue:
targetHeight.targetValue = valueGroup.height;
break;
case ValueChangeAction.ResetValue:
targetHeight.targetValue = targetHeight.originalValue;
break;
}
switch (valueGroup.changeRadius) {
case ValueChangeAction.NewValue:
targetRadius.targetValue = valueGroup.radius;
break;
case ValueChangeAction.ResetValue:
targetRadius.targetValue = targetRadius.originalValue;
break;
}
}
public void UpdateBoolValue(BoolValueGroup valueGroup, ref CameraSettingSingleValue<bool> targetProperty){
switch (valueGroup.changeValue) {
case ValueChangeAction.NewValue:
targetProperty.targetValue = valueGroup.value;
break;
case ValueChangeAction.ResetValue:
targetProperty.targetValue = targetProperty.originalValue;
break;
}
}
public void UpdateFloatValue(FloatValueGroup valueGroup, ref CameraSettingSingleValue<float> targetProperty){
switch (valueGroup.changeValue) {
case ValueChangeAction.NewValue:
targetProperty.targetValue = valueGroup.value;
break;
case ValueChangeAction.ResetValue:
targetProperty.targetValue = targetProperty.originalValue;
break;
}
}
//Called once per frame while the action is active.
protected override void OnUpdate() {

View File

@@ -1,234 +0,0 @@
using System;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using Reset.Units;
using UnityEngine;
namespace Reset.Core {
[Category("Reset")]
[Description("Commits movement unit changes to the handler.")]
public class ChangeMovementSettings : ActionTask<UnitMovementHandler> {
// Move Speed
[ParadoxNotion.Design.Header("Speed")]
public FloatValueGroup moveSpeed = new (newLabel: "Move Speed");
public FloatValueGroup moveSpeedSoothing = new (newLabel: "Move Speed Smoothing");
[ParadoxNotion.Design.Header("Direction")]
public FloatValueGroup airDirectionDecay = new FloatValueGroup("Air Direction Decay");
public FloatValueGroup accelerationSmoothing = new (newLabel: "Acceleration Smoothing");
public FloatValueGroup deaccelerationSmoothing = new (newLabel: "Deacceleration Smoothing");
// public CurveValueGroup deaccelerationCurve = new (newLabel: "Deacceleration Curve"); // Currently unused, may return
// Direction
[Space(5)]
public Vector3ValueGroup feedNewDirection = new Vector3ValueGroup("Feed New Direction");
public float newDirectionStrength;
[Space(5)]
public Vector2 addDirectionFromInput;
public float addInputStrength;
[SliderField(0,1)]
public float addInputPriorty;
// Jumping
[ParadoxNotion.Design.Header("Jumping")]
public FloatValueGroup jumpPower = new (newLabel: "Jump Power");
public FloatValueGroup jumpPowerDecay = new (newLabel: "Jump Decay Speed");
// Gravity
[ParadoxNotion.Design.Header("Gravity")]
public FloatValueGroup gravityPower = new (newLabel: "Gravity Power");
public FloatValueGroup gravityMax = new (newLabel: "Gravity Max");
public FloatValueGroup gravityAcceleration = new (newLabel: "Gravity Acceleration Speed");
public FloatValueGroup gravityScale = new (newLabel: "Gravity Scale");
// Rotation
[ParadoxNotion.Design.Header("Rotation")]
public EnumValueGroup rotateFacing = new EnumValueGroup("Facing Direction", PlayerFacingDirection.TowardsTarget);
public FloatValueGroup rotationSpeed = new (newLabel: "Rotation Speed");
public FloatValueGroup rotationSmoothing = new (newLabel: "Rotation Smoothing");
public FloatValueGroup rotationInputBlending = new("Rotation Input Blending");
[Space(5)]
public BBParameter<Vector3> feedNewRotation;
public BBParameter<Vector3> feedRelativeTo;
public Space rotationRelativeSpace;
private Vector3 feedDir;
protected override string OnInit() {
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() {
// Direction
UpdateFloatValue(airDirectionDecay, ref agent.data.airDirectionDecay, ref agent.data.airDirectionDecay);
UpdateFloatValue(accelerationSmoothing, ref agent.data.accelerationSmoothing, ref agent.defaultData.accelerationSmoothing);
UpdateFloatValue(deaccelerationSmoothing, ref agent.data.deaccelerationSmoothing, ref agent.defaultData.deaccelerationSmoothing);
// UpdateCurveProperty(deaccelerationCurve, ref agent.data.deaccelerationCurve, ref agent.defaultData.deaccelerationCurve); // Currently unused, may return
// Direction from value
// Check that feedDir is not changed
UpdateVector3Value(feedNewDirection, ref feedDir, ref feedDir);
// If there's a direciton add it to the player for a frame
if (feedDir != Vector3.zero) {
agent.AddToCurrentDirection(agent.transform.rotation * feedDir.normalized, newDirectionStrength);
// Reset the fed direction after it's added so future runs don't have
feedDir = Vector3.zero;
}
// Direction from controller input
if (addDirectionFromInput != Vector2.zero){
agent.OverwriteDirectionFromInput(new Vector3(addDirectionFromInput.x, addDirectionFromInput.y), addInputPriorty, addInputStrength);
}
// Move Speed
UpdateFloatValue(moveSpeed, ref agent.data.moveSpeed, ref agent.defaultData.moveSpeed);
UpdateFloatValue(moveSpeedSoothing, ref agent.data.moveSpeedSoothing, ref agent.defaultData.moveSpeedSoothing);
// Jump
UpdateFloatValue(jumpPower, ref agent.data.jumpPower, ref agent.defaultData.jumpPower);
UpdateFloatValue(jumpPowerDecay, ref agent.data.jumpPowerDecay, ref agent.defaultData.jumpPowerDecay);
// Gravity
UpdateFloatValue(gravityPower, ref agent.data.gravityPower, ref agent.defaultData.gravityPower);
UpdateFloatValue(gravityMax, ref agent.data.gravityMax, ref agent.defaultData.gravityMax);
UpdateFloatValue(gravityAcceleration, ref agent.data.gravityAcceleration, ref agent.defaultData.gravityAcceleration);
UpdateFloatValue(gravityScale, ref agent.data.gravityScale, ref agent.defaultData.gravityScale);
// Rotation
UpdateEnumValue(rotateFacing, ref agent.data.rotateFacing, ref agent.defaultData.rotateFacing);
UpdateFloatValue(rotationSpeed, ref agent.data.rotationSpeed, ref agent.defaultData.rotationSpeed);
UpdateFloatValue(rotationSmoothing, ref agent.data.rotationSmoothing, ref agent.defaultData.rotationSmoothing);
UpdateFloatValue(rotationInputBlending, ref agent.data.rotationInputBlending, ref agent.defaultData.rotationInputBlending);
// Rotation from value
if (feedNewRotation.value != Vector3.zero) {
if (rotationRelativeSpace == Space.World) {
Debug.Log(Quaternion.LookRotation(feedRelativeTo.value));
agent.SetSpecifiedRotation(Quaternion.Euler(feedNewRotation.value) * Quaternion.LookRotation(feedRelativeTo.value));
} else {
agent.SetSpecifiedRotation(agent.transform.rotation * Quaternion.Euler(feedNewRotation.value) * Quaternion.LookRotation(feedRelativeTo.value));
}
}
EndAction(true);
}
//Called once per frame while the action is active.
protected override void OnUpdate() {
}
//Called when the task is disabled.
protected override void OnStop() {
}
//Called when the task is paused.
protected override void OnPause() {
}
public void UpdateCurveProperty(CurveValueGroup valueGroup, ref AnimationCurve targetProperty, ref AnimationCurve defaultProperty){
switch (valueGroup.changeValue) {
case ValueChangeAction.NoChange:
break;
case ValueChangeAction.NewValue:
targetProperty = valueGroup.newValue;
break;
case ValueChangeAction.ResetValue:
targetProperty = defaultProperty;
break;
default:
throw new ArgumentOutOfRangeException();
}
}
public void UpdateVector3Value(Vector3ValueGroup valueGroup, ref Vector3 targetProperty, ref Vector3 defaultProperty){
switch (valueGroup.changeX) {
case ValueChangeAction.NewValue:
targetProperty.x = valueGroup.newValue.x;
break;
case ValueChangeAction.ResetValue:
targetProperty.x = defaultProperty.x;
break;
}
switch (valueGroup.changeY) {
case ValueChangeAction.NewValue:
targetProperty.y = valueGroup.newValue.y;
break;
case ValueChangeAction.ResetValue:
targetProperty.y = defaultProperty.y;
break;
}
switch (valueGroup.changeZ) {
case ValueChangeAction.NewValue:
targetProperty.z = valueGroup.newValue.z;
break;
case ValueChangeAction.ResetValue:
targetProperty.z = defaultProperty.z;
break;
}
}
public void UpdateVector2Value(Vector2ValueGroup valueGroup, ref Vector2 targetProperty, ref Vector2 defaultProperty){
switch (valueGroup.changeX) {
case ValueChangeAction.NewValue:
targetProperty.x = valueGroup.newValue.x;
break;
case ValueChangeAction.ResetValue:
targetProperty.x = defaultProperty.x;
break;
}
switch (valueGroup.changeY) {
case ValueChangeAction.NewValue:
targetProperty.y = valueGroup.newValue.y;
break;
case ValueChangeAction.ResetValue:
targetProperty.y = defaultProperty.y;
break;
}
}
public void UpdateBoolValue(BoolValueGroup valueGroup, ref bool targetProperty, ref bool defaultProperty){
switch (valueGroup.changeValue) {
case ValueChangeAction.NewValue:
targetProperty = valueGroup.value;
break;
case ValueChangeAction.ResetValue:
targetProperty = defaultProperty;
break;
}
}
public void UpdateEnumValue(EnumValueGroup valueGroup, ref Enum targetProperty, ref Enum defaultProperty){
switch (valueGroup.changeValue) {
case ValueChangeAction.NewValue:
targetProperty = valueGroup.newValue;
break;
case ValueChangeAction.ResetValue:
targetProperty = defaultProperty;
break;
}
}
public void UpdateFloatValue(FloatValueGroup valueGroup, ref float targetProperty, ref float defaultProperty){
switch (valueGroup.changeValue) {
case ValueChangeAction.NewValue:
targetProperty = valueGroup.value;
break;
case ValueChangeAction.ResetValue:
targetProperty = defaultProperty;
break;
}
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 5132a76af4f722e49bc7fbbc75edcaf1

View File

@@ -1,60 +0,0 @@
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
namespace NodeCanvas.Tasks.Conditions {
[Category("Reset")]
public class CheckEnvironmentObserver : ConditionTask<PlayerEnvironmentManager>{
public BBParameter<string> observerLabel;
public BBParameter<RaycastHit> outputHitTo;
protected override string info{
get {
return $"Check Environment Observer, [\"{observerLabel.value}\"]";
}
}
//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(){
var observer = agent.FindObserverFromString(observerLabel.value);
if (observer == null) {
return $"An environment observer couldn't be found under the name {observerLabel.value}. Check your spelling and if it exists??";
}
return null;
}
//Called whenever the condition gets enabled.
protected override void OnEnable() {
agent.FindObserverFromString(observerLabel.value).active = true;
}
//Called whenever the condition gets disabled.
protected override void OnDisable() {
agent.FindObserverFromString(observerLabel.value).active = false;
}
//Called once per frame while the condition is active.
//Return whether the condition is success or failure.
protected override bool OnCheck(){
if (agent.EvaluateFromString(observerLabel.value) == true) {
if (outputHitTo.isDefined) {
EnvironmentObserver hitObserver = agent.FindObserverFromString(observerLabel.value, agent.observers);
if (hitObserver.hit.Equals(default(RaycastHit))) {
Debug.LogError("You just tried to pull a RaycastHit for later use from an environment observer, but no RaycastHit is available. Don't forget that CastType.Box and CastType.Sphere CANNOT spit one out!");
} else {
outputHitTo.value = hitObserver.hit;
return true;
}
}
return true;
}
return false;
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 95ad4bd047d9654478597c68a81b01a0

View File

@@ -1,113 +0,0 @@
using System.Drawing;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
#if UNITY_EDITOR
using NodeCanvas.Editor;
#endif
using UnityEditor;
namespace Reset {
[Category("Reset")]
[Description("Creates an environment observer unattached from the player, such as for checking from the Camera or another arbitray location.")]
public class CheckGenericObserver : ConditionTask<Transform>{
[Space(5)]
public BBParameter<EnvironmentObserver.CastType> castType;
public BBParameter<float> length;
public BBParameter<Vector3> direction;
public BBParameter<Vector3> offset;
public BBParameter<LayerMask> ignoreLayers;
public BBParameter<float> width;
public BBParameter<Vector3> size;
public BBParameter<Vector3> rotation;
public bool drawGizmos;
public bool drawGizmosOnlyWhenActive;
private EnvironmentObserver observer;
public BBParameter<RaycastHit> outputHit;
#if UNITY_EDITOR
protected override void OnTaskInspectorGUI(){
BBParameterEditor.ParameterField("Cast Type", castType);
BBParameterEditor.ParameterField("Length", length);
BBParameterEditor.ParameterField("Direction", direction);
BBParameterEditor.ParameterField("Offset", offset);
BBParameterEditor.ParameterField("Ignore Layers", ignoreLayers);
if (castType.value == EnvironmentObserver.CastType.SphereCast || castType.value == EnvironmentObserver.CastType.SphereOverlap) {
BBParameterEditor.ParameterField("Width", width);
}
if (castType.value == EnvironmentObserver.CastType.BoxCast || castType.value == EnvironmentObserver.CastType.BoxOverlap) {
BBParameterEditor.ParameterField("Size", size);
}
if (castType.value != EnvironmentObserver.CastType.Ray) {
BBParameterEditor.ParameterField("Rotation", rotation);
}
drawGizmos = EditorGUILayout.Toggle("Draw Gizmos", drawGizmos);
if (drawGizmos) {
drawGizmosOnlyWhenActive = EditorGUILayout.Toggle("Draw Gizmos Only When Active", drawGizmosOnlyWhenActive);
}
BBParameterEditor.ParameterField("Output Hit", outputHit);
}
#endif
//Return null if init was successfull. Return an error string otherwise
protected override string OnInit(){
return null;
}
//Called whenever the condition gets enabled.
protected override void OnEnable() {
observer = new EnvironmentObserver(){
castType = castType.value,
active = true,
length = length.value,
direction = direction.value,
offset = offset.value,
ignoreLayers = ignoreLayers.value,
width = width.value,
size = size.value,
rotation = rotation.value
};
}
//Called whenever the condition gets disabled.
protected override void OnDisable() {
}
//Called once per frame while the condition is active.
//Return whether the condition is success or failure.
protected override bool OnCheck() {
bool check = observer.Evaluate(agent.gameObject);
if (drawGizmos) {
observer.DrawObserverGizmo(agent.gameObject, true);
}
if (check && !outputHit.isNoneOrNull) {
outputHit.value = observer.hit;
}
return check;
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: fb4b5bf056649ca48b1b14dbe499de46

View File

@@ -1,54 +1,49 @@
using System;
using System.Collections.Generic;
using NodeCanvas.Framework;
using ParadoxNotion;
using ParadoxNotion.Design;
using UnityEngine;
using UnityEngine.InputSystem;
namespace NodeCanvas.Tasks.Conditions {
[Category("Reset/Input")]
[Description("Check if input condition was matched this frame by phase.")]
[Description("Check if input condition was matched this frame")]
public class CheckInput : ConditionTask<Transform>{
public BBParameter<string> actionName;
public BBParameter<InputActionPhase> actionPhase;
private SignalDefinition signalDefinition;
public BBParameter<string> actionValue;
protected override string info {
get { return $"Input <b>{actionName.value}</b> was <b>{actionPhase.value}</b>"; }
get { return "Player Input"; }
}
private InputAction action;
//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(){
try {
signalDefinition = Resources.Load<SignalDefinition>("InputSignal");
} catch (Exception e) {
Debug.LogError($"Error finding the Input Signal defintion: {e.Message}");
throw;
}
return null;
}
protected override void OnEnable() {
signalDefinition.onInvoke -= OnSignalInvoke;
signalDefinition.onInvoke += OnSignalInvoke;
//Called whenever the condition gets enabled.
protected override void OnEnable(){
action = agent.GetComponent<PlayerInput>().actions.FindAction(actionName.value);
}
//Called whenever the condition gets disabled.
protected override void OnDisable() {
signalDefinition.onInvoke -= OnSignalInvoke;
}
void OnSignalInvoke(Transform sender, Transform receiver, bool isGlobal, params object[] args){
// Take the input arguments as objects and convert them to InputAction & Phases
InputAction thisAction = (InputAction)args[0];
InputActionPhase thisActionPhase = (InputActionPhase)args[1];
if (actionName.value == thisAction.name && actionPhase.value == thisActionPhase) {
YieldReturn(true);
}
//Called once per frame while the condition is active.
//Return whether the condition is success or failure.
protected override bool OnCheck() {
// if (action.type == InputActionType.Button){
if (action.WasPressedThisFrame()) { return true; }
// } else if (action.type == InputActionType.Value) {
//
// }
return false;
}
protected override bool OnCheck() { return false; }
}
}

View File

@@ -1,42 +0,0 @@
using System;
using System.Collections.Generic;
using NodeCanvas.Framework;
using ParadoxNotion;
using ParadoxNotion.Design;
using UnityEngine;
using UnityEngine.InputSystem;
namespace NodeCanvas.Tasks.Actions {
[Category("Reset/Input")]
[Description("Check if input condition was matched this frame by phase.")]
public class CheckInputValue<T> : ActionTask<PlayerInput> where T : struct{
public BBParameter<string> actionName;
public BBParameter<T> outputTo;
private T value;
private SignalDefinition signalDefinition;
protected override string info {
get { return $"Get Value of <b>Input:</b> \"{actionName.value}\""; }
}
protected override string OnInit(){
try {
signalDefinition = Resources.Load<SignalDefinition>("InputSignal");
} catch (Exception e) {
Debug.LogError($"Error finding the Input Signal defintion: {e.Message}");
throw;
}
return null;
}
protected override void OnExecute(){
// Debug.Log($"{outputTo.value}, {agent.actions[actionName.value].ReadValue<T>()}");
outputTo.value = agent.actions[actionName.value].ReadValue<T>();
EndAction();
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 055df0fbf696a3149a2d49a8a5392aba

View File

@@ -1,60 +0,0 @@
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
namespace NodeCanvas.Tasks.Actions {
[Category("Reset")]
[Description("Breaks down an incoming RaycastHit into it's constituent parts for later use.")]
public class DecomposeRaycastHit : ActionTask{
public BBParameter<RaycastHit> raycastHit;
public BBParameter<Transform> transform;
public BBParameter<Collider> collider;
public BBParameter<GameObject> gameObject;
public BBParameter<float> distance;
public BBParameter<Vector3> normal;
public BBParameter<Vector3> point;
//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 info{
get{ return $"Decompose RaycastHit <b>{raycastHit}</b>"; }
}
protected override string OnInit() {
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(){
if (transform.isDefined){ transform.value = raycastHit.value.transform; }
if (collider.isDefined){ collider.value = raycastHit.value.collider; }
if (gameObject.isDefined){ gameObject.value = raycastHit.value.transform.gameObject; }
if (distance.isDefined){ distance.value = raycastHit.value.distance; }
if (normal.isDefined){ normal.value = raycastHit.value.normal; }
if (point.isDefined){ point.value = raycastHit.value.point; }
EndAction(true);
}
//Called once per frame while the action is active.
protected override void OnUpdate() {
}
//Called when the task is disabled.
protected override void OnStop() {
}
//Called when the task is paused.
protected override void OnPause() {
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 79f7cbb75d876f84b8edfae676ba324c

View File

@@ -1,127 +0,0 @@
using Drawing;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using ParadoxNotion.Services;
using UnityEngine;
namespace NodeCanvas.Tasks.Actions {
[Category("Reset/Movement")]
[Description("Pulls the agent towards a position with a spring-like effect")]
public class DoGrapplePull : ActionTask<CharacterController>{
public BBParameter<Vector3> grapplePoint;
public BBParameter<Vector3> offset;
public BBParameter<float> pullAccelerationSpeed;
public BBParameter<float> pullDeaccelerationSpeed;
[Tooltip("X is minimum speed, Y is maximum speed")]
public BBParameter<Vector2> pullTimeRange;
[Tooltip("X is the distance where the curve will first be evaluated, Y is the distance where the curve will last be evaluated")]
public BBParameter<Vector2> pullSpeedRange;
public BBParameter<float> slowdownDistance;
public BBParameter<AnimationCurve> pullSpeedCurve;
public BBParameter<AnimationCurve> endDeaccelerationCurve;
private float startTime;
private float currentSpeed;
private Vector3 smoothedInput;
private Vector3 smoothedInputRefVelocity;
//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 += DrawGrappleGizmo;
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(){
startTime = Time.time;
currentSpeed = pullSpeedCurve.value[0].value * pullSpeedRange.value.y;
}
//Called once per frame while the action is active.
protected override void OnUpdate(){
// Create the distance variables
Vector3 dirToPoint = agent.transform.position.DirectionTo(grapplePoint.value);
float evaluatedSpeed = pullSpeedCurve.value.Evaluate(Mathf.Clamp((Time.time - startTime) / 6f, 0f, Mathf.Infinity));
float speedAgainstCurve = Mathf.Lerp(pullSpeedRange.value.x, pullSpeedRange.value.y, evaluatedSpeed);
// Find how far from 0-1 the player is from the max and minimum distance
// Get the base distance then account for the minimum distance to the point so that being the minimum away will Lerp to 1
float currentDist = Vector3.Distance(agent.transform.position, grapplePoint.value);
// float currentDistMinimumAccounted = (currentDist - pullSpeedDistances.value.x);
if (currentDist < slowdownDistance.value) {
float change = endDeaccelerationCurve.value.Evaluate((slowdownDistance.value - currentDist) / slowdownDistance.value);
speedAgainstCurve = speedAgainstCurve * change;
// Debug.Log($"prev: {speedAgainstCurve}, norm: {(slowdownDistance.value - currentDist) / slowdownDistance.value}, change: {change}, output: {speedAgainstCurve * change} ");
}
// Evaluate the normalized value
// float normaled = Mathf.Lerp(0, 1f, 1f - elapsedTime / (pullSpeedDistances.value.y - pullSpeedDistances.value.x));
// Use the curve evaluation to set the speed
// float outputSpeed = Mathf.Lerp(pullTimeRange.value.x, pullTimeRange.value.y, evaluatedSpeed);
// Soften the speed changes
currentSpeed = Mathf.Lerp(currentSpeed, speedAgainstCurve, 10f * Time.deltaTime);
// Add input changes
Vector2 rawInput = agent.GetComponent<PlayerControls>().rawMoveInput;
Vector3 input = Quaternion.LookRotation(dirToPoint) * new Vector3(rawInput.x, rawInput.y, 0f);
smoothedInput = Vector3.SmoothDamp(smoothedInput, input, ref smoothedInputRefVelocity, 30f * Time.deltaTime);
Debug.Log(input);
dirToPoint.y *= 2.5f;
agent.Move((dirToPoint.normalized + smoothedInput) * currentSpeed * Time.deltaTime);
// Debug.Log( $"{ endDeaccelerationCurve.value.Evaluate(((slowdownDistance.value - currentDist)) )}");
// EndAction(true);
}
public void DrawGrappleGizmo(){
// Vector3 dirToPoint = agent.transform.position.DirectionTo(grapplePoint.value);
//
// using (Draw.WithColor(Color.yellow)){
// Draw.Line(agent.transform.position + Vector3.up, grapplePoint.value);
//
// // Draw Gizmo for minimum distance
// Vector3 minLocation = agent.transform.position + (Vector3.up * 1) + (dirToPoint * pullSpeedDistances.value.x);
// Vector3 minToScreen = minLocation.DirectionTo(Camera.main.transform.position);
//
// Draw.SolidCircle(minLocation,minToScreen , .2f);
//
// // Draw Gizmo for minimum distance
// Vector3 maxLocation = agent.transform.position + (Vector3.up * .8f) + (dirToPoint * pullSpeedDistances.value.y);
// Vector3 maxToScreen = maxLocation.DirectionTo(Camera.main.transform.position);
//
// Draw.SolidCircle(maxLocation,maxToScreen , .2f);
// }
}
//Called when the task is disabled.
protected override void OnStop() {
}
//Called when the task is paused.
protected override void OnPause() {
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 75673b361693d854abb6e3b24a62d734

View File

@@ -1,48 +0,0 @@
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
namespace Reset.Movement {
[Category("Reset/Movement")]
[Description("Finalize the move direction to the agent's CharacterController")]
public class FinalizeMovement : ActionTask<CharacterController>{
public BBParameter<Vector3> moveDirection;
public BBParameter<float> currentSpeed;
//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() {
if (currentSpeed == null || !currentSpeed.useBlackboard) {
Debug.LogError("This <b>Finalize Movement</b> does not have it's current value attached to a Blackboard variable. Nothing will happen.", agent.gameObject);
}
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(){
Vector3 usableVector3 = new Vector3(moveDirection.value.x * currentSpeed.value, moveDirection.value.y, moveDirection.value.z * currentSpeed.value);
agent.Move(Camera.main.transform.rotation * usableVector3 * Time.deltaTime);
Debug.Log("Finalize Done");
// EndAction(true);
}
//Called when the task is disabled.
protected override void OnStop() {
}
//Called when the task is paused.
protected override void OnPause() {
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: fea4d34f26d30b24e8cb99acf1766b6f

View File

@@ -1,85 +0,0 @@
using System;
using NodeCanvas.Framework;
using NUnit.Framework.Constraints;
using ParadoxNotion.Design;
using ParadoxNotion.Serialization.FullSerializer;
using Sirenix.OdinInspector;
using UnityEngine;
namespace NodeCanvas.Tasks.Conditions {
[Category("Reset/Input")]
[Description("Returns a float from two Vector3s")]
public class GetMovementInputDotProduct : ConditionTask<PlayerControls>{
enum CheckDotProductAgainst{
ForwardDirection,
CameraDirection,
InputVector3
}
[ExposeField, fsSerializeAs] CheckDotProductAgainst checkAgainst;
[ParadoxNotion.Design.ShowIf("checkAgainst", 2)] public BBParameter<Vector3> checkAgainstValue;
[SliderField(-1f, 1f)] public BBParameter<float> desiredValue;
public BBParameter<float> tolerance;
public BBParameter<bool> considerCameraRotation;
public BBParameter<bool> negate;
//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(){
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 bool OnCheck(){
// Switch what the dot product is checked against
Vector3 valueToCheck;
switch (checkAgainst) {
case CheckDotProductAgainst.ForwardDirection:
Debug.Log(agent.transform.forward);
valueToCheck = agent.transform.forward;
break;
case CheckDotProductAgainst.CameraDirection:
valueToCheck = Camera.main.transform.forward;
break;
case CheckDotProductAgainst.InputVector3:
valueToCheck = checkAgainstValue.value.normalized;
break;
default:
throw new ArgumentOutOfRangeException();
}
// Get the input as a Vector3
Vector3 rawInputVector3 = new Vector3(agent.rawMoveInput.x, 0f, agent.rawMoveInput.y);
if (considerCameraRotation.value) {
rawInputVector3 = Camera.main.transform.rotation * rawInputVector3;
}
// Calculate dor product
float dotProduct = Vector3.Dot(valueToCheck, rawInputVector3);
// Debug.Log(dotProduct);
// Compare against the desired tolerance and output result
if (tolerance.value > Mathf.Abs(dotProduct - tolerance.value)) {
return true;
}
return false;
}
//Called when the task is disabled.
protected override void OnEnable() {
}
//Called when the task is paused.
protected override void OnDisable() {
}
}
}

View File

@@ -0,0 +1,154 @@
using System;
using System.Collections;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using ParadoxNotion.Services;
using Unity.Cinemachine;
using Unity.Mathematics;
using UnityEngine;
using Reset.Player.Movement;
namespace Reset.Player.Movement{
public enum PlayerFacingDirection{
Target = 0,
Movement,
MatchCamera
}
}
namespace NodeCanvas.Tasks.Actions {
[Category("Reset/Movement")]
[Description("Finalizes movement and sends the final move commands to the controller")]
public class ProcessMovement : ActionTask<CharacterController>{
public BBParameter<Vector3> groundMoveDirection;
public BBParameter<Vector3> airMoveDirection;
[Space(5)]
public BBParameter<float> gravityAcceleration = 1f;
public BBParameter<float> gravityMax = 8f;
public BBParameter<float> jumpPower;
public BBParameter<float> jumpPowerDecay;
// Rotation
public BBParameter<PlayerFacingDirection> playerFacingDirection;
[ShowIf("playerFacingDirection", 0)]
public Vector3 rotationTargetPosition;
public BBParameter<float> rotationSpeed = 5f;
public BBParameter<float> rotationSmoothing;
private float currentRotSpeed;
private float lastLookMagnitude;
private Quaternion targetRotation;
// References
private PlayerControls controls;
public BBParameter<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() {
// Append the late update method to actually happen on late update
MonoManager.current.onLateUpdate += LateUpdate;
// What
currentRotSpeed = rotationSpeed.value;
// Reference to controls
controls = agent.GetComponent<PlayerControls>();
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(){
// Accelerate gravity
gravityPower.value += gravityAcceleration.value * Time.deltaTime;
gravityPower.value = Mathf.Min(gravityPower.value, gravityMax.value);
// Calculate rotation speed
currentRotSpeed = Mathf.Lerp(currentRotSpeed, rotationSpeed.value, rotationSmoothing.value * Time.deltaTime);
switch (playerFacingDirection.value) {
case PlayerFacingDirection.Target:
// Set rotation to just the direction of the target
targetRotation = Quaternion.LookRotation((agent.transform.position.DirectionTo(rotationTargetPosition)).Flatten(null, 0, null));
break;
case PlayerFacingDirection.Movement:
// Check magnitude to avoid the "Look rotation viewing vector is zero" debug
if (controls.rawMoveInput.magnitude == 0) { break; }
// Set desired rotation to input direction, with respect to camera rotation
targetRotation = Quaternion.LookRotation(new Vector3(controls.rawMoveInput.x, 0, controls.rawMoveInput.y)) *
Quaternion.Euler(Camera.main.transform.rotation.eulerAngles.Flatten(0f, null, 0f));
break;
case PlayerFacingDirection.MatchCamera:
// Craft a new rotation that flattens the camera's rotation to the ground
// Needed to keep the character from inheriting the camera's height-rotation
targetRotation = Quaternion.Euler(Camera.main.transform.rotation.eulerAngles.Flatten(0, null, 0));
break;
}
// Construct move direction
Vector3 finalMoveDir = Vector3.zero;
Vector3 gravityMoveDirection;
// Add input movement
if (agent.isGrounded){
finalMoveDir += groundMoveDirection.value + Vector3.down * .03f;
gravityMoveDirection = new(0f, jumpPower.value + (Physics.gravity.y *.3f), 0f);
} else {
finalMoveDir += airMoveDirection.value;
gravityMoveDirection = new(0f, jumpPower.value + Physics.gravity.y * gravityPower.value, 0f);
}
// Reset gravity power when grounded
if (agent.isGrounded) {
gravityPower.value = 0f;
}
// Do final movement
if (agent.isGrounded) {
agent.Move((Quaternion.Euler(Camera.main.transform.rotation.eulerAngles.Flatten(0f, null, 0f)) * finalMoveDir + gravityMoveDirection) * Time.deltaTime);
} else {
agent.Move((finalMoveDir + gravityMoveDirection) * Time.deltaTime);
}
// Set final rotation
agent.transform.rotation = Quaternion.Lerp(agent.transform.rotation, targetRotation, 10f * Time.deltaTime);
// ???? Moved this above but don't remember if this needs to be here still
if (agent.isGrounded) {
jumpPower.value = 0f;
}
}
// Gravity is processed in LateUpdate (added to MonoManager's onLateUpdate in OnInit())
public void LateUpdate(){
// Decay jump power
jumpPower.value = Mathf.Lerp(jumpPower.value, 0f, jumpPowerDecay.value * Time.deltaTime);
}
//Called when the task is disabled.
protected override void OnStop() {
EndAction(true);
}
//Called when the task is paused.
protected override void OnPause() {
}
}
}

View File

@@ -1,71 +0,0 @@
using System;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using Reset.Movement;
using UnityEngine;
namespace NodeCanvas.Tasks.Actions {
[Category("Reset/Movement")]
[Description("Launch the agent towards a specific point with respect to distance.")]
public class StartLaunchJump : ActionTask<CharacterController>{
public BBParameter<Vector3> airDirection;
public BBParameter<float> jumpPower;
public BBParameter<Vector3> targetLocation;
public BBParameter<Vector3> offset;
public BBParameter<Vector3> relativeRotation;
public BBParameter<PlayerFacingDirection> launchRelativeTo;
public BBParameter<bool> useRelativeForce;
[ShowIf("useRelativeForce", 1)] public BBParameter<float> minimumForce;
[ShowIf("useRelativeForce", 1)] public BBParameter<float> maximumForce;
[ShowIf("useRelativeForce", 1)] public BBParameter<float> forceRelativeToDistance;
public BBParameter<float> force;
//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() {
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(){
Vector3 launchDir = agent.transform.position.DirectionTo(targetLocation.value).normalized;
launchDir = Quaternion.Euler(relativeRotation.value) * launchDir;
Debug.Log(launchDir);
float distanceToTarget = Vector3.Distance(agent.transform.position, targetLocation.value);
float outputForce = (useRelativeForce.value ? distanceToTarget * forceRelativeToDistance.value : force.value);
outputForce = Mathf.Clamp(outputForce, minimumForce.value, maximumForce.value);
jumpPower.value = outputForce;
airDirection.value = (launchDir * outputForce);
EndAction(true);
}
//Called once per frame while the action is active.
protected override void OnUpdate() {
}
//Called when the task is disabled.
protected override void OnStop() {
}
//Called when the task is paused.
protected override void OnPause() {
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 8f32fe451feb2ca4e8159d4aa8919cd2

View File

@@ -1,73 +0,0 @@
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using ParadoxNotion.Services;
using UnityEngine;
namespace Reset.Movement {
[Category("Reset/Movement")]
[Description("Process Y-axis movement for the agent")]
// TODO: Rename to UpdateGravitytDirection
public class UpdateGravityDirection : ActionTask<CharacterController>{
public BBParameter<Vector3> moveDirection;
public BBParameter<float> jumpPower;
public BBParameter<float> jumpPowerDecay;
[Space(5)]
public BBParameter<float> gravityAcceleration = 1f;
public BBParameter<float> gravityMax = 8f;
public BBParameter<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() {
// Accelerate gravity
gravityPower.value += gravityAcceleration.value * Time.deltaTime;
gravityPower.value = Mathf.Min(gravityPower.value, gravityMax.value);
// Apply a constant gravity if the player is grounded
if (agent.isGrounded) {
gravityPower.value = .1f;
}
// Create the gravity direction
float gravityMoveDirection = jumpPower.value + Physics.gravity.y * gravityPower.value;
// Commit gravity to move direction, ignoring XZ since those are done in UpdateMovementDirection
moveDirection.value = new Vector3(moveDirection.value.x, gravityMoveDirection, moveDirection.value.z);
Debug.Log("Gravity Done");
EndAction(true);
}
public void LateUpdate(){
// Decay jump power
jumpPower.value = Mathf.Lerp(jumpPower.value, 0f, jumpPowerDecay.value * Time.deltaTime);
}
//Called when the task is disabled.
protected override void OnStop() {
}
//Called when the task is paused.
protected override void OnPause() {
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 5531fbd949d33204690c98dd89a5e97f

View File

@@ -1,118 +0,0 @@
using System;
using System.Collections;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using ParadoxNotion.Services;
using Unity.Cinemachine;
using Unity.Mathematics;
using UnityEngine;
using Reset.Movement;
using Reset.Units;
namespace NodeCanvas.Tasks.Actions {
[Category("Reset/Movement")]
[Description("Finalizes movement and sends the final move commands to the controller")]
// TODO: Rename to UpdateMovementDirection
public class UpdateMovementDirection : ActionTask<CharacterController>{
[ParadoxNotion.Design.Header("References")]
public BBParameter<Vector3> moveDirection;
// TODO: Remove this reference and let each copy of this use their own settings.
public BBParameter<PlayerFacingDirection> playerFacingDirection;
[ParadoxNotion.Design.Header("Settings")]
public BBParameter<float> accelerationSmoothing = 5f;
public BBParameter<float> deaccelerationSmoothing = 5f;
public BBParameter<AnimationCurve> deaccelerationCurve;
public BBParameter<float> directionChangeMinimumMagnitude; // Unused. Use to only make input change if it's over a certain input threshold. Maybe smoothing can affect this?
private float lastLookMagnitude;
private Vector3 currentMoveDir;
// References
private PlayerControls controls;
//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() {
// Reference to controls
controls = agent.GetComponent<PlayerControls>();
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(){
// Initialize the smoothed direction with the value as is on input
// currentMoveDir = new Vector3(moveDirection.value.x, moveDirection.value.y, moveDirection.value.z);
}
//Called once per frame while the action is active.
protected override void OnUpdate(){
// Construct move direction
Vector3 targetDirection = moveDirection.value;
// Get input value
Vector3 inputMovement = new Vector3(controls.rawMoveInput.x, 0f, controls.rawMoveInput.y);
if (inputMovement.magnitude < .1f) {
inputMovement = Vector3.zero;
}
// Change how movement is managed based on facing state
switch (playerFacingDirection.value) {
case PlayerFacingDirection.TowardsTarget:
break;
case PlayerFacingDirection.MatchForward: // TODO: Recomment
// targetDirection = agent.transform.forward * inputMovement.magnitude;
targetDirection = inputMovement;
break;
case PlayerFacingDirection.MatchCamera:
targetDirection = Quaternion.Euler(Camera.main.transform.forward.DirectionTo(agent.transform.forward)) * inputMovement; // NOTE: This used to be t: currentRotSpeed * Time.deltaTime.
// See how it feels with a hard set value and go fro there.
break;
case PlayerFacingDirection.Static:
break;
default:
throw new ArgumentOutOfRangeException();
}
// Remove Y from variables
Vector3 targetNoY = new Vector3(targetDirection.x, 0f, targetDirection.z);
Vector3 currentNoY = new Vector3(currentMoveDir.x, 0f, currentMoveDir.z);
// Smooth movement
if (targetNoY.magnitude > currentNoY.magnitude) {
currentMoveDir = Vector3.Lerp(currentMoveDir, targetNoY,accelerationSmoothing.value * Time.deltaTime);
} else {
float deaccelValue = deaccelerationCurve.value.Evaluate(inputMovement.magnitude);
currentMoveDir = Vector3.Lerp(currentMoveDir, targetNoY, deaccelerationSmoothing.value * Time.deltaTime);
}
currentMoveDir.y = moveDirection.value.y;
// Commit move direction
moveDirection.value = currentMoveDir;
// Debug.Log(moveDirection.value);
EndAction(true);
}
// Gravity is processed in LateUpdate (added to MonoManager's onLateUpdate in OnInit())
//Called when the task is disabled.
protected override void OnStop() {
EndAction(true);
}
//Called when the task is paused.
protected override void OnPause() {
}
}
}

View File

@@ -1,60 +0,0 @@
using System;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
namespace Reset.Movement {
[Category("Reset/Movement")]
[Description("Updates the movespeed for this agent")]
public class UpdateMovementSpeed : ActionTask{
public BBParameter<float> target;
public BBParameter<float> speed;
public BBParameter<float> smoothing = 10f;
private float currentSpeed;
//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() {
if (!speed.useBlackboard) {
Debug.LogError("This <b>Update Movement Speed</b> does not have it's current value attached to a Blackboard variable. Nothing will happen.", agent.gameObject);
}
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(){
// currentSpeed = speed.value;
}
//Called once per frame while the action is active.
protected override void OnUpdate(){
currentSpeed = Mathf.Lerp(currentSpeed, target.value, smoothing.value * Time.deltaTime);
speed.value = currentSpeed;
if (Mathf.Abs(currentSpeed - speed.value) < .01f) {
}
Debug.Log("Speed Done");
EndAction(true);
}
//Called when the task is disabled.
protected override void OnStop() {
}
//Called when the task is paused.
protected override void OnPause() {
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 6a4c5896d783ad845861edd0c9eea14b

View File

@@ -1,65 +0,0 @@
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using ParadoxNotion.Serialization.FullSerializer;
using UnityEngine;
using Logger = ParadoxNotion.Services.Logger;
namespace NodeCanvas.Tasks.Actions {
[Category("Reset")]
public class UpdateObjectCameraTracking : ActionTask<LockOnManager> {
public BBParameter<GameObject> relatedObject;
enum CameraTrackingTaskAction{
AddOrUpdate,
Remove
}
[ExposeField, fsSerializeAs, Space(5)]
CameraTrackingTaskAction action;
[ParadoxNotion.Design.ShowIf("action", 0)]
public BBParameter<float> weight;
[ParadoxNotion.Design.ShowIf("action", 0)]
public BBParameter<bool> isMain;
//Return null if init was successfull. Return an error string otherwise
protected override string OnInit() {
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() {
if (relatedObject.isNull) {
Logger.LogError("There is no object for the camera to add to tracking. May have forgotten a reference/object probably destroyed?");
EndAction(false);
return;
}
if (action == CameraTrackingTaskAction.AddOrUpdate) {
agent.AddNewTarget(relatedObject.value, weight.value, isMain.value);
} else {
agent.QueueTargetRemoval(relatedObject.value);
}
EndAction(true);
}
//Called once per frame while the action is active.
protected override void OnUpdate() {
}
//Called when the task is disabled.
protected override void OnStop() {
}
//Called when the task is paused.
protected override void OnPause() {
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: c187e5f8e4ad16b42b10c10ea9fb8fd4

View File

@@ -1,88 +0,0 @@
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using Reset.Movement;
using UnityEngine;
using UnityEngine.TextCore.Text;
namespace Reset.Player.Movement {
[Category("Reset/Movement")]
[Description("Finalizes the character rotation and commits it to the Transform")]
// TODO: Rename to UpdateRotation
public class UpdateRotation : ActionTask<CharacterController> {
// Rotation
public BBParameter<Vector3> moveDirection;
public BBParameter<PlayerFacingDirection> playerFacingDirection;
public BBParameter<float> rotationSpeed = 5f;
public BBParameter<float> rotationSmoothing;
private Vector3 currentMoveDir;
private PlayerControls controls;
private Quaternion targetRotation;
private float currentRotSpeed;
[ShowIf("playerFacingDirection", 0)]
public Vector3 rotationTargetPosition;
//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() {
controls = agent.GetComponent<PlayerControls>();
return null;
}
//Called once per frame while the action is active.
protected override void OnUpdate() {
// Calculate rotation speed
currentRotSpeed = Mathf.Lerp(currentRotSpeed, rotationSpeed.value, rotationSmoothing.value * Time.deltaTime);
// Set ingitial rotation power
currentRotSpeed = rotationSpeed.value;
// Get input value
Vector3 inputMovement = new Vector3(controls.rawMoveInput.x, 0f, controls.rawMoveInput.y);
switch (playerFacingDirection.value) {
case PlayerFacingDirection.TowardsTarget:
// Set rotation to just the direction of the target
targetRotation = Quaternion.LookRotation((agent.transform.position.DirectionTo(rotationTargetPosition)).Flatten(null, 0));
break;
case PlayerFacingDirection.MatchForward:
if (controls.rawMoveInput.magnitude < 0.01f) { break; }
targetRotation = Quaternion.LookRotation(inputMovement) *
Quaternion.Euler(Camera.main.transform.rotation.eulerAngles.Flatten(0f, null, 0f));
break;
case PlayerFacingDirection.MatchCamera:
// Craft a new rotation that flattens the camera's rotation to the ground
// Needed to keep the character from inheriting the camera's height-rotation
targetRotation = Quaternion.Euler(Camera.main.transform.rotation.eulerAngles.Flatten(0, null, 0));
break;
case PlayerFacingDirection.Static:
targetRotation = agent.transform.rotation;
break;
}
// Set final rotation
agent.transform.rotation = Quaternion.Lerp(agent.transform.rotation, targetRotation, 10f * Time.deltaTime).Flatten(0, null, 0);
Debug.Log("Rotation Done");
EndAction(true);
}
//Called when the task is disabled.
protected override void OnStop() {
}
//Called when the task is paused.
protected override void OnPause() {
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 7a0fd0ebfb8888b4e8ab4c81fb3aa6c0

View File

@@ -5,167 +5,91 @@ using System.Numerics;
using Sirenix.OdinInspector;
using Unity.Cinemachine;
using UnityEngine;
using UnityEngine.Serialization;
using UnityEngine.UIElements;
using Vector2 = UnityEngine.Vector2;
using Vector3 = UnityEngine.Vector3;
public class LockOnManager : MonoBehaviour{
public class ActiveLockOnTarget{
public GameObject gameObject;
public float targetWeight;
public float refVelocity;
public CinemachineTargetGroup.Target cinemachineTarget;
}
public static LockOnManager Instance;
private CinemachineTargetGroup.Target playerTarget;
// Lock On settings
[Space(5)] public float lockOnRange = 40f;
[Space(5)]
public float lockOnRange = 40f;
public float lockOnMaxAngle = 70f;
[Range(0,1)] public float mainTargetWeight = .15f;
[FormerlySerializedAs("smoothing")] public float smoothTime = 1f;
// Lock On Tracking
[Space(10)]
public ActiveLockOnTarget mainTarget;
public List<ActiveLockOnTarget> activeTargets = new List<ActiveLockOnTarget>();
[Space(10)] public GameObject lockonGameObject; // Needed because nulling the Target below doesn't actually empty it out
[ReadOnly] public CinemachineTargetGroup.Target lockonTarget;
public CinemachineTargetGroup targetGroup;
private List<GameObject> acceptedTargets = new List<GameObject>();
[Space(5)]
public List<GameObject> lockOnTargets = new List<GameObject>();
// UI
[ShowInInspector] public UIDocument lockOnDocument;
[ShowInInspector]
public UIDocument lockOnDocument;
private Label elementLabelName;
private VisualElement elementRoot;
private VisualElement elementRoot;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start(){
// Register as singleton
if (Instance == null) {
Instance = this;
} else {
this.enabled = false;
return;
}
// Save the player target object to track later
playerTarget = targetGroup.Targets[0];
// Quick check for things in lock-on target that aren't lock-onable
if (mainTarget != null && mainTarget.gameObject.GetComponent<ILockOnTarget>() == null) {
mainTarget.gameObject.AddComponent<GenericLockOnTarget>();
Debug.LogWarning($"The object <b>{mainTarget.gameObject.name}</b> has no ILockOnTarget interface. This isn't hyper critical, but adding one as a GenericLockOnTarget anyways.");
if (lockonGameObject != null && lockonTarget.Object.GetComponent<ILockOnTarget>() == null) {
Debug.LogError($"Game Object {lockonTarget.Object.name} does not implement the ILockOnTarget interface!");
}
elementRoot = lockOnDocument.rootVisualElement.Query<VisualElement>("LockOnGroup");
elementLabelName = lockOnDocument.rootVisualElement.Query<Label>("LockOnName").First();
// Add all nearby game objects to lock-on eligible list
GameObject[] allGameObjects = GameObject.FindObjectsByType<GameObject>(0, 0);
foreach (GameObject thisObject in allGameObjects) {
if (thisObject.GetComponent<ILockOnTarget>() != null) {
acceptedTargets.Add(thisObject);
foreach (GameObject thisObject in allGameObjects)
{
if (Vector3.Distance(transform.position, thisObject.transform.position) < lockOnRange) {
if (thisObject.GetComponent<ILockOnTarget>() != null) {
lockOnTargets.Add(thisObject);
}
}
}
}
void Update(){
if (mainTarget != null && mainTarget.gameObject.GetComponent<ILockOnTarget>() == null) {
mainTarget.gameObject.AddComponent<GenericLockOnTarget>();
Debug.LogWarning($"The object <b>{mainTarget.gameObject.name}</b> has no ILockOnTarget interface. This isn't hyper critical, but adding one as a GenericLockOnTarget anyways.");
if (lockonGameObject && lockonTarget.Object.GetComponent<ILockOnTarget>() == null) {
Debug.LogError($"Game Object {lockonTarget.Object.name} does not implement the ILockOnTarget interface!");
}
// Find the current lock-on target and increase it's weight to the .15f max slowly
// They start at 0 weight when the lock-on adds them to the group
if (lockonGameObject) {
CinemachineTargetGroup.Target currentTarget = targetGroup.Targets.Find(target => target == lockonTarget);
currentTarget.Weight = Mathf.MoveTowards(currentTarget.Weight, .15f, .5f * Time.deltaTime);
}
// Iterate through targets, pushing their Target Group weight towards their goal weight, or removing them if they get too low.
for (int i = 0; i < activeTargets.Count; i++) {
if (activeTargets[i].gameObject == this.gameObject) {
// If a target is not the current lock on target, lower their targeting weight. When low enough to not cause a sharp jitter, remove them.
for (int i = 1; i < targetGroup.Targets.Count; i++) {
if (targetGroup.Targets[i] == lockonTarget || targetGroup.Targets[i] == playerTarget){
continue;
}
if (targetGroup.Targets[i].Weight < 0.001f) {
StartCoroutine(RemoveFromTargetAtFrameEnd(targetGroup.Targets[i]));
continue;
}
activeTargets[i].cinemachineTarget.Weight =
Mathf.SmoothDamp(
activeTargets[i].cinemachineTarget.Weight,
activeTargets[i].targetWeight,
ref activeTargets[i].refVelocity,
smoothTime * Time.deltaTime);
if (activeTargets[i].cinemachineTarget.Weight < 0.0001f) {
StartCoroutine(RemoveFromTargetAtFrameEnd(activeTargets[i]));
}
targetGroup.Targets[i].Weight = Mathf.MoveTowards(targetGroup.Targets[i].Weight, 0f, 1f * Time.deltaTime);
}
}
IEnumerator RemoveFromTargetAtFrameEnd(ActiveLockOnTarget target){
IEnumerator RemoveFromTargetAtFrameEnd(CinemachineTargetGroup.Target indexOf){
yield return new WaitForEndOfFrame();
activeTargets.Remove(target);
targetGroup.Targets.Remove(target.cinemachineTarget);
targetGroup.Targets.Remove(indexOf);
}
public void AddNewTarget(GameObject targetObject, float targetWeight, bool isMain = false){
// Check that the target doesn't already exist- if it does, just change it's weight/make it main
foreach (ActiveLockOnTarget target in activeTargets) {
if (target.gameObject == targetObject) {
target.targetWeight = targetWeight;
if (isMain) {
mainTarget = target;
}
return;
}
}
// If it doesn't exist in the list of targets, add it
ActiveLockOnTarget newTarget = new ActiveLockOnTarget{
gameObject = targetObject,
targetWeight = mainTargetWeight,
cinemachineTarget = new CinemachineTargetGroup.Target{
Object = targetObject.transform,
Radius = 1f,
Weight = 0f
}
};
//Set as main
if (isMain) {
mainTarget = newTarget;
}
// Finalize
activeTargets.Add(newTarget);
targetGroup.Targets.Add(newTarget.cinemachineTarget);
}
public void QueueTargetRemoval(GameObject targetObject, bool deleteAfterRemoved = false){
// Ostensibly removes targest by setting their target weight to 0. Update loop finds targets with no weight and reduces their impact on the camera
// After it smooths their current weight to 0, it removes them
activeTargets.Find(target => target.gameObject == targetObject).targetWeight = 0f;
if (deleteAfterRemoved) {
StartCoroutine(DeleteGameObjectPostRemoval(targetObject));
}
// Remove as main target if it is
if (mainTarget == activeTargets.Find(target => target.gameObject == targetObject)) {
mainTarget = null;
}
}
IEnumerator DeleteGameObjectPostRemoval(GameObject targetObject){
ActiveLockOnTarget thisTarget = activeTargets.Find(target => target.gameObject == targetObject);
yield return new WaitForEndOfFrame();
while (activeTargets.Contains(thisTarget)) {
yield return null;
}
Destroy(thisTarget.gameObject);
}
public void ChangeLockOnTarget(){
Transform cameraTransform = Camera.main.transform;
@@ -173,9 +97,9 @@ public class LockOnManager : MonoBehaviour{
GameObject closestTarget = null;
float lowestDistanceToCenter = Mathf.Infinity;
foreach (GameObject target in acceptedTargets) {
foreach (GameObject target in lockOnTargets) {
// Skip the current target if one exists
if (mainTarget != null && mainTarget.gameObject == target) {
if (lockonGameObject != null && lockonTarget.Object.gameObject == target) {
continue;
}
@@ -186,12 +110,7 @@ public class LockOnManager : MonoBehaviour{
if (hit.transform != target.transform) {
continue;
}
// Skips targets too far
if (Vector3.Distance(transform.position, target.transform.position) > lockOnRange) {
continue;
}
// Skip targets outside lock on angle
float angleFromCameraForward = Vector3.Angle(cameraTransform.forward, cameraTransform.position.DirectionTo(target.transform.position));
if (angleFromCameraForward > lockOnMaxAngle) {
@@ -218,32 +137,37 @@ public class LockOnManager : MonoBehaviour{
return;
}
// Remove the main target that currently exists, if there is one.
if (mainTarget != null) {
QueueTargetRemoval(mainTarget.gameObject);
}
// Create a new Target for the Target Group
var newTarget = new CinemachineTargetGroup.Target{
Object = closestTarget.transform,
Radius = 1f,
Weight = 0f
};
// Begin tracking target, set as main
AddNewTarget(closestTarget.gameObject, mainTargetWeight, true);
// Set the new target variables
lockonTarget = newTarget;
lockonGameObject = closestTarget.gameObject;
targetGroup.Targets.Add(newTarget);
}
// Used by outside sources such as input to cancel lock-on.
public void RemoveMainTarget(){
QueueTargetRemoval(mainTarget.gameObject);
public void RemoveLockOnTarget(){
lockonTarget = null;
lockonGameObject = null;
}
void LateUpdate(){
if (mainTarget != null) {
if (lockonGameObject) {
// This is just test logic to get an image above a lock on.
// TODO: Replace with something less silly
Vector2 screenPos = RuntimePanelUtils.CameraTransformWorldToPanel(
lockOnDocument.rootVisualElement.panel,
mainTarget.gameObject.GetComponent<ILockOnTarget>().GetReticlePosition(),
lockonTarget.Object.GetComponent<ILockOnTarget>().GetReticlePosition(),
Camera.main
);
// Set name
elementLabelName.text = mainTarget.gameObject.name;
elementLabelName.text = lockonTarget.Object.name;
// Set position (add the width/height of the element)
elementRoot.style.top = new StyleLength(screenPos.y - 25f); // Was elementRoot.resolvedStyle.height * .7f

View File

@@ -13,7 +13,4 @@ public static class MathExtensions{
return (to - origin).normalized;
}
public static Color Alpha(this Color input, float newAlpha){
return new Color(input.r, input.g, input.b, newAlpha);
}
}

View File

@@ -1,487 +0,0 @@
using System;
using ParadoxNotion.Design;
using UnityEditor;
using UnityEngine;
namespace Reset.Core{
// Individual bool setting for each ring. Three of these will be used.
public struct OrbitalFollowValueGroup{
public string label;
public ValueChangeAction changeHeight;
public float height;
public ValueChangeAction changeRadius;
public float radius;
public OrbitalFollowValueGroup(string newLabel){
label = newLabel;
changeHeight = ValueChangeAction.NoChange;
height = 0f;
changeRadius = ValueChangeAction.NoChange;
radius = 0f;
}
}
// Enum options for individual camera settings
public enum ValueChangeAction{
NoChange,
NewValue,
ResetValue,
RelativeValue, // Placeholder for using as altering existing value
}
public struct CurveValueGroup{
public string label;
public AnimationCurve newValue;
public ValueChangeAction changeValue;
public CurveValueGroup(string newLabel){
changeValue = ValueChangeAction.NoChange;
newValue = new AnimationCurve();
label = newLabel;
}
}
public struct EnumValueGroup{
public string label;
public Enum newValue;
public ValueChangeAction changeValue;
public EnumValueGroup(string newLabel, Enum enumType){
changeValue = ValueChangeAction.NoChange;
newValue = enumType;
label = newLabel;
}
}
public struct Vector3ValueGroup{
public string label;
public Vector3 newValue;
public ValueChangeAction changeX;
public ValueChangeAction changeY;
public ValueChangeAction changeZ;
public Vector3ValueGroup(string newLabel){
changeX = ValueChangeAction.NoChange;
changeY = ValueChangeAction.NoChange;
changeZ = ValueChangeAction.NoChange;
newValue = Vector3.zero;
label = newLabel;
}
}
public struct Vector2ValueGroup{
public string label;
public Vector2 newValue;
public ValueChangeAction changeX;
public ValueChangeAction changeY;
public Vector2ValueGroup(string newLabel){
changeX = ValueChangeAction.NoChange;
changeY = ValueChangeAction.NoChange;
newValue = Vector2.zero;
label = newLabel;
}
}
public struct FloatValueGroup{
public string label;
public float value;
public ValueChangeAction changeValue;
public FloatValueGroup(string newLabel){
label = newLabel;
value = 0f;
changeValue = ValueChangeAction.NoChange;
}
}
public struct BoolValueGroup{
public string label;
public bool value;
public ValueChangeAction changeValue;
public BoolValueGroup(string newLabel){
label = newLabel;
value = true;
changeValue = ValueChangeAction.NoChange;
}
}
#if UNITY_EDITOR
public class BoolValueGroupDrawer : ObjectDrawer<BoolValueGroup> {
public override BoolValueGroup OnGUI(GUIContent content, BoolValueGroup _instance){
// Remove label for floats
EditorGUIUtility.labelWidth = 50;
// Set layout options for the label and the float fields
GUILayoutOption[] floatOptions = new GUILayoutOption[] {
GUILayout.Width(80.0f),
GUILayout.MinWidth(20.0f),
GUILayout.ExpandWidth(true),
};
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
GUILayout.Width(200.0f),
};
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
GUILayout.BeginVertical();
GUILayout.Label(_instance.label, labelOptions);
GUILayout.BeginHorizontal();
// Create the x settings enum
_instance.changeValue = (ValueChangeAction)EditorGUILayout.EnumPopup("", instance.changeValue);
// Create the value/disabled information field
if (_instance.changeValue == ValueChangeAction.NewValue){
_instance.value = EditorGUILayout.Toggle(_instance.value, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeValue == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// Close this line up
GUILayout.EndHorizontal();
GUILayout.EndVertical();
// Reset to default so the rest of things don't get messed up
EditorGUIUtility.labelWidth = 0;
return _instance;
}
}
public class CurveVlueGroupDrawer : ObjectDrawer<CurveValueGroup> {
public override CurveValueGroup OnGUI(GUIContent _content, CurveValueGroup _instance){
// Remove label for floats
EditorGUIUtility.labelWidth = 50;
// Set layout options for the label and the float fields
GUILayoutOption[] floatOptions = new GUILayoutOption[] {
GUILayout.Width(80.0f),
GUILayout.MinWidth(20.0f),
GUILayout.ExpandWidth(true),
};
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
GUILayout.Width(200.0f),
};
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
GUILayout.BeginVertical();
GUILayout.Label(_instance.label, labelOptions);
GUILayout.BeginHorizontal();
// Create the x settings enum
_instance.changeValue = (ValueChangeAction)EditorGUILayout.EnumPopup("", instance.changeValue);
// Create the value/disabled information field
if (_instance.changeValue == ValueChangeAction.NewValue){
_instance.newValue = EditorGUILayout.CurveField(_instance.newValue, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeValue == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// Close this line up
GUILayout.EndHorizontal();
GUILayout.EndVertical();
// Reset to default so the rest of things don't get messed up
EditorGUIUtility.labelWidth = 0;
return _instance;
}
}
public class EnumValueGroupDrawer : ObjectDrawer<EnumValueGroup>{
public override EnumValueGroup OnGUI(GUIContent _content, EnumValueGroup _instance){
// Set layout options for the label and the float fields
GUILayoutOption[] floatOptions = new GUILayoutOption[] {
GUILayout.Width(200.0f),
GUILayout.MinWidth(100.0f),
GUILayout.ExpandWidth(true),
};
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
GUILayout.Width(200.0f),
};
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
GUILayout.BeginVertical();
GUILayout.Label(_instance.label, labelOptions);
GUILayout.BeginHorizontal();
// Create the x settings enum
_instance.changeValue = (ValueChangeAction)EditorGUILayout.EnumPopup("", instance.changeValue);
// Create the value/disabled information field
if (_instance.changeValue == ValueChangeAction.NewValue){
_instance.newValue = EditorGUILayout.EnumPopup("", instance.newValue, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeValue == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// Close this line up
GUILayout.EndHorizontal();
GUILayout.EndVertical();
// Reset to default so the rest of things don't get messed up
EditorGUIUtility.labelWidth = 0;
return _instance;
}
}
public class FloatValueGroupDrawer : ObjectDrawer<FloatValueGroup> {
public override FloatValueGroup OnGUI(GUIContent _content, FloatValueGroup _instance){
// Remove label for floats
EditorGUIUtility.labelWidth = 50;
// Set layout options for the label and the float fields
GUILayoutOption[] floatOptions = new GUILayoutOption[] {
GUILayout.Width(80.0f),
GUILayout.MinWidth(20.0f),
GUILayout.ExpandWidth(true),
};
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
GUILayout.Width(200.0f),
};
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
GUILayout.BeginVertical();
GUILayout.Label(_instance.label, labelOptions);
GUILayout.BeginHorizontal();
// Create the x settings enum
_instance.changeValue = (ValueChangeAction)EditorGUILayout.EnumPopup("", instance.changeValue);
// Create the value/disabled information field
if (_instance.changeValue == ValueChangeAction.NewValue){
_instance.value = EditorGUILayout.FloatField(_instance.value, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeValue == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// Close this line up
GUILayout.EndHorizontal();
GUILayout.EndVertical();
// Reset to default so the rest of things don't get messed up
EditorGUIUtility.labelWidth = 0;
return _instance;
}
}
public class Vector3ValueGroupDrawer : ObjectDrawer<Vector3ValueGroup> {
public override Vector3ValueGroup OnGUI(GUIContent _content, Vector3ValueGroup _instance){
// Remove label for floats
EditorGUIUtility.labelWidth = 20;
// Set layout options for the label and the float fields
GUILayoutOption[] floatOptions = new GUILayoutOption[] {
GUILayout.Width(300.0f),
GUILayout.MinWidth(20.0f),
GUILayout.ExpandWidth(true),
};
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
GUILayout.Width(200.0f),
};
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
GUILayout.BeginVertical();
GUILayout.Label(_instance.label, labelOptions);
GUILayout.BeginHorizontal();
// Create the x settings enum
_instance.changeX = (ValueChangeAction)EditorGUILayout.EnumPopup("", instance.changeX);
// Create the value/disabled information field
if (_instance.changeX == ValueChangeAction.NewValue){
_instance.newValue.x = EditorGUILayout.FloatField(_instance.newValue.x, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeX == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// It do what it do.
GUILayout.Space(5);
// Create the y settings enum
_instance.changeY = (ValueChangeAction)EditorGUILayout.EnumPopup("", _instance.changeY);
// Create the value/disabled information field
if (_instance.changeY == ValueChangeAction.NewValue){
_instance.newValue.y = EditorGUILayout.FloatField(_instance.newValue.y, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeY == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// It do what it do.
GUILayout.Space(5);
// Create the y settings enum
_instance.changeZ = (ValueChangeAction)EditorGUILayout.EnumPopup("", _instance.changeZ);
// Create the value/disabled information field
if (_instance.changeZ == ValueChangeAction.NewValue){
_instance.newValue.z = EditorGUILayout.FloatField(_instance.newValue.z, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeZ == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// Close this line up
GUILayout.EndHorizontal();
GUILayout.EndVertical();
// Reset to default so the rest of things don't get messed up
EditorGUIUtility.labelWidth = 0;
return _instance;
}
}
public class Vector2ValueGroupDrawer : ObjectDrawer<Vector2ValueGroup> {
public override Vector2ValueGroup OnGUI(GUIContent _content, Vector2ValueGroup _instance){
// Remove label for floats
EditorGUIUtility.labelWidth = 50;
// Set layout options for the label and the float fields
GUILayoutOption[] floatOptions = new GUILayoutOption[] {
GUILayout.Width(300.0f),
GUILayout.MinWidth(20.0f),
GUILayout.ExpandWidth(true),
};
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
GUILayout.Width(200.0f),
};
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
GUILayout.BeginVertical();
GUILayout.Label(_instance.label, labelOptions);
GUILayout.BeginHorizontal();
// Create the x settings enum
_instance.changeX = (ValueChangeAction)EditorGUILayout.EnumPopup("", instance.changeX);
// Create the value/disabled information field
if (_instance.changeX == ValueChangeAction.NewValue){
_instance.newValue.x = EditorGUILayout.FloatField(_instance.newValue.x, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeX == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// It do what it do.
GUILayout.Space(5);
// Create the y settings enum
_instance.changeY = (ValueChangeAction)EditorGUILayout.EnumPopup("", _instance.changeY);
// Create the value/disabled information field
if (_instance.changeY == ValueChangeAction.NewValue){
_instance.newValue.y = EditorGUILayout.FloatField(_instance.newValue.y, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeY == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// Close this line up
GUILayout.EndHorizontal();
GUILayout.EndVertical();
// Reset to default so the rest of things don't get messed up
EditorGUIUtility.labelWidth = 0;
return _instance;
}
}
// Custom editor for each orbital follow ring setting
public class OrbitalFollowValueGroupDrawer : ObjectDrawer<OrbitalFollowValueGroup>{
public override OrbitalFollowValueGroup OnGUI(GUIContent _content, OrbitalFollowValueGroup _instance){
// Remove label for floats
EditorGUIUtility.labelWidth = 1;
// Set layout options for the label and the float fields
GUILayoutOption[] floatOptions = new GUILayoutOption[] {
GUILayout.Width(300.0f),
GUILayout.MinWidth(20.0f),
GUILayout.ExpandWidth(true),
};
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
GUILayout.Width(60.0f),
};
// Start a Horiztonal Section
GUILayout.BeginHorizontal();
// Add the left side label
GUILayout.Label(_instance.label, labelOptions);
// Create the height settings enum
_instance.changeHeight = (ValueChangeAction)EditorGUILayout.EnumPopup("", _instance.changeHeight);
// Create the value/disabled information field
if (_instance.changeHeight == ValueChangeAction.NewValue){
_instance.height = EditorGUILayout.FloatField(_instance.height, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeHeight == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// It do what it do.
GUILayout.Space(5);
// Create the radius settings enum
_instance.changeRadius = (ValueChangeAction)EditorGUILayout.EnumPopup("", _instance.changeRadius);
// Create the value/disabled information field
if (_instance.changeRadius == ValueChangeAction.NewValue){
_instance.radius = EditorGUILayout.FloatField(_instance.radius, floatOptions);
} else {
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.TextField(_instance.changeRadius == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
EditorGUI.EndDisabledGroup();
}
// Close this line up
GUILayout.EndHorizontal();
// Reset to default so the rest of things don't get messed up
EditorGUIUtility.labelWidth = 0;
return _instance;
}
}
#endif
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 111e95d8d161f7d4887fa7ccfa6d1454

View File

@@ -11,7 +11,7 @@ public struct CameraSettingSingleValue<T>{
public Vector2 velocityRefV2;
public Vector3 velocityRefV3;
public CameraSettingSingleValue(float defaultSmoothing = .2f, T original = default(T)){
public CameraSettingSingleValue(float defaultSmoothing, T original = default(T)){
originalValue = original;
targetValue = original;
smoothing = defaultSmoothing;
@@ -28,15 +28,6 @@ public struct CameraSettingSingleValue<T>{
public struct CameraSettingValues{
public CameraSettingSingleValue<float> mainFieldOfView;
public CameraSettingSingleValue<Vector3> orbitPositionDamping;
public CameraSettingSingleValue<Vector3> orbitTargetOffset;
public CameraSettingSingleValue<bool> axisLookEnabledX;
public CameraSettingSingleValue<bool> axisLookEnabledY;
public CameraSettingSingleValue<float> axisLookGainX;
public CameraSettingSingleValue<float> axisLookGainY;
public CameraSettingSingleValue<float> orbitFollowTopHeight;
public CameraSettingSingleValue<float> orbitFollowTopRadius;
@@ -52,15 +43,6 @@ public struct CameraSettingValues{
public CameraSettingValues(float defaultSmoothing){
mainFieldOfView = new CameraSettingSingleValue<float>(defaultSmoothing);
orbitPositionDamping = new CameraSettingSingleValue<Vector3>(defaultSmoothing);
orbitTargetOffset = new CameraSettingSingleValue<Vector3>(defaultSmoothing);
axisLookEnabledX = new CameraSettingSingleValue<bool>();
axisLookEnabledY = new CameraSettingSingleValue<bool>();
axisLookGainX = new CameraSettingSingleValue<float>(defaultSmoothing);
axisLookGainY = new CameraSettingSingleValue<float>(defaultSmoothing);
orbitFollowTopHeight = new CameraSettingSingleValue<float>(defaultSmoothing);
orbitFollowTopRadius = new CameraSettingSingleValue<float>(defaultSmoothing);
orbitFollowCenterHeight = new CameraSettingSingleValue<float>(defaultSmoothing);
@@ -84,7 +66,6 @@ public class CameraSettingsProcessor : MonoBehaviour{
private CinemachineOrbitalFollow orbit;
private CinemachineRotationComposer rotComp;
private CinemachineCameraOffset offset;
private CinemachineInputAxisController axisCont;
public void Awake(){
// Singleton management
@@ -100,18 +81,11 @@ public class CameraSettingsProcessor : MonoBehaviour{
orbit = mainCamera.GetComponent<CinemachineOrbitalFollow>();
rotComp = mainCamera.GetComponent<CinemachineRotationComposer>();
offset = mainCamera.GetComponent<CinemachineCameraOffset>();
axisCont = mainCamera.GetComponent<CinemachineInputAxisController>();
// Initialize camera settings values
values = new CameraSettingValues{
cameraOffsetOffset = new CameraSettingSingleValue<Vector3>(defaultSmoothing: .2f, offset.Offset),
mainFieldOfView = new CameraSettingSingleValue<float>(defaultSmoothing: .2f, main.Lens.FieldOfView),
axisLookEnabledX = new CameraSettingSingleValue<bool>(0, axisCont.Controllers[0].Enabled),
axisLookEnabledY = new CameraSettingSingleValue<bool>(0, axisCont.Controllers[1].Enabled),
axisLookGainX = new CameraSettingSingleValue<float>(defaultSmoothing: .2f, axisCont.Controllers[0].Input.Gain),
axisLookGainY = new CameraSettingSingleValue<float>(defaultSmoothing: .2f, axisCont.Controllers[1].Input.Gain),
orbitPositionDamping = new CameraSettingSingleValue<Vector3>(defaultSmoothing: .2f, orbit.TrackerSettings.PositionDamping),
orbitTargetOffset = new CameraSettingSingleValue<Vector3>(defaultSmoothing: .1f, orbit.TargetOffset),
orbitFollowTopHeight = new CameraSettingSingleValue<float>(defaultSmoothing: .2f, orbit.Orbits.Top.Height),
orbitFollowTopRadius = new CameraSettingSingleValue<float>(defaultSmoothing: .2f, orbit.Orbits.Top.Radius),
orbitFollowCenterHeight = new CameraSettingSingleValue<float>(defaultSmoothing: .2f, orbit.Orbits.Center.Height),
@@ -126,26 +100,6 @@ public class CameraSettingsProcessor : MonoBehaviour{
main.Lens.FieldOfView = Mathf.SmoothDamp(main.Lens.FieldOfView,
values.mainFieldOfView.targetValue, ref values.mainFieldOfView.velocityRef,
values.mainFieldOfView.smoothing);
axisCont.Controllers[0].Enabled = values.axisLookEnabledX.targetValue;
axisCont.Controllers[1].Enabled = values.axisLookEnabledY.targetValue;
axisCont.Controllers[0].Input.Gain = Mathf.SmoothDamp(axisCont.Controllers[0].Input.Gain,
values.axisLookGainX.targetValue, ref values.axisLookGainX.velocityRef,
values.axisLookGainX.smoothing);
axisCont.Controllers[1].Input.Gain = Mathf.SmoothDamp(axisCont.Controllers[1].Input.Gain,
values.axisLookGainY.targetValue, ref values.axisLookGainY.velocityRef,
values.axisLookGainY.smoothing);
orbit.TargetOffset = Vector3.SmoothDamp(orbit.TargetOffset,
values.orbitTargetOffset.targetValue, ref values.orbitTargetOffset.velocityRefV3,
values.orbitTargetOffset.smoothing);
orbit.TrackerSettings.PositionDamping = Vector3.SmoothDamp(orbit.TrackerSettings.PositionDamping,
values.orbitPositionDamping.targetValue, ref values.orbitPositionDamping.velocityRefV3,
values.orbitPositionDamping.smoothing);
orbit.Orbits.Top.Height = Mathf.SmoothDamp(orbit.Orbits.Top.Height,
values.orbitFollowTopHeight.targetValue, ref values.orbitFollowTopHeight.velocityRef,
@@ -178,8 +132,6 @@ public class CameraSettingsProcessor : MonoBehaviour{
offset.Offset = Vector3.SmoothDamp(offset.Offset,
values.cameraOffsetOffset.targetValue, ref values.cameraOffsetOffset.velocityRefV3,
values.cameraOffsetOffset.smoothing);
}
void Update(){

View File

@@ -5,10 +5,12 @@ using Sirenix.OdinInspector;
public class Player : MonoBehaviour{
[HideInInspector] public PlayerControls controls;
[HideInInspector] public PlayerMovement movement;
[HideInInspector] public new PlayerCamera camera;
void Awake(){
controls = GetComponent<PlayerControls>();
movement = GetComponent<PlayerMovement>();
}
void Start()

View File

@@ -6,43 +6,14 @@ public interface ILockOnTarget {
Transform transform {get;}
GameObject gameObject{ get; }
abstract void OnTargetDelete();
void Help(){
SafelyDeleteTarget();
}
public Vector3 GetReticlePosition(){
float upValue = 0f;
if (gameObject.GetComponent<Renderer>()){
Bounds objectBounds = gameObject.GetComponent<Renderer>().bounds;
upValue = objectBounds.size.y;
}
Bounds objectBounds = gameObject.GetComponent<Renderer>().bounds;
Vector3 reticlePosition = new Vector3(transform.position.x, transform.position.y + upValue, transform.position.z);
Vector3 reticlePosition = new Vector3(transform.position.x, transform.position.y + objectBounds.size.y, transform.position.z);
return reticlePosition;
}
public void OnEnable(){
Debug.Log("hewwo");
}
public void SafelyDeleteTarget(){
// gameObject.
foreach (LockOnManager.ActiveLockOnTarget target in LockOnManager.Instance.activeTargets) {
if (target.gameObject == this.gameObject) {
GameObject clone = new GameObject{name = $"Target Clone of {gameObject.name}", transform = { position = transform.position}};
target.gameObject = clone;
target.cinemachineTarget.Object = clone.transform;
LockOnManager.Instance.QueueTargetRemoval(clone, true);
}
}
}
}
public class PlayerCamera : MonoBehaviour{

View File

@@ -1,5 +1,4 @@
using System;
using System.Linq;
using UnityEditor;
using UnityEngine;
using UnityEngine.InputSystem;
@@ -7,15 +6,11 @@ using UnityEngine.UIElements;
using NodeCanvas;
using NodeCanvas.Framework;
using ParadoxNotion;
using Sirenix.OdinInspector;
public class PlayerControls : MonoBehaviour{
// References
private Player thisPlayer;
private PlayerInput input;
public SignalDefinition inputSignal;
// TODO: Turn these into accessors
public Vector2 rawMoveInput;
public Vector2 rawLookInput;
@@ -25,31 +20,6 @@ public class PlayerControls : MonoBehaviour{
void Awake(){
thisPlayer = GetComponent<Player>();
graph = GetComponent<GraphOwner>();
input = GetComponent<PlayerInput>();
// Add the delegates for each method
foreach (InputAction action in input.actions) {
action.started += SendToGraph;
action.canceled += SendToGraph;
action.performed += SendToGraph;
}
}
// Remove the delegates for each method
void OnDisable(){
foreach (InputAction action in input.actions) {
action.started -= SendToGraph;
action.canceled -= SendToGraph;
action.performed -= SendToGraph;
}
}
// This will call the OnSignalInvoke for this type of Signal Defintion. CheckInput is the recieving end.
public void SendToGraph(InputAction.CallbackContext ctx){
inputSignal.Invoke(transform, transform, false, new object[]{
ctx.action,
ctx.phase
});
}
public void OnMove(InputValue value){
@@ -76,7 +46,7 @@ public class PlayerControls : MonoBehaviour{
}
public void OnCancelLockOn(){
GetComponent<LockOnManager>().RemoveMainTarget();
GetComponent<LockOnManager>().RemoveLockOnTarget();
graph.SendEvent<string>("InputEvent", "CancelLockOn", null);
}

View File

@@ -1,368 +0,0 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using Drawing;
using Sirenix.OdinInspector;
using Sirenix.Serialization;
using Unity.Mathematics;
using UnityEngine.Serialization;
[Serializable]
public class EnvironmentObserver{
enum LabelDrawingLocation{
PlayerOffset,
HitLocation,
IntersectingLength,
}
enum ObserverGizmoDrawingCondition{
Always,
OnlyActive,
Never
}
public enum CastType{
Ray,
BoxOverlap,
SphereOverlap,
BoxCast,
SphereCast
}
[PropertySpace(0, 5), LabelWidth(60)]
public string label;
[PropertySpace(0, 10), LabelWidth(60)]
public CastType castType;
[Button(ButtonSizes.Large), GUIColor("@GetObserverStatusColorStatic(active, hit)"), PropertyOrder(-1), PropertySpace(5, 5)]
public void Active(){
active = !active;
}
[HideInInspector]
public bool active;
// Parameters for Cast cast types
[FoldoutGroup("Settings")] public float length;
[FoldoutGroup("Settings")] public Vector3 direction;
[FoldoutGroup("Settings")] public Vector3 offset;
[PropertySpace(0, 5), FoldoutGroup("Settings")] public LayerMask ignoreLayers = ~0;
[ShowIfGroup("Settings/CastsOnly", VisibleIf = "@castType == CastType.SphereCast || castType == CastType.SphereOverlap")]
[FoldoutGroup("Settings")] public float width;
// Parameters for Overlap cast types
[ShowIfGroup("Settings/3DOnly", VisibleIf = "@castType == CastType.BoxCast && castType != CastType.BoxOverlap")] [FoldoutGroup("Settings")]
public Vector3 size;
[ShowIfGroup("Settings/3DOnly")]
public Vector3 rotation;
[HideInInspector]
public RaycastHit hit;
[HideInInspector]
public Collider[] overlapHits;
[FoldoutGroup("Text")]
[BoxGroup("Text/Label")] public bool drawLabel;
[ShowInInspector, SerializeField] [BoxGroup("Text/Label")] LabelDrawingLocation labelTextLocation;
[BoxGroup("Text/Label")] public float labelSize;
[BoxGroup("Text/Label")] public Vector3 labelLocationOffset;
[BoxGroup("Text/Label")] public Vector3 labelRotationOffset;
[BoxGroup("Text/Hit")] public bool drawHitName;
[ShowInInspector, SerializeField] [BoxGroup("Text/Hit")] LabelDrawingLocation hitTextLocation;
[BoxGroup("Text/Hit")] public float hitTextSize;
[BoxGroup("Text/Hit")] public Vector3 hitLocationOffset;
[BoxGroup("Text/Hit")] public Vector3 hitRotationOffset;
[FoldoutGroup("Text"), SerializeField, ShowInInspector] ObserverGizmoDrawingCondition gizmoDrawingCondition;
[SerializeReference, PropertySpace(5, 5)]
public List<EnvironmentObserver> children;
// NOTE: I had a ref for a RaycastHit here that would correspond to hit but idk if it's needed.
public bool Evaluate(GameObject source){
if (active) {
// Remove player's layer from LayerMask.
ignoreLayers -= source.layer;
// Set some of the variables used later during casting
Vector3 relativeStart = source.transform.position + offset;
Vector3 relativeStartWithRotation = source.transform.position + source.transform.rotation * offset ;
switch (castType) {
case CastType.Ray:
Physics.Raycast(relativeStart, source.transform.rotation * direction, out hit, length, ignoreLayers);
break;
case CastType.BoxOverlap:
overlapHits = Physics.OverlapBox(relativeStartWithRotation, size / 2f,
source.transform.rotation * Quaternion.Euler(rotation), ignoreLayers);
if (overlapHits.Length > 0) {
return true;
};
break;
case CastType.SphereOverlap:
break;
case CastType.BoxCast:
// TODO: Make this not an if statement. Check that it works with NodeCanvas first
if (Physics.BoxCast(relativeStartWithRotation, size / 2f,
source.transform.rotation * Quaternion.Euler(rotation) * direction,
out hit, source.transform.rotation * Quaternion.Euler(rotation), length,
ignoreLayers)
) {
};
break;
case CastType.SphereCast:
// TODO: Make this not an if statement. Check that it works with NodeCanvas first
if (Physics.SphereCast(relativeStartWithRotation, width / 2f,
source.transform.rotation * Quaternion.Euler(rotation) * direction,
out hit, length,
ignoreLayers)
) {
};
break;
}
if (hit.transform != null) {
return true;
}
}
return false;
}
public void DrawObserverGizmo(GameObject source, bool drawAnyways = false){
if (!drawAnyways){
if (gizmoDrawingCondition == ObserverGizmoDrawingCondition.Never || (gizmoDrawingCondition == ObserverGizmoDrawingCondition.OnlyActive ! & active)) {
return;
}
}
Vector3 relativeStart = source.transform.position + offset;
Vector3 relativeStartWithRotation = source.transform.position + source.transform.rotation * (offset);
// Setup the variables for boxcast, spherecast, etc
// Create an offset start point for the center of the wirebox, since gizmos are drawn with their pivot in the center.
Vector3 offsetWithRotationAndLength;
if (direction == Vector3.zero) {
offsetWithRotationAndLength = Quaternion.Euler(rotation) * (Vector3.forward * (length / 2));
} else {
offsetWithRotationAndLength = Quaternion.LookRotation(direction) * Quaternion.Euler(rotation) * (Vector3.forward * (length / 2));
}
Vector3 offsetFromCenter = relativeStartWithRotation + source.transform.rotation * offsetWithRotationAndLength;
// Also create a rotation for use with the gizmos. Mainly just to shorten the lines
Quaternion gizmosRotation;
if (direction == Vector3.zero) {
gizmosRotation = source.transform.rotation * Quaternion.Euler(rotation);
} else {
gizmosRotation = source.transform.rotation * Quaternion.LookRotation(direction) * Quaternion.Euler(rotation);
}
Vector3 firstBoxOffset = gizmosRotation * (Vector3.forward * size.z);
Color gizmoColor = Evaluate(source) ? Color.green : Color.red;
gizmoColor = active ? gizmoColor : Color.gray;
using (Draw.ingame.WithColor(gizmoColor)){
switch (castType) {
case CastType.Ray:
Draw.ingame.Line(relativeStart, relativeStart + (source.transform.rotation * direction.normalized) * length);
break;
case CastType.BoxOverlap:
Draw.ingame.WireBox(relativeStartWithRotation, source.transform.rotation * Quaternion.Euler(rotation), size);
break;
case CastType.SphereCast:
Draw.ingame.SolidCircle(relativeStartWithRotation, relativeStartWithRotation - Camera.main.transform.position, width * 1, gizmoColor.Alpha(.5f));
Draw.ingame.WireCapsule(relativeStartWithRotation, relativeStartWithRotation + gizmosRotation * (Vector3.forward * (length - width / 2)), width);
break;
case CastType.BoxCast:
// Draw the gizmos for the boxcast
Draw.ingame.WireBox(offsetFromCenter, gizmosRotation, new float3(size.x, size.y, length));
Draw.ingame.SolidBox(relativeStartWithRotation, gizmosRotation, size, gizmoColor.Alpha(.1f));
Draw.ingame.WireBox(relativeStartWithRotation, gizmosRotation, size);
break;
default:
throw new ArgumentOutOfRangeException();
}
Draw.ingame.SolidCircle(relativeStartWithRotation, relativeStartWithRotation - Camera.main.transform.position, .4f);
Draw.ingame.SolidCircle(hit.point, hit.point - Camera.main.transform.position, .4f);
// Set up variables for label (not hit name)
Vector3 labelStartPos = Vector3.zero;
switch (labelTextLocation) {
case LabelDrawingLocation.PlayerOffset:
labelStartPos = source.transform.position;
break;
case LabelDrawingLocation.IntersectingLength:
labelStartPos = offsetFromCenter;
break;
case LabelDrawingLocation.HitLocation:{
if (hit.transform != null) {
labelStartPos = hit.point;
}
break;
}
}
// Draw label
if (drawLabel) {
Draw.ingame.Label3D(
labelStartPos + labelLocationOffset,
gizmosRotation * Quaternion.Euler(labelRotationOffset),
label,
labelSize,
LabelAlignment.MiddleLeft,
gizmoColor
);
}
// Set up variables for hit name
// Since the label is already drawn just use the previous startPos
switch (labelTextLocation) {
case LabelDrawingLocation.PlayerOffset:
labelStartPos = source.transform.position;
break;
case LabelDrawingLocation.IntersectingLength:
labelStartPos = offsetFromCenter;
break;
case LabelDrawingLocation.HitLocation:{
if (hit.transform != null) {
labelStartPos = hit.point;
}
break;
}
}
// Draw hitname
if (drawLabel) {
Draw.ingame.Label3D(
labelStartPos + labelLocationOffset,
gizmosRotation * Quaternion.Euler(labelRotationOffset),
label,
hitTextSize,
LabelAlignment.MiddleLeft,
gizmoColor
);
}
}
}
static Color GetObserverStatusColorStatic(bool active, RaycastHit hit){
if (active) {
if (hit.Equals(default(RaycastHit))) {
return Color.green;
}
return Color.red;
}
return Color.gray;
}
}
public class PlayerEnvironmentManager : MonoBehaviour{
[OdinSerialize]
public List<EnvironmentObserver> observers;
void Start(){
CheckDuplicateLabels(observers);
}
// TODO: Not working.
void CheckDuplicateLabels(List<EnvironmentObserver> sourceList){
foreach (EnvironmentObserver sourceObserver in observers) {
foreach (EnvironmentObserver observer in sourceList) {
if (sourceObserver == observer) {
continue;
}
if (sourceObserver.label == observer.label) {
Debug.LogError($"Duplicate label found in observer: {observer.label} is in use multiple times");
}
if (observer.children != null && observer.children.Count > 0) {
CheckDuplicateLabels(observer.children);
}
}
}
}
public bool EvaluateFromString(string searchLabel, List<EnvironmentObserver> observerList = null){
List<EnvironmentObserver> listToUse = observers;
if (observerList != null) {
listToUse = observerList;
}
foreach (EnvironmentObserver observer in listToUse) {
if (observer.label == searchLabel) {
return observer.Evaluate(gameObject);
}
if (observer.children != null && observer.children.Count > 0) {
foreach (EnvironmentObserver childObserver in observer.children) {
EvaluateFromString(searchLabel, childObserver.children);
}
}
}
return false;
}
public EnvironmentObserver FindObserverFromString(string searchLabel, List<EnvironmentObserver> observerList = null){
List<EnvironmentObserver> listToUse = observers;
if (observerList != null) {
listToUse = observerList;
}
foreach (EnvironmentObserver observer in listToUse) {
if (observer.label == searchLabel) {
return observer;
}
if (observer.children != null && observer.children.Count > 0) {
foreach (EnvironmentObserver childObserver in observer.children) {
FindObserverFromString(searchLabel, childObserver.children);
}
}
}
return null;
}
void Update(){
}
void LateUpdate(){
// Draw Gizmos
foreach (EnvironmentObserver observer in observers) {
observer.DrawObserverGizmo(gameObject);
if (observer.children != null && observer.children.Count > 0) {
foreach (EnvironmentObserver childObserver in observer.children) {
childObserver.DrawObserverGizmo(gameObject);
}
}
}
// Clear hit
foreach (EnvironmentObserver observer in observers) {
observer.hit = default;
if (observer.children != null && observer.children.Count > 0) {
foreach (EnvironmentObserver childObserver in observer.children) {
childObserver.hit = default;
}
}
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 7a8c0593fef54844383c2f154cf8806c

View File

@@ -0,0 +1,56 @@
using UnityEngine;
using Drawing;
public class PlayerMovement : MonoBehaviour
{
// Raycasts
public RaycastHit forwardRay;
public RaycastHit leftRay;
public RaycastHit rightRay;
// References
private Player thisPlayer;
void Awake(){
thisPlayer = GetComponent<Player>();
}
void Update(){
// Create Ray Colors
Color forwardRayStatus = Color.red;
Color leftRayStatus = Color.red;
Color rightRayStatus = Color.red;
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)) {
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(){
LayerMask environmentLayer = LayerMask.NameToLayer("Environment");
if (Physics.Raycast(transform.position + Vector3.up, transform.forward, out forwardRay, 2.5f, ~environmentLayer)){
thisPlayer.controls.graph.SendEvent("ForwardRay", true, null);
}
if (Physics.Raycast(transform.position + Vector3.up, transform.position + Vector3.left, out leftRay, maxDistance: 2f, ~environmentLayer )) {
thisPlayer.controls.graph.SendEvent("LeftRay", true, null);
}
if (Physics.Raycast(transform.position + Vector3.up, transform.position + Vector3.right, out rightRay, maxDistance: 2f, ~environmentLayer )) {
thisPlayer.controls.graph.SendEvent("RightRay", true, null);
}
}
}

View File

@@ -1,320 +0,0 @@
using System;
using UnityEngine;
using ParadoxNotion.Design;
using Sirenix.OdinInspector;
using UnityEngine.Serialization;
public enum PlayerFacingDirection{
TowardsTarget = 0,
MatchForward,
MatchCamera,
Static,
Momentum,
SpecifiedDirection
}
namespace Reset.Units{
// public interface IBuffSource{ - Unused good idea?
// public Object sourceObject();
// public
// }
[Serializable]
public class UnitMovementData : ICloneable{
// Movement Direction
public float accelerationSmoothing = 5f;
public float deaccelerationSmoothing = 5f;
// public AnimationCurve deaccelerationCurve; // Currently unused, may return
[SliderField(0,1)]
public float airDirectionDecay;
// Move Speed
public float moveSpeed = 15f;
public float moveSpeedSoothing = 10f;
// Jumping
[ShowInInspector, ReadOnly] public float jumpPower;
public float jumpPowerDecay = 3f;
// Gravity
[ShowInInspector, ReadOnly] public float gravityPower;
public float gravityMax = 8f;
public float gravityAcceleration = 1f;
public float gravityScale = 1f;
// Rotation
[ShowInInspector, SerializeReference]
public Enum rotateFacing;
[FormerlySerializedAs("rotationSpeedTarget")] public float rotationSpeed = 5f;
public float rotationSmoothing = 1f;
public float rotationInputBlending = .3f;
public object Clone(){
return MemberwiseClone();
}
}
public class UnitMovementHandler : MonoBehaviour{
// class MovementFloatModifier{
// // IBuffSource source
// public float value;
// }
// Debug viewing
[ShowInInspector, ReadOnly] private float outputSpeed;
[ShowInInspector, ReadOnly] private float additionalSpeed;
[ShowInInspector, ReadOnly] public Vector3 outputMoveDirection;
[ShowInInspector, ReadOnly] private Vector3 additionalMoveDirection;
[ShowInInspector, ReadOnly] private Quaternion outputRotation;
[ShowInInspector, ReadOnly] private Quaternion specifiedRotation;
[ShowInInspector, ReadOnly] private float outputRotationSpeed;
private float directionChangeDot;
private CharacterController controller;
private PlayerControls controls;
private LockOnManager lockOnManager;
[ShowInInspector, PropertyOrder(2)]
public UnitMovementData data = new();
[HideInInspector]
public UnitMovementData defaultData;
void Awake(){
controller = GetComponent<CharacterController>();
controls = GetComponent<PlayerControls>();
lockOnManager = GetComponent<LockOnManager>();
}
private void Start(){
defaultData = (UnitMovementData)data.Clone();
}
void Update(){
UpdateCurrentDirection();
UpdateCurrentSpeed();
UpdateCurrentGravity();
UpdateCurrentRotation();
DoMovement();
}
// Add directly to the direction
public void AddToCurrentDirection(Vector3 inputDirection, float power){
additionalMoveDirection += inputDirection.normalized;
additionalSpeed = power;
}
// Hold a new rotation to be moved to during PlayerFacingDirection.SpecifiedRotation
public void SetSpecifiedRotation(Quaternion inputRotation){
specifiedRotation = inputRotation;
}
// Blend between the current direction and an input direction, based on the current controller input
public void OverwriteDirectionFromInput(Vector2 value, float priority, float speed = Mathf.Infinity){
// Create a new direction that is the current controller input * the amount of power they should have
Vector3 dirToAdd = new Vector3(controls.rawMoveInput.x * value.x, 0f, controls.rawMoveInput.y * value.y);
// Multiply it by the current magnitude (why? i forgor)
dirToAdd *= controls.rawMoveInput.magnitude;
// Blend the existing direction into it
dirToAdd = Vector3.Lerp(outputMoveDirection, dirToAdd, priority * controls.rawMoveInput.magnitude);
// Set the new direction
outputMoveDirection = new Vector3(dirToAdd.x, outputMoveDirection.y, dirToAdd.z);
// Everthing under here is for the speed now. If it's not set do...nothing. Otherwise set it to the max value between move speed and the new speed
if (float.IsPositiveInfinity(speed)) {
return;
}
outputSpeed = Mathf.Lerp(outputSpeed, Mathf.Max(data.moveSpeed, speed), priority);
}
// Update the direction, called every frame
private void UpdateCurrentDirection(){
// Get input value
Vector3 inputMovement = new Vector3(controls.rawMoveInput.x, 0f, controls.rawMoveInput.y);
// Construct move direction
Vector3 targetDirection = inputMovement;
// Deadzone
if (inputMovement.magnitude < .05f) {
targetDirection = Vector3.zero;
}
// Remove Y from variables
Vector3 targetNoY = new Vector3(targetDirection.x, 0f, targetDirection.z);
Vector3 currentNoY = new Vector3(outputMoveDirection.x, 0f, outputMoveDirection.z);
// Also need to find the dot value of the current input versus the current move direction
Vector3 slerpedValue;
Vector3 lerpedValue;
float switchedDirection = Vector3.Dot(inputMovement, outputMoveDirection);
float switchedDirectionRemapped = Mathf.Lerp(0, 1, switchedDirection);
directionChangeDot = Mathf.Lerp(switchedDirection, switchedDirectionRemapped, 5f * Time.deltaTime) ; // turn that .5f into a variable
// Smooth movement. Use deaccel smoothing if the input magnitude is lower, and accel smoothing if it's higher
// Also checks when grounded to only use Slerp on the ground
if (targetNoY.magnitude > currentNoY.magnitude) {
if (controller.isGrounded){
slerpedValue = Vector3.Slerp(currentNoY, targetNoY, data.accelerationSmoothing * Time.deltaTime);
lerpedValue = Vector3.Lerp(currentNoY, targetNoY, data.accelerationSmoothing * Time.deltaTime);
currentNoY = Vector3.Lerp(lerpedValue, slerpedValue, directionChangeDot);
} else {
currentNoY = Vector3.Lerp(currentNoY, targetNoY, data.accelerationSmoothing * Time.deltaTime);
}
} else {
if (controller.isGrounded){
slerpedValue = Vector3.Slerp(currentNoY, targetNoY, data.deaccelerationSmoothing * Time.deltaTime);
lerpedValue = Vector3.Lerp(currentNoY, targetNoY, data.deaccelerationSmoothing * Time.deltaTime);
currentNoY = Vector3.Lerp(lerpedValue, slerpedValue, directionChangeDot);
} else {
currentNoY = Vector3.Lerp(currentNoY, targetNoY, data.deaccelerationSmoothing * data.airDirectionDecay * Time.deltaTime);
}
}
// Commit move direction
outputMoveDirection = new Vector3(currentNoY.x, outputMoveDirection.y, currentNoY.z);
}
// Update the speed, called every frame
private void UpdateCurrentSpeed(){
outputSpeed = Mathf.Lerp(outputSpeed, data.moveSpeed, data.moveSpeedSoothing * Time.deltaTime);
}
// Update the gravity, called every frame
private void UpdateCurrentGravity(){
// Accelerate gravity
data.gravityPower += data.gravityAcceleration * Time.deltaTime;
data.gravityPower = Mathf.Min(data.gravityPower, data.gravityMax);
// Apply a constant gravity if the player is grounded
if (controller.isGrounded) {
data.gravityPower = .1f;
}
// Create the final gravity value
float gravityMoveDirection = data.jumpPower + (Physics.gravity.y * data.gravityPower);
// Commit gravity to move direction, ignoring XZ since those are done in UpdateMovementDirection
outputMoveDirection.y = gravityMoveDirection;
}
// Update the rotation, called every frame
private void UpdateCurrentRotation(){
// Get input value
Vector3 inputMovement = new Vector3(controls.rawMoveInput.x, 0f, controls.rawMoveInput.y);
// Switch the desired rotation based on current movement setting
switch (data.rotateFacing) {
// Just look at target
case PlayerFacingDirection.TowardsTarget:
// Look directly at the target
outputRotation = Quaternion.LookRotation(transform.position.DirectionTo(lockOnManager.mainTarget.gameObject.transform.position));
break;
case PlayerFacingDirection.Momentum:
// Look towards the current direction the agent is moving
if (inputMovement.magnitude > .05f){
outputRotation = Camera.main.transform.rotation * Quaternion.LookRotation(outputMoveDirection);
}
break;
case PlayerFacingDirection.MatchForward:
// Look towards the input direction....why??? I guess cause move direction is PlayerFacingDirection.Momentum.
if (controls.rawMoveInput.magnitude < 0.05f) { break; }
outputRotation = Camera.main.transform.rotation * Quaternion.LookRotation(inputMovement);
break;
case PlayerFacingDirection.MatchCamera:
// Look the same direction as the camera
outputRotation = Quaternion.Euler(Camera.main.transform.rotation.eulerAngles.Flatten(0, null, 0));
break;
case PlayerFacingDirection.Static:
// Don't change
outputRotation = transform.rotation;
break;
case PlayerFacingDirection.SpecifiedDirection:
// Look at an inputed rotation
outputRotation = specifiedRotation;
break;
}
// Add the current input into the created rotation
if (inputMovement.magnitude > .05){
outputRotation = Quaternion.Lerp(outputRotation, Camera.main.transform.rotation * Quaternion.LookRotation(inputMovement), data.rotationInputBlending);
}
// Calculate rotation speed, as in how fast the fella rotates. This value has it's own smoothing to allow for gradual increasing/decreasing of the speed till it reaches the target
outputRotationSpeed = Mathf.Lerp(outputRotationSpeed, data.rotationSpeed, data.rotationSmoothing * Time.deltaTime);
// Set final rotation
transform.rotation = Quaternion.Slerp(transform.rotation, outputRotation, outputRotationSpeed * Time.deltaTime).Flatten(0, null, 0);
}
// Move with default settings
public void DoMovement(){
DoMovement(outputMoveDirection, outputSpeed, data.gravityScale);
}
// Custom move from input
public void DoMovement(Vector3 moveDir, float speed, float gravity){
// Seperate the different move directions. Additonal becomes it's own because it needs to be added independently of the other two
Vector3 moveXZDir = new Vector3(moveDir.x, 0f, moveDir.z);
Vector3 moveYDir = new Vector3(0f, moveDir.y, 0f);
Vector3 addDir = additionalMoveDirection;
// Add their related speeds
moveXZDir *= speed * Time.deltaTime;
moveYDir *= gravity * Time.deltaTime;
addDir *= additionalSpeed * Time.deltaTime;
// Construct the direction and move
Vector3 finalDir = moveXZDir + moveYDir;
controller.Move((Camera.main.transform.rotation.Flatten(0, null, 0) * finalDir) + addDir);
}
void LateUpdate(){
UpdateGravityLate();
DecayAdditionalDirection();
}
void DecayAdditionalDirection(){
// Get input value
Vector3 inputMovement = new Vector3(controls.rawMoveInput.x, 0f, controls.rawMoveInput.y);
// Ignore values under deadzone
if (inputMovement.magnitude < .1f) {
inputMovement = Vector3.zero;
}
// Remove Y from variables
Vector3 currentNoY = new Vector3(additionalMoveDirection.x, 0f, additionalMoveDirection.z);
// Decay the direction
if (inputMovement.magnitude < currentNoY.magnitude) {
additionalMoveDirection = Vector3.Slerp(additionalMoveDirection, Vector3.zero,data.accelerationSmoothing * Time.deltaTime);
} else {
// float deaccelValue = data.deaccelerationCurve.Evaluate(inputMovement.magnitude);
additionalMoveDirection = Vector3.Lerp(additionalMoveDirection, Vector3.zero, data.deaccelerationSmoothing * Time.deltaTime);
}
}
private void UpdateGravityLate(){
// Decay jump power
data.jumpPower -= data.jumpPowerDecay * Time.deltaTime;
data.jumpPower = Mathf.Max(0f, data.jumpPower);
}
}
}

View File

@@ -9,7 +9,7 @@
"GUID:de4e6084e6d474788bb8c799d6b461ec",
"GUID:d8b63aba1907145bea998dd612889d6b",
"GUID:4307f53044263cf4b835bd812fc161a4",
"GUID:e0cd26848372d4e5c891c569017e11f1",
"GUID:4099e5319e98558428028d54bc62664e",
"GUID:1826c0224c0d048b88112c79bbb0cd85"
],
"includePlatforms": [],

View File

@@ -1,116 +0,0 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using Sirenix.OdinInspector;
using UnityEngine.ProBuilder;
using UnityEngine.ProBuilder.MeshOperations;
using Random = UnityEngine.Random;
public class WorldGenerator : MonoBehaviour{
public Vector2 worldSize;
public int platformCount;
[MinMaxSlider(1f, 100f)]
public Vector2 platformHeightRange;
[MinMaxSlider(25f, 300f)]
public Vector2 platformWidthRange;
[Header("Mega Platforms")]
public int megaPlatformCount;
[MinMaxSlider(30f, 100f)]
public Vector2 megaPlatformtHeightRange = new Vector2(20, 20);
[MinMaxSlider(250f, 500f)]
public Vector2 megaPlatformWidthRange = new Vector2(50, 50);
private List<GameObject> allPlatforms = new List<GameObject>();
private List<GameObject> megaPlatforms = new List<GameObject>();
void Start(){
GenerateWorld();
}
[Button]
public void RegenerateWorld(){
ClearWorld();
GenerateWorld();
}
void ClearWorld(){
allPlatforms.ForEach(Destroy);
}
void GenerateWorld(){
GenerateMegaPlatforms();
GenerateStandardPlatforms();
}
void GenerateMegaPlatforms(){
for (int i = 0; i < megaPlatformCount; i++) {
Vector3 newPlatformSize = new Vector3(
Random.Range(megaPlatformWidthRange.x, megaPlatformWidthRange.y),
Random.Range(megaPlatformtHeightRange.x, megaPlatformtHeightRange.y),
Random.Range(megaPlatformWidthRange.x, megaPlatformWidthRange.y)
);
var newPlatform = ShapeGenerator.GenerateCube(PivotLocation.Center, newPlatformSize);
newPlatform.SetMaterial(newPlatform.faces, BuiltinMaterials.defaultMaterial);
newPlatform.gameObject.AddComponent<BoxCollider>();
newPlatform.transform.position = new Vector3(
Random.Range(-worldSize.x, worldSize.x),
newPlatformSize.y / 2f,
Random.Range(-worldSize.y, worldSize.y)
);
newPlatform.gameObject.name = "Megaplatform";
megaPlatforms.Add(newPlatform.gameObject);
allPlatforms.Add(newPlatform.gameObject);
}
}
void GenerateStandardPlatforms(){
for (int i = 0; i < platformCount; i++) {
Vector3 newPlatformSize = new Vector3(
Random.Range(platformWidthRange.x, platformWidthRange.y),
Random.Range(platformHeightRange.x, platformHeightRange.y),
Random.Range(platformWidthRange.x, platformWidthRange.y)
);
var newPlatform = ShapeGenerator.GenerateCube(PivotLocation.Center, newPlatformSize);
newPlatform.gameObject.layer = 2;
newPlatform.SetMaterial(newPlatform.faces, BuiltinMaterials.defaultMaterial);
Vector3 newPlatformPosXZ = new Vector3(
Random.Range(-worldSize.x, worldSize.x),
350f,
Random.Range(-worldSize.y, worldSize.y)
);
Physics.Raycast(newPlatformPosXZ, Vector3.down, out RaycastHit hit, Mathf.Infinity, LayerMask.GetMask("Default"));
Debug.Log(hit.collider.name);
newPlatform.transform.position = new Vector3(
newPlatformPosXZ.x,
hit.point.y + newPlatformSize.y /2f,
newPlatformPosXZ.z
);
newPlatform.gameObject.name = "Platform";
// newPlatform.gameObject.AddComponent<BoxCollider>();
allPlatforms.Add(newPlatform.gameObject);
}
}
// Update is called once per frame
void Update()
{
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: f48f68f001ea2ca4b89207ff5b4960a9

View File

@@ -342,9 +342,6 @@ MonoBehaviour:
skyOcclusionIntensityMultiplier:
m_OverrideState: 1
m_Value: 1
worldOffset:
m_OverrideState: 1
m_Value: {x: 0, y: 0, z: 0}
--- !u!114 &-1216621516061285780
MonoBehaviour:
m_ObjectHideFlags: 3
@@ -465,6 +462,8 @@ MonoBehaviour:
- {fileID: -6288072647309666549}
- {fileID: 7518938298396184218}
- {fileID: -1410297666881709256}
- {fileID: -7750755424749557576}
- {fileID: -5139089513906902183}
--- !u!114 &853819529557874667
MonoBehaviour:
m_ObjectHideFlags: 3

View File

@@ -17,7 +17,7 @@ MonoBehaviour:
lineOpacity: 1
solidOpacity: 0.55
textOpacity: 1
lineOpacityBehindObjects: 0.3186
solidOpacityBehindObjects: 0.1286
textOpacityBehindObjects: 0.0881
lineOpacityBehindObjects: 0.12
solidOpacityBehindObjects: 0.45
textOpacityBehindObjects: 0.9
curveResolution: 1

View File

@@ -54,18 +54,16 @@ MonoBehaviour:
- rid: 6852985685364965394
- rid: 8712630790384254976
- rid: 1219305102947385344
- rid: 2028245633001062400
- rid: 2028245633001062401
- rid: 2028245633001062402
- rid: 2028245633001062403
- rid: 2028245633001062404
- rid: 2028245633001062405
- rid: 2028245633001062406
- rid: 2028245633001062407
m_RuntimeSettings:
m_List:
- rid: 6852985685364965378
- rid: 6852985685364965379
- rid: 6852985685364965380
- rid: 6852985685364965381
- rid: 6852985685364965384
- rid: 6852985685364965385
- rid: 6852985685364965392
- rid: 6852985685364965394
- rid: 8712630790384254976
- rid: 1219305102947385344
m_List: []
m_AssetVersion: 8
m_ObsoleteDefaultVolumeProfile: {fileID: 0}
m_RenderingLayerNames:
@@ -102,6 +100,133 @@ MonoBehaviour:
m_xrOcclusionMeshPS: {fileID: 4800000, guid: 4431b1f1f743fbf4eb310a967890cbea, type: 3}
m_xrMirrorViewPS: {fileID: 4800000, guid: d5a307c014552314b9f560906d708772, type: 3}
m_xrMotionVector: {fileID: 4800000, guid: f89aac1e4f84468418fe30e611dff395, type: 3}
- rid: 2028245633001062400
type: {class: PostProcessData/ShaderResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:
stopNanPS: {fileID: 4800000, guid: 1121bb4e615ca3c48b214e79e841e823, type: 3}
subpixelMorphologicalAntialiasingPS: {fileID: 4800000, guid: 63eaba0ebfb82cc43bde059b4a8c65f6, type: 3}
gaussianDepthOfFieldPS: {fileID: 4800000, guid: 5e7134d6e63e0bc47a1dd2669cedb379, type: 3}
bokehDepthOfFieldPS: {fileID: 4800000, guid: 2aed67ad60045d54ba3a00c91e2d2631, type: 3}
cameraMotionBlurPS: {fileID: 4800000, guid: 1edcd131364091c46a17cbff0b1de97a, type: 3}
paniniProjectionPS: {fileID: 4800000, guid: a15b78cf8ca26ca4fb2090293153c62c, type: 3}
lutBuilderLdrPS: {fileID: 4800000, guid: 65df88701913c224d95fc554db28381a, type: 3}
lutBuilderHdrPS: {fileID: 4800000, guid: ec9fec698a3456d4fb18cf8bacb7a2bc, type: 3}
bloomPS: {fileID: 4800000, guid: 5f1864addb451f54bae8c86d230f736e, type: 3}
temporalAntialiasingPS: {fileID: 4800000, guid: 9c70c1a35ff15f340b38ea84842358bf, type: 3}
LensFlareDataDrivenPS: {fileID: 4800000, guid: 6cda457ac28612740adb23da5d39ea92, type: 3}
LensFlareScreenSpacePS: {fileID: 4800000, guid: 701880fecb344ea4c9cd0db3407ab287, type: 3}
scalingSetupPS: {fileID: 4800000, guid: e8ee25143a34b8c4388709ea947055d1, type: 3}
easuPS: {fileID: 4800000, guid: 562b7ae4f629f144aa97780546fce7c6, type: 3}
uberPostPS: {fileID: 4800000, guid: e7857e9d0c934dc4f83f270f8447b006, type: 3}
finalPostPassPS: {fileID: 4800000, guid: c49e63ed1bbcb334780a3bd19dfed403, type: 3}
m_ShaderResourcesVersion: 0
- rid: 2028245633001062401
type: {class: ScreenSpaceAmbientOcclusionPersistentResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:
m_Shader: {fileID: 4800000, guid: 0849e84e3d62649e8882e9d6f056a017, type: 3}
m_Version: 0
- rid: 2028245633001062402
type: {class: UniversalRenderPipelineEditorAssets, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:
m_DefaultSettingsVolumeProfile: {fileID: 11400000, guid: eda47df5b85f4f249abf7abd73db2cb2, type: 2}
- rid: 2028245633001062403
type: {class: ScreenSpaceAmbientOcclusionDynamicResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:
m_BlueNoise256Textures:
- {fileID: 2800000, guid: 36f118343fc974119bee3d09e2111500, type: 3}
- {fileID: 2800000, guid: 4b7b083e6b6734e8bb2838b0b50a0bc8, type: 3}
- {fileID: 2800000, guid: c06cc21c692f94f5fb5206247191eeee, type: 3}
- {fileID: 2800000, guid: cb76dd40fa7654f9587f6a344f125c9a, type: 3}
- {fileID: 2800000, guid: e32226222ff144b24bf3a5a451de54bc, type: 3}
- {fileID: 2800000, guid: 3302065f671a8450b82c9ddf07426f3a, type: 3}
- {fileID: 2800000, guid: 56a77a3e8d64f47b6afe9e3c95cb57d5, type: 3}
m_Version: 0
- rid: 2028245633001062404
type: {class: PostProcessData/TextureResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:
blueNoise16LTex:
- {fileID: 2800000, guid: 81200413a40918d4d8702e94db29911c, type: 3}
- {fileID: 2800000, guid: d50c5e07c9911a74982bddf7f3075e7b, type: 3}
- {fileID: 2800000, guid: 1134690bf9216164dbc75050e35b7900, type: 3}
- {fileID: 2800000, guid: 7ce2118f74614a94aa8a0cdf2e6062c3, type: 3}
- {fileID: 2800000, guid: 2ca97df9d1801e84a8a8f2c53cb744f0, type: 3}
- {fileID: 2800000, guid: e63eef8f54aa9dc4da9a5ac094b503b5, type: 3}
- {fileID: 2800000, guid: 39451254daebd6d40b52899c1f1c0c1b, type: 3}
- {fileID: 2800000, guid: c94ad916058dff743b0f1c969ddbe660, type: 3}
- {fileID: 2800000, guid: ed5ea7ce59ca8ec4f9f14bf470a30f35, type: 3}
- {fileID: 2800000, guid: 071e954febf155243a6c81e48f452644, type: 3}
- {fileID: 2800000, guid: 96aaab9cc247d0b4c98132159688c1af, type: 3}
- {fileID: 2800000, guid: fc3fa8f108657e14486697c9a84ccfc5, type: 3}
- {fileID: 2800000, guid: bfed3e498947fcb4890b7f40f54d85b9, type: 3}
- {fileID: 2800000, guid: d512512f4af60a442ab3458489412954, type: 3}
- {fileID: 2800000, guid: 47a45908f6db0cb44a0d5e961143afec, type: 3}
- {fileID: 2800000, guid: 4dcc0502f8586f941b5c4a66717205e8, type: 3}
- {fileID: 2800000, guid: 9d92991794bb5864c8085468b97aa067, type: 3}
- {fileID: 2800000, guid: 14381521ff11cb74abe3fe65401c23be, type: 3}
- {fileID: 2800000, guid: d36f0fe53425e08499a2333cf423634c, type: 3}
- {fileID: 2800000, guid: d4044ea2490d63b43aa1765f8efbf8a9, type: 3}
- {fileID: 2800000, guid: c9bd74624d8070f429e3f46d161f9204, type: 3}
- {fileID: 2800000, guid: d5c9b274310e5524ebe32a4e4da3df1f, type: 3}
- {fileID: 2800000, guid: f69770e54f2823f43badf77916acad83, type: 3}
- {fileID: 2800000, guid: 10b6c6d22e73dea46a8ab36b6eebd629, type: 3}
- {fileID: 2800000, guid: a2ec5cbf5a9b64345ad3fab0912ddf7b, type: 3}
- {fileID: 2800000, guid: 1c3c6d69a645b804fa232004b96b7ad3, type: 3}
- {fileID: 2800000, guid: d18a24d7b4ed50f4387993566d9d3ae2, type: 3}
- {fileID: 2800000, guid: c989e1ed85cf7154caa922fec53e6af6, type: 3}
- {fileID: 2800000, guid: ff47e5a0f105eb34883b973e51f4db62, type: 3}
- {fileID: 2800000, guid: fa042edbfc40fbd4bad0ab9d505b1223, type: 3}
- {fileID: 2800000, guid: 896d9004736809c4fb5973b7c12eb8b9, type: 3}
- {fileID: 2800000, guid: 179f794063d2a66478e6e726f84a65bc, type: 3}
filmGrainTex:
- {fileID: 2800000, guid: 654c582f7f8a5a14dbd7d119cbde215d, type: 3}
- {fileID: 2800000, guid: dd77ffd079630404e879388999033049, type: 3}
- {fileID: 2800000, guid: 1097e90e1306e26439701489f391a6c0, type: 3}
- {fileID: 2800000, guid: f0b67500f7fad3b4c9f2b13e8f41ba6e, type: 3}
- {fileID: 2800000, guid: 9930fb4528622b34687b00bbe6883de7, type: 3}
- {fileID: 2800000, guid: bd9e8c758250ef449a4b4bfaad7a2133, type: 3}
- {fileID: 2800000, guid: 510a2f57334933e4a8dbabe4c30204e4, type: 3}
- {fileID: 2800000, guid: b4db8180660810945bf8d55ab44352ad, type: 3}
- {fileID: 2800000, guid: fd2fd78b392986e42a12df2177d3b89c, type: 3}
- {fileID: 2800000, guid: 5cdee82a77d13994f83b8fdabed7c301, type: 3}
smaaAreaTex: {fileID: 2800000, guid: d1f1048909d55cd4fa1126ab998f617e, type: 3}
smaaSearchTex: {fileID: 2800000, guid: 51eee22c2a633ef4aada830eed57c3fd, type: 3}
m_TexturesResourcesVersion: 0
- rid: 2028245633001062405
type: {class: RenderingDebuggerRuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
data:
m_version: 0
- rid: 2028245633001062406
type: {class: VrsRenderPipelineRuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
data:
m_TextureComputeShader: {fileID: 7200000, guid: cacb30de6c40c7444bbc78cb0a81fd2a, type: 3}
m_VisualizationShader: {fileID: 4800000, guid: 620b55b8040a88d468e94abe55bed5ba, type: 3}
m_VisualizationLookupTable:
m_Data:
- {r: 1, g: 0, b: 0, a: 1}
- {r: 1, g: 0.92156863, b: 0.015686275, a: 1}
- {r: 1, g: 1, b: 1, a: 1}
- {r: 0, g: 1, b: 0, a: 1}
- {r: 0.75, g: 0.75, b: 0, a: 1}
- {r: 0, g: 0.75, b: 0.55, a: 1}
- {r: 0.5, g: 0, b: 0.5, a: 1}
- {r: 0.5, g: 0.5, b: 0.5, a: 1}
- {r: 0, g: 0, b: 1, a: 1}
m_ConversionLookupTable:
m_Data:
- {r: 1, g: 0, b: 0, a: 1}
- {r: 1, g: 0.92156863, b: 0.015686275, a: 1}
- {r: 1, g: 1, b: 1, a: 1}
- {r: 0, g: 1, b: 0, a: 1}
- {r: 0.75, g: 0.75, b: 0, a: 1}
- {r: 0, g: 0.75, b: 0.55, a: 1}
- {r: 0.5, g: 0, b: 0.5, a: 1}
- {r: 0.5, g: 0.5, b: 0.5, a: 1}
- {r: 0, g: 0, b: 1, a: 1}
- rid: 2028245633001062407
type: {class: LightmapSamplingSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
data:
m_Version: 1
m_UseBicubicLightmapSampling: 0
- rid: 6852985685364965376
type: {class: URPShaderStrippingSetting, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:
@@ -115,9 +240,6 @@ MonoBehaviour:
m_AutodeskInteractive: {fileID: 4800000, guid: 0e9d5a909a1f7e84882a534d0d11e49f, type: 3}
m_AutodeskInteractiveTransparent: {fileID: 4800000, guid: 5c81372d981403744adbdda4433c9c11, type: 3}
m_AutodeskInteractiveMasked: {fileID: 4800000, guid: 80aa867ac363ac043847b06ad71604cd, type: 3}
m_TerrainDetailLit: {fileID: 4800000, guid: f6783ab646d374f94b199774402a5144, type: 3}
m_TerrainDetailGrassBillboard: {fileID: 4800000, guid: 29868e73b638e48ca99a19ea58c48d90, type: 3}
m_TerrainDetailGrass: {fileID: 4800000, guid: e507fdfead5ca47e8b9a768b51c291a1, type: 3}
m_DefaultSpeedTree7Shader: {fileID: 4800000, guid: 0f4122b9a743b744abe2fb6a0a88868b, type: 3}
m_DefaultSpeedTree8Shader: {fileID: -6465566751694194690, guid: 9920c1f1781549a46ba081a2a15a16ec, type: 3}
m_DefaultSpeedTree9Shader: {fileID: -6465566751694194690, guid: cbd3e1cc4ae141c42a30e33b4d666a61, type: 3}
@@ -128,6 +250,8 @@ MonoBehaviour:
m_CopyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3}
m_CameraMotionVector: {fileID: 4800000, guid: c56b7e0d4c7cb484e959caeeedae9bbf, type: 3}
m_StencilDeferredPS: {fileID: 4800000, guid: e9155b26e1bc55942a41e518703fe304, type: 3}
m_ClusterDeferred: {fileID: 4800000, guid: 222cce62363a44a380c36bf03b392608, type: 3}
m_StencilDitherMaskSeedPS: {fileID: 4800000, guid: 8c3ee818f2efa514c889881ccb2e95a2, type: 3}
m_DBufferClear: {fileID: 4800000, guid: f056d8bd2a1c7e44e9729144b4c70395, type: 3}
- rid: 6852985685364965379
type: {class: UniversalRenderPipelineDebugShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
@@ -144,6 +268,9 @@ MonoBehaviour:
m_CoreBlitPS: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3}
m_CoreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, type: 3}
m_SamplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3}
m_TerrainDetailLit: {fileID: 4800000, guid: f6783ab646d374f94b199774402a5144, type: 3}
m_TerrainDetailGrassBillboard: {fileID: 4800000, guid: 29868e73b638e48ca99a19ea58c48d90, type: 3}
m_TerrainDetailGrass: {fileID: 4800000, guid: e507fdfead5ca47e8b9a768b51c291a1, type: 3}
- rid: 6852985685364965381
type: {class: UniversalRenderPipelineRuntimeTextures, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:
@@ -174,6 +301,7 @@ MonoBehaviour:
m_DefaultLineMaterial: {fileID: 2100000, guid: e823cd5b5d27c0f4b8256e7c12ee3e6d, type: 2}
m_DefaultTerrainMaterial: {fileID: 2100000, guid: 594ea882c5a793440b60ff72d896021e, type: 2}
m_DefaultDecalMaterial: {fileID: 2100000, guid: 31d0dcc6f2dd4e4408d18036a2c93862, type: 2}
m_DefaultSpriteMaterial: {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
- rid: 6852985685364965384
type: {class: URPDefaultVolumeProfileSettings, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 09610894297ae74449b37191945069ff
guid: 8cf4e72d60c563f44b838b832e931b33
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,8 +1,8 @@
fileFormatVersion: 2
guid: 69b5f370da7b862439a366000ea6e230
NativeFormatImporter:
guid: e2c435e76ec72da4d9ee1f6d45f8374b
folderAsset: yes
DefaultImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +1,8 @@
fileFormatVersion: 2
guid: d6a3216c4fd1c1a499b50f354c57f048
NativeFormatImporter:
guid: 15e2cde26c94921429fb7c3b52aa1a2a
folderAsset: yes
DefaultImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,252 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &869075708
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 869075710}
- component: {fileID: 869075709}
m_Layer: 0
m_Name: Example
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &869075709
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 869075708}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f0f4fc589d3160f4197a6ec70bab0925, type: 3}
m_Name:
m_EditorClassIdentifier:
info: Hover over slider to see tooltip
floatTest: {x: 2, y: 8}
intTest: {x: 0, y: 0}
--- !u!4 &869075710
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 869075708}
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: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1410662703
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1410662706}
- component: {fileID: 1410662705}
- component: {fileID: 1410662704}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1410662704
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1410662703}
m_Enabled: 1
--- !u!20 &1410662705
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1410662703}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.58219117, g: 0.8396226, b: 0.82838553, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 1
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1410662706
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1410662703}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 59b93f2adad13734a8942e8d5a1ad672
guid: a821f9bc27797d940b5963e05313b936
DefaultImporter:
externalObjects: {}
userData:

View File

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

View File

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

View File

@@ -0,0 +1,108 @@
using UnityEngine;
using UnityEditor;
using GD.MinMaxSlider;
[CustomPropertyDrawer(typeof(MinMaxSliderAttribute))]
public class MinMaxSliderDrawer : PropertyDrawer {
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label){
var minMaxAttribute = (MinMaxSliderAttribute)attribute;
var propertyType = property.propertyType;
label.tooltip = minMaxAttribute.min.ToString("F2") + " to " + minMaxAttribute.max.ToString("F2");
//PrefixLabel returns the rect of the right part of the control. It leaves out the label section. We don't have to worry about it. Nice!
Rect controlRect = EditorGUI.PrefixLabel(position, label);
Rect[] splittedRect = SplitRect(controlRect,3);
if(propertyType == SerializedPropertyType.Vector2){
EditorGUI.BeginChangeCheck();
Vector2 vector = property.vector2Value;
float minVal = vector.x;
float maxVal = vector.y;
//F2 limits the float to two decimal places (0.00).
minVal = EditorGUI.FloatField(splittedRect[0], float.Parse(minVal.ToString("F2")));
maxVal = EditorGUI.FloatField(splittedRect[2], float.Parse(maxVal.ToString("F2")));
EditorGUI.MinMaxSlider(splittedRect[1], ref minVal, ref maxVal,
minMaxAttribute.min,minMaxAttribute.max);
if(minVal < minMaxAttribute.min){
minVal = minMaxAttribute.min;
}
if(maxVal > minMaxAttribute.max){
maxVal = minMaxAttribute.max;
}
vector = new Vector2(minVal > maxVal ? maxVal : minVal, maxVal);
if(EditorGUI.EndChangeCheck()){
property.vector2Value = vector;
}
}else if(propertyType == SerializedPropertyType.Vector2Int){
EditorGUI.BeginChangeCheck();
Vector2Int vector = property.vector2IntValue;
float minVal = vector.x;
float maxVal = vector.y;
minVal = EditorGUI.FloatField(splittedRect[0], minVal);
maxVal = EditorGUI.FloatField(splittedRect[2], maxVal);
EditorGUI.MinMaxSlider(splittedRect[1], ref minVal, ref maxVal,
minMaxAttribute.min,minMaxAttribute.max);
if(minVal < minMaxAttribute.min){
maxVal = minMaxAttribute.min;
}
if(minVal > minMaxAttribute.max){
maxVal = minMaxAttribute.max;
}
vector = new Vector2Int(Mathf.FloorToInt(minVal > maxVal ? maxVal : minVal), Mathf.FloorToInt(maxVal));
if(EditorGUI.EndChangeCheck()){
property.vector2IntValue = vector;
}
}
}
Rect[] SplitRect(Rect rectToSplit, int n){
Rect[] rects = new Rect[n];
for(int i = 0; i < n; i++){
rects[i] = new Rect(rectToSplit.position.x + (i * rectToSplit.width / n), rectToSplit.position.y, rectToSplit.width / n, rectToSplit.height);
}
int padding = (int)rects[0].width - 40;
int space = 5;
rects[0].width -= padding + space;
rects[2].width -= padding + space;
rects[1].x -= padding;
rects[1].width += padding * 2;
rects[2].x += padding + space;
return rects;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e6b53f69308943e499e344adc5adee79
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,16 @@
namespace GD.MinMaxSlider
{
using UnityEngine;
public class MinMaxSliderAttribute : PropertyAttribute{
public float min;
public float max;
public MinMaxSliderAttribute(float min, float max)
{
this.min = min;
this.max = max;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a090d8b694abe7141af9c000b8cf42ec
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,16 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GD.MinMaxSlider;
public class MinMaxSliderExample : MonoBehaviour
{
public string info = "Hover over a slider to see a tooltip";
[MinMaxSlider(0,10)]
public Vector2 floatRange = new Vector2(2,8);
[MinMaxSlider(0,10)]
public Vector2Int intRange = new Vector2Int(1,5);
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 212a7a761531d4b48ae374e583db2389
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,3 @@
{
"name": "SimpleMinMaxSlider"
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4099e5319e98558428028d54bc62664e
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
{
"name": "com.guciodevs.simple-min-max-slider",
"displayName": "Simple MinMax Slider",
"description": "Handy small package that adds a simple MinMaxSlider attribute.",
"version": "1.1.2",
"unity": "2018.3",
"license": "MIT",
"dependencies": {
},
"samples": [
{
"displayName": "Example Scene",
"description": "",
"path": "Samples~/SimpleMinMaxSlider Example"
}
]
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 783853a57374ff540b56fa85ce900da7
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,20 +0,0 @@
using UnityEngine;
public class SinMovement : MonoBehaviour{
private float originalY;
public float speed;
public float scale;
public float offset;
void Start(){
originalY = transform.position.y;
offset += Random.Range(-1, 1);
}
// Update is called once per frame
void Update(){
transform.position = transform.position.Flatten(null, originalY + Mathf.Sin((Time.time + offset) * speed) * scale, null);
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: e33277577aa379a41a747f01aade9c96

View File

@@ -1,25 +0,0 @@
using UnityEngine;
public class SwayMovement : MonoBehaviour{
Vector3 originalRot;
public Vector3 swayAmount;
public Vector3 swaySpeed;
private Vector3 offset;
void Start(){
originalRot = transform.rotation.eulerAngles;
offset = new Vector3(Random.Range(-5, 1), Random.Range(-1, 5), Random.Range(-3, 1));
}
// Update is called once per frame
void Update(){
Vector3 sway = new Vector3(
originalRot.x + Mathf.Sin((Time.time + offset.x) * swaySpeed.x) * swayAmount.x,
originalRot.y + Mathf.Sin((Time.time + offset.y) * swaySpeed.y) * swayAmount.y,
originalRot.z + Mathf.Sin((Time.time + offset.z) * swaySpeed.z) * swayAmount.z
);
transform.rotation = Quaternion.Euler(sway);
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 57870c7b66535c74688188df7e771ce7

Binary file not shown.

0
Hello.txt Normal file
View File

0
Hi.txt Normal file
View File

View File

@@ -1,21 +1,21 @@
{
"dependencies": {
"com.unity.ai.navigation": "2.0.4",
"com.unity.ai.navigation": "2.0.8",
"com.unity.cinemachine": "3.1.2",
"com.unity.collab-proxy": "2.5.2",
"com.unity.ide.rider": "3.0.34",
"com.unity.ide.visualstudio": "2.0.22",
"com.unity.inputsystem": "1.11.2",
"com.unity.collab-proxy": "2.8.2",
"com.unity.ide.rider": "3.0.36",
"com.unity.ide.visualstudio": "2.0.23",
"com.unity.inputsystem": "1.14.2",
"com.unity.multiplayer.center": "1.0.0",
"com.unity.multiplayer.tools": "2.2.1",
"com.unity.multiplayer.tools": "2.2.5",
"com.unity.netcode.gameobjects": "2.1.1",
"com.unity.probuilder": "6.0.4",
"com.unity.render-pipelines.universal": "17.0.3",
"com.unity.services.multiplayer": "1.0.2",
"com.unity.test-framework": "1.4.5",
"com.unity.timeline": "1.8.7",
"com.unity.probuilder": "6.0.6",
"com.unity.render-pipelines.universal": "17.2.0",
"com.unity.services.multiplayer": "1.1.0",
"com.unity.test-framework": "1.5.1",
"com.unity.timeline": "1.8.9",
"com.unity.ugui": "2.0.0",
"com.unity.visualscripting": "1.9.5",
"com.unity.visualscripting": "1.9.7",
"com.unity.modules.accessibility": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",

View File

@@ -24,7 +24,7 @@
}
},
"com.unity.ai.navigation": {
"version": "2.0.4",
"version": "2.0.8",
"depth": 0,
"source": "registry",
"dependencies": {
@@ -33,7 +33,7 @@
"url": "https://packages.unity.com"
},
"com.unity.burst": {
"version": "1.8.18",
"version": "1.8.24",
"depth": 1,
"source": "registry",
"dependencies": {
@@ -52,20 +52,21 @@
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "2.5.2",
"version": "2.8.2",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.collections": {
"version": "2.5.1",
"version": "2.5.7",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.burst": "1.8.17",
"com.unity.test-framework": "1.4.5",
"com.unity.nuget.mono-cecil": "1.11.4",
"com.unity.burst": "1.8.19",
"com.unity.mathematics": "1.3.2",
"com.unity.test-framework": "1.4.6",
"com.unity.nuget.mono-cecil": "1.11.5",
"com.unity.test-framework.performance": "3.0.3"
},
"url": "https://packages.unity.com"
@@ -73,12 +74,11 @@
"com.unity.ext.nunit": {
"version": "2.0.5",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
"source": "builtin",
"dependencies": {}
},
"com.unity.ide.rider": {
"version": "3.0.34",
"version": "3.0.36",
"depth": 0,
"source": "registry",
"dependencies": {
@@ -87,7 +87,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.22",
"version": "2.0.23",
"depth": 0,
"source": "registry",
"dependencies": {
@@ -96,7 +96,7 @@
"url": "https://packages.unity.com"
},
"com.unity.inputsystem": {
"version": "1.11.2",
"version": "1.14.2",
"depth": 0,
"source": "registry",
"dependencies": {
@@ -120,13 +120,13 @@
}
},
"com.unity.multiplayer.tools": {
"version": "2.2.1",
"version": "2.2.5",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.burst": "1.8.17",
"com.unity.collections": "2.4.0",
"com.unity.mathematics": "1.3.1",
"com.unity.burst": "1.8.18",
"com.unity.collections": "2.5.1",
"com.unity.mathematics": "1.3.2",
"com.unity.profiling.core": "1.0.2",
"com.unity.nuget.mono-cecil": "1.11.4",
"com.unity.modules.uielements": "1.0.0",
@@ -145,7 +145,7 @@
"url": "https://packages.unity.com"
},
"com.unity.nuget.mono-cecil": {
"version": "1.11.4",
"version": "1.11.5",
"depth": 1,
"source": "registry",
"dependencies": {},
@@ -159,11 +159,11 @@
"url": "https://packages.unity.com"
},
"com.unity.probuilder": {
"version": "6.0.4",
"version": "6.0.6",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.shadergraph": "17.0.2",
"com.unity.shadergraph": "17.0.3",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.settings-manager": "1.0.3"
@@ -178,7 +178,7 @@
"url": "https://packages.unity.com"
},
"com.unity.render-pipelines.core": {
"version": "17.0.3",
"version": "17.2.0",
"depth": 1,
"source": "builtin",
"dependencies": {
@@ -193,12 +193,12 @@
}
},
"com.unity.render-pipelines.universal": {
"version": "17.0.3",
"version": "17.2.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.render-pipelines.core": "17.0.3",
"com.unity.shadergraph": "17.0.3",
"com.unity.render-pipelines.core": "17.2.0",
"com.unity.shadergraph": "17.2.0",
"com.unity.render-pipelines.universal-config": "17.0.3"
}
},
@@ -221,26 +221,26 @@
}
},
"com.unity.searcher": {
"version": "4.9.2",
"version": "4.9.3",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.services.authentication": {
"version": "3.3.3",
"version": "3.4.1",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0",
"com.unity.services.core": "1.13.0",
"com.unity.services.core": "1.14.0",
"com.unity.nuget.newtonsoft-json": "3.2.1",
"com.unity.modules.unitywebrequest": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.services.core": {
"version": "1.13.0",
"version": "1.14.0",
"depth": 1,
"source": "registry",
"dependencies": {
@@ -251,24 +251,24 @@
"url": "https://packages.unity.com"
},
"com.unity.services.deployment": {
"version": "1.3.0",
"version": "1.4.1",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.services.core": "1.12.0",
"com.unity.services.deployment.api": "1.0.0"
"com.unity.services.deployment.api": "1.1.2"
},
"url": "https://packages.unity.com"
},
"com.unity.services.deployment.api": {
"version": "1.0.0",
"version": "1.1.2",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.services.multiplayer": {
"version": "1.0.2",
"version": "1.1.0",
"depth": 0,
"source": "registry",
"dependencies": {
@@ -298,7 +298,7 @@
"url": "https://packages.unity.com"
},
"com.unity.services.wire": {
"version": "1.2.7",
"version": "1.4.0",
"depth": 1,
"source": "registry",
"dependencies": {
@@ -309,55 +309,54 @@
"url": "https://packages.unity.com"
},
"com.unity.settings-manager": {
"version": "2.0.1",
"version": "2.1.0",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.shadergraph": {
"version": "17.0.3",
"version": "17.2.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.render-pipelines.core": "17.0.3",
"com.unity.searcher": "4.9.2"
"com.unity.render-pipelines.core": "17.2.0",
"com.unity.searcher": "4.9.3"
}
},
"com.unity.splines": {
"version": "2.6.1",
"version": "2.8.1",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0",
"com.unity.mathematics": "1.2.1",
"com.unity.modules.imgui": "1.0.0",
"com.unity.settings-manager": "1.0.3"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.4.5",
"version": "1.5.1",
"depth": 0,
"source": "registry",
"source": "builtin",
"dependencies": {
"com.unity.ext.nunit": "2.0.3",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
}
},
"com.unity.test-framework.performance": {
"version": "3.0.3",
"version": "3.1.0",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.1.31",
"com.unity.test-framework": "1.1.33",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.8.7",
"version": "1.8.9",
"depth": 0,
"source": "registry",
"dependencies": {
@@ -369,7 +368,7 @@
"url": "https://packages.unity.com"
},
"com.unity.transport": {
"version": "2.4.0",
"version": "2.5.3",
"depth": 1,
"source": "registry",
"dependencies": {
@@ -389,7 +388,7 @@
}
},
"com.unity.visualscripting": {
"version": "1.9.5",
"version": "1.9.7",
"depth": 0,
"source": "registry",
"dependencies": {
@@ -546,7 +545,8 @@
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.hierarchycore": "1.0.0"
"com.unity.modules.hierarchycore": "1.0.0",
"com.unity.modules.physics": "1.0.0"
}
},
"com.unity.modules.umbra": {

View File

@@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 53
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6762c37d3236e2a4382cd018dcdf221e, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Multiplayer.Tools.Common::Unity.Multiplayer.Tools.Common.Visualization.CustomColorSettings
colors:
m_Keys:
m_Values: []

View File

@@ -16,15 +16,20 @@
"key": "log.path",
"value": "{\"m_Value\":\"ProBuilderLog.txt\"}"
},
{
"type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "editor.materialPalettePath",
"value": "{\"m_Value\":\"Assets/ProBuilder Data/Default Material Palette.asset\"}"
},
{
"type": "UnityEngine.ProBuilder.SemVer, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "about.identifier",
"value": "{\"m_Value\":{\"m_Major\":6,\"m_Minor\":0,\"m_Patch\":4,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"\"}}"
"value": "{\"m_Value\":{\"m_Major\":6,\"m_Minor\":0,\"m_Patch\":6,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"\"}}"
},
{
"type": "UnityEngine.ProBuilder.SemVer, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "preferences.version",
"value": "{\"m_Value\":{\"m_Major\":6,\"m_Minor\":0,\"m_Patch\":4,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"\"}}"
"value": "{\"m_Value\":{\"m_Major\":6,\"m_Minor\":0,\"m_Patch\":6,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"\"}}"
},
{
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
@@ -54,7 +59,7 @@
{
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "ShapeComponent.SettingsEnabled",
"value": "{\"m_Value\":true}"
"value": "{\"m_Value\":false}"
},
{
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
@@ -91,16 +96,6 @@
"key": "CollapseVertices.collapseToFirst",
"value": "{\"m_Value\":false}"
},
{
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "SubdivideEdges.rangeExpanded",
"value": "{\"m_Value\":false}"
},
{
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "SelectEdgeLoop.selectIterative",
"value": "{\"m_Value\":false}"
},
{
"type": "UnityEngine.Rendering.ShadowCastingMode, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "mesh.shadowCastingMode",
@@ -129,62 +124,17 @@
{
"type": "System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "ShapeBuilder.ActiveShapeIndex",
"value": "{\"m_Value\":1}"
},
{
"type": "System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "SubdivideEdges.subdivisions",
"value": "{\"m_Value\":1}"
},
{
"type": "System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "SubdivideEdges.subdivisionsUIMin",
"value": "{\"m_Value\":1}"
},
{
"type": "System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "SubdivideEdges.subdivisionsUIMax",
"value": "{\"m_Value\":32}"
"value": "{\"m_Value\":6}"
},
{
"type": "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.LastSize.Cube",
"value": "{\"m_Value\":{\"x\":2.0,\"y\":14.0,\"z\":-9.0}}"
"value": "{\"m_Value\":{\"x\":20.036033630371095,\"y\":1.0208016633987427,\"z\":-17.9393310546875}}"
},
{
"type": "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.LastSize.Stairs",
"value": "{\"m_Value\":{\"x\":-3.000000476837158,\"y\":14.000001907348633,\"z\":19.0}}"
},
{
"type": "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.LastSize.Door",
"value": "{\"m_Value\":{\"x\":22.0,\"y\":13.0,\"z\":-16.0}}"
},
{
"type": "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.LastSize.Plane",
"value": "{\"m_Value\":{\"x\":16.0,\"y\":0.0,\"z\":-7.0}}"
},
{
"type": "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.LastSize.Cylinder",
"value": "{\"m_Value\":{\"x\":16.0,\"y\":53.0,\"z\":-16.0}}"
},
{
"type": "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.LastSize.Arch",
"value": "{\"m_Value\":{\"x\":18.0,\"y\":13.0,\"z\":-8.0}}"
},
{
"type": "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.LastSize.Sphere",
"value": "{\"m_Value\":{\"x\":16.0,\"y\":16.0,\"z\":-16.0}}"
},
{
"type": "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.LastSize.Cone",
"value": "{\"m_Value\":{\"x\":9.0,\"y\":4.0,\"z\":-11.0}}"
"value": "{\"m_Value\":{\"x\":-7.032182693481445,\"y\":2.840894937515259,\"z\":-7.309409141540527}}"
},
{
"type": "UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
@@ -196,76 +146,16 @@
"key": "ShapeBuilder.LastRotation.Stairs",
"value": "{\"m_Value\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0}}"
},
{
"type": "UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.LastRotation.Door",
"value": "{\"m_Value\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0}}"
},
{
"type": "UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.LastRotation.Plane",
"value": "{\"m_Value\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0}}"
},
{
"type": "UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.LastRotation.Cylinder",
"value": "{\"m_Value\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0}}"
},
{
"type": "UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.LastRotation.Arch",
"value": "{\"m_Value\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0}}"
},
{
"type": "UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.LastRotation.Sphere",
"value": "{\"m_Value\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0}}"
},
{
"type": "UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.LastRotation.Cone",
"value": "{\"m_Value\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0}}"
},
{
"type": "UnityEngine.ProBuilder.PivotLocation, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.PivotLocation.Cube",
"value": "{\"m_Value\":1}"
"value": "{\"m_Value\":0}"
},
{
"type": "UnityEngine.ProBuilder.PivotLocation, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.PivotLocation.Stairs",
"value": "{\"m_Value\":0}"
},
{
"type": "UnityEngine.ProBuilder.PivotLocation, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.PivotLocation.Door",
"value": "{\"m_Value\":0}"
},
{
"type": "UnityEngine.ProBuilder.PivotLocation, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.PivotLocation.Plane",
"value": "{\"m_Value\":0}"
},
{
"type": "UnityEngine.ProBuilder.PivotLocation, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.PivotLocation.Cylinder",
"value": "{\"m_Value\":0}"
},
{
"type": "UnityEngine.ProBuilder.PivotLocation, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.PivotLocation.Arch",
"value": "{\"m_Value\":0}"
},
{
"type": "UnityEngine.ProBuilder.PivotLocation, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.PivotLocation.Sphere",
"value": "{\"m_Value\":0}"
},
{
"type": "UnityEngine.ProBuilder.PivotLocation, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.PivotLocation.Cone",
"value": "{\"m_Value\":0}"
},
{
"type": "UnityEngine.ProBuilder.Shapes.Shape, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.Cube",
@@ -276,40 +166,10 @@
"key": "ShapeBuilder.Stairs",
"value": "{}"
},
{
"type": "UnityEngine.ProBuilder.Shapes.Shape, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.Door",
"value": "{}"
},
{
"type": "UnityEngine.ProBuilder.Shapes.Shape, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.Cylinder",
"value": "{}"
},
{
"type": "UnityEngine.ProBuilder.Shapes.Shape, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.Arch",
"value": "{}"
},
{
"type": "UnityEngine.ProBuilder.Shapes.Shape, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.Sphere",
"value": "{}"
},
{
"type": "UnityEngine.ProBuilder.Shapes.Shape, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.Cone",
"value": "{}"
},
{
"type": "UnityEngine.ProBuilder.Shapes.Shape, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.Plane",
"value": "{}"
},
{
"type": "UnityEngine.ProBuilder.SelectMode, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "s_SelectMode",
"value": "{\"m_Value\":4}"
"value": "{\"m_Value\":1}"
},
{
"type": "UnityEngine.ProBuilder.RectSelectMode, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
@@ -325,16 +185,6 @@
"type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "uv.uvEditorGridSnapIncrement",
"value": "{\"m_Value\":0.125}"
},
{
"type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "ExtrudeFaces.distance",
"value": "{\"m_Value\":0.5}"
},
{
"type": "UnityEngine.ProBuilder.ExtrudeMethod, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "editor.extrudeMethod",
"value": "{\"m_Value\":2}"
}
]
}

View File

@@ -16,12 +16,12 @@ PlayerSettings:
productName: Project Reset
defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 0.8, g: 0.8, b: 0.8, a: 1}
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
m_ShowUnitySplashScreen: 1
m_ShowUnitySplashLogo: 1
m_SplashScreenOverlayOpacity: 1
m_SplashScreenAnimation: 1
m_SplashScreenLogoStyle: 0
m_SplashScreenLogoStyle: 1
m_SplashScreenDrawMode: 0
m_SplashScreenBackgroundAnimationZoom: 1
m_SplashScreenLogoAnimationZoom: 1
@@ -132,6 +132,7 @@ PlayerSettings:
switchNVNMaxPublicSamplerIDCount: 0
switchMaxWorkerMultiple: 8
switchNVNGraphicsFirmwareMemory: 32
switchGraphicsJobsSyncAfterKick: 1
vulkanNumSwapchainBuffers: 3
vulkanEnableSetSRGBWrite: 0
vulkanEnablePreTransform: 1
@@ -140,7 +141,7 @@ PlayerSettings:
loadStoreDebugModeEnabled: 0
visionOSBundleVersion: 1.0
tvOSBundleVersion: 1.0
bundleVersion: 0.2.0
bundleVersion: 0.1.0
preloadedAssets:
- {fileID: 11400000, guid: 8e19eb4aa4fac2a409e792d0d3e5f944, type: 2}
metroInputSource: 0
@@ -274,6 +275,9 @@ PlayerSettings:
AndroidBuildApkPerCpuArchitecture: 0
AndroidTVCompatibility: 0
AndroidIsGame: 1
androidAppCategory: 3
useAndroidAppCategory: 1
androidAppCategoryOther:
AndroidEnableTango: 0
androidEnableBanner: 1
androidUseLowAccuracyLocation: 0
@@ -528,6 +532,9 @@ PlayerSettings:
- m_BuildTarget: AndroidPlayer
m_APIs: 150000000b000000
m_Automatic: 0
- m_BuildTarget: WindowsStandaloneSupport
m_APIs: 0200000012000000
m_Automatic: 0
m_BuildTargetVRSettings: []
m_DefaultShaderChunkSizeInMB: 16
m_DefaultShaderChunkCount: 0
@@ -543,6 +550,7 @@ PlayerSettings:
- serializedVersion: 2
m_BuildTarget: Android
m_EncodingQuality: 1
m_BuildTargetGroupHDRCubemapEncodingQuality: []
m_BuildTargetGroupLightmapSettings: []
m_BuildTargetGroupLoadStoreDebugModeSettings: []
m_BuildTargetNormalMapEncoding:
@@ -811,12 +819,12 @@ PlayerSettings:
webGLMemoryLinearGrowthStep: 16
webGLMemoryGeometricGrowthStep: 0.2
webGLMemoryGeometricGrowthCap: 96
webGLEnableWebGPU: 0
webGLPowerPreference: 2
webGLWebAssemblyTable: 0
webGLWebAssemblyBigInt: 0
webGLCloseOnQuit: 0
webWasm2023: 0
webEnableSubmoduleStrippingCompatibility: 0
scriptingDefineSymbols:
Standalone: ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;ODIN_INSPECTOR_3_2;ODIN_INSPECTOR_3_3;NODECANVAS
additionalCompilerArguments: {}
@@ -945,3 +953,4 @@ PlayerSettings:
insecureHttpOption: 0
androidVulkanDenyFilterList: []
androidVulkanAllowFilterList: []
androidVulkanDeviceFilterListAsset: {fileID: 0}

View File

@@ -1,2 +1,2 @@
m_EditorVersion: 6000.0.28f1
m_EditorVersionWithRevision: 6000.0.28f1 (f336aca0cab5)
m_EditorVersion: 6000.2.1f1
m_EditorVersionWithRevision: 6000.2.1f1 (55300504c302)

View File

@@ -12,4 +12,4 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 247994e1f5a72c2419c26a37e9334c01, type: 3}
m_Name:
m_EditorClassIdentifier:
m_LastMaterialVersion: 9
m_LastMaterialVersion: 10