added: item pickups with online persistency

This commit is contained in:
Chris
2025-09-08 16:40:13 -04:00
parent 8bdf0b31cc
commit 7a0499f36a
39 changed files with 8228 additions and 208 deletions

View File

@@ -1,5 +1,5 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False"> <ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
<ui:VisualElement name="StretchBG" style="width: 100%; height: auto;"> <ui:VisualElement name="StretchBG" picking-mode="Ignore" style="width: 100%; height: auto;">
<ui:VisualElement name="Pages" style="flex-direction: row; padding-top: 20px; padding-right: 20px; padding-bottom: 20px; padding-left: 20px;" /> <ui:VisualElement name="Pages" style="flex-direction: row; padding-top: 20px; padding-right: 20px; padding-bottom: 20px; padding-left: 20px;" />
</ui:VisualElement> </ui:VisualElement>
</ui:UXML> </ui:UXML>

View File

@@ -19,3 +19,8 @@ MonoBehaviour:
SourcePrefabToOverride: {fileID: 0} SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0 SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0} OverridingTargetPrefab: {fileID: 0}
- Override: 0
Prefab: {fileID: 2439326541263862202, guid: d1a8be7fcb61fae4a8f61c1d003cc7a4, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}

8
Assets/Items.meta Normal file
View File

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

View File

@@ -0,0 +1,279 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2439326541263862202
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8885804641608089777}
- component: {fileID: 3560722552214624850}
- component: {fileID: 7808312699809871789}
- component: {fileID: 5552338841031885870}
- component: {fileID: 2174189668123041488}
- component: {fileID: 9177263202698905070}
- component: {fileID: -6903864654045134960}
m_Layer: 6
m_Name: ItemDropPrefab
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8885804641608089777
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2439326541263862202}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4540993316393141120}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3560722552214624850
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2439326541263862202}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkObject
GlobalObjectIdHash: 4118760095
InScenePlacedSourceGlobalObjectIdHash: 0
DeferredDespawnTick: 0
Ownership: 1
AlwaysReplicateAsRoot: 0
SynchronizeTransform: 1
ActiveSceneSynchronization: 0
SceneMigrationSynchronization: 1
SpawnWithObservers: 1
DontDestroyWithOwner: 0
AutoObjectParentSync: 1
SyncOwnerTransformWhenParented: 1
AllowOwnerToParent: 0
--- !u!114 &7808312699809871789
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2439326541263862202}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 47fcfe0cd0436de41a99c2ed60f488a8, type: 3}
m_Name:
m_EditorClassIdentifier: Core::Reset.Items.ItemDrop
ShowTopMostFoldoutHeaderGroup: 1
item: {fileID: 11400000, guid: 5985c652269d3a64598d9e8dfc2c16d2, type: 2}
--- !u!54 &5552338841031885870
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2439326541263862202}
serializedVersion: 5
m_Mass: 1
m_LinearDamping: 0
m_AngularDamping: 0.05
m_CenterOfMass: {x: 0, y: 0, z: 0}
m_InertiaTensor: {x: 1, y: 1, z: 1}
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &2174189668123041488
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2439326541263862202}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e96cb6065543e43c4a752faaa1468eb1, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.Components.NetworkTransform
ShowTopMostFoldoutHeaderGroup: 1
NetworkTransformExpanded: 0
AutoOwnerAuthorityTickOffset: 1
PositionInterpolationType: 0
RotationInterpolationType: 0
ScaleInterpolationType: 0
PositionLerpSmoothing: 1
PositionMaxInterpolationTime: 0.1
RotationLerpSmoothing: 1
RotationMaxInterpolationTime: 0.1
ScaleLerpSmoothing: 1
ScaleMaxInterpolationTime: 0.1
AuthorityMode: 0
TickSyncChildren: 0
UseUnreliableDeltas: 0
SyncPositionX: 1
SyncPositionY: 1
SyncPositionZ: 1
SyncRotAngleX: 1
SyncRotAngleY: 1
SyncRotAngleZ: 1
SyncScaleX: 1
SyncScaleY: 1
SyncScaleZ: 1
PositionThreshold: 0.001
RotAngleThreshold: 0.01
ScaleThreshold: 0.01
UseQuaternionSynchronization: 0
UseQuaternionCompression: 0
UseHalfFloatPrecision: 0
InLocalSpace: 0
SwitchTransformSpaceWhenParented: 0
Interpolate: 1
SlerpPosition: 0
--- !u!114 &9177263202698905070
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2439326541263862202}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f6c0be61502bb534f922ebb746851216, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.Components.NetworkRigidbody
ShowTopMostFoldoutHeaderGroup: 1
NetworkRigidbodyBaseExpanded: 0
UseRigidBodyForMotion: 0
AutoUpdateKinematicState: 1
AutoSetKinematicOnDespawn: 0
--- !u!135 &-6903864654045134960
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2439326541263862202}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &9131744606799350632
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4540993316393141120}
- component: {fileID: 204051759818302151}
- component: {fileID: 762383611321438283}
m_Layer: 6
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4540993316393141120
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9131744606799350632}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8885804641608089777}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &204051759818302151
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9131744606799350632}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &762383611321438283
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9131744606799350632}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d1a8be7fcb61fae4a8f61c1d003cc7a4
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

18
Assets/Items/Test.asset Normal file
View File

@@ -0,0 +1,18 @@
%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: b7f2c6caae048f64f91b54ae1442694c, type: 3}
m_Name: Test
m_EditorClassIdentifier: Core::Reset.Items.Weapon
permanency: 0
essenceRequiredForPermanency: 0
weaponModel: {fileID: 0}
weaponFSM: {fileID: 0}

View File

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

View File

@@ -33,7 +33,7 @@ MonoBehaviour:
Scale","value":{}},"settingsChangeSmoothing":{"label":"Settings Change Smoothing","value":{}},"rotateFacing":{"label":"Facing Scale","value":{}},"settingsChangeSmoothing":{"label":"Settings Change Smoothing","value":{}},"rotateFacing":{"label":"Facing
Direction","newValue":{"$content":0,"$type":"PlayerFacingDirection"},"changeValue":2},"rotationSpeed":{"label":"Rotation Direction","newValue":{"$content":0,"$type":"PlayerFacingDirection"},"changeValue":2},"rotationSpeed":{"label":"Rotation
Speed","value":{}},"rotationSmoothing":{"label":"Rotation Smoothing","value":{}},"rotationInputBlending":{"label":"Rotation Speed","value":{}},"rotationSmoothing":{"label":"Rotation Smoothing","value":{}},"rotationInputBlending":{"label":"Rotation
Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"}]},"foldEnter":true,"foldUpdate":true,"_color":{"r":1.0,"g":1.0,"b":1.0,"a":1.0},"_name":"Grounded","_position":{"x":479.6257,"y":388.1921},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"0"},{"_position":{"x":369.3697,"y":186.864},"$type":"NodeCanvas.StateMachines.EmptyState","$id":"1"},{"_actionList":{"actions":[{"moveSpeed":{"label":"Move Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"}]},"foldEnter":true,"foldUpdate":true,"_color":{"r":1.0,"g":1.0,"b":1.0,"a":1.0},"_name":"Grounded","_position":{"x":468.8087,"y":389.2739},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"0"},{"_position":{"x":369.3697,"y":186.864},"$type":"NodeCanvas.StateMachines.EmptyState","$id":"1"},{"_actionList":{"actions":[{"moveSpeed":{"label":"Move
Speed","value":{}},"moveSpeedSoothing":{"label":"Move Speed Smoothing","value":{}},"airDirectionDecay":{"label":"Air Speed","value":{}},"moveSpeedSoothing":{"label":"Move Speed Smoothing","value":{}},"airDirectionDecay":{"label":"Air
Direction Decay","value":{}},"accelerationSmoothing":{"label":"Acceleration Smoothing","value":{"_value":1.0},"changeValue":1},"deaccelerationSmoothing":{"label":"Deacceleration Direction Decay","value":{}},"accelerationSmoothing":{"label":"Acceleration Smoothing","value":{"_value":1.0},"changeValue":1},"deaccelerationSmoothing":{"label":"Deacceleration
Smoothing","value":{"_value":1.0},"changeValue":1},"jumpPower":{"label":"Jump Smoothing","value":{"_value":1.0},"changeValue":1},"jumpPower":{"label":"Jump
@@ -188,8 +188,8 @@ MonoBehaviour:
Direction","newValue":{"$content":4,"$type":"PlayerFacingDirection"},"changeValue":1},"rotationSpeed":{"label":"Rotation Direction","newValue":{"$content":4,"$type":"PlayerFacingDirection"},"changeValue":1},"rotationSpeed":{"label":"Rotation
Speed","value":{}},"rotationSmoothing":{"label":"Rotation Smoothing","value":{}},"rotationInputBlending":{"label":"Rotation Speed","value":{}},"rotationSmoothing":{"label":"Rotation Smoothing","value":{}},"rotationInputBlending":{"label":"Rotation
Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"},{"fieldOfView":{"label":"FOV","value":{}},"orbitFollowTop":{"label":"Top","changeRadius":1,"radius":7.0},"orbitFollowCenter":{"label":"Center","changeRadius":1,"radius":8.0},"orbitFollowBottom":{"label":"Bottom","changeRadius":1,"radius":5.0},"axisLookXGain":{"label":"Look Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"},{"fieldOfView":{"label":"FOV","value":{}},"orbitFollowTop":{"label":"Top","changeRadius":1,"radius":7.0},"orbitFollowCenter":{"label":"Center","changeRadius":1,"radius":8.0},"orbitFollowBottom":{"label":"Bottom","changeRadius":1,"radius":5.0},"axisLookXGain":{"label":"Look
Orbit X Gain","value":{}},"axisLookYGain":{"label":"Look Orbit Y Gain","value":{}},"$type":"NodeCanvas.Tasks.Actions.ChangeCameraSettings"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[{"valueA":{"_name":"airJumpsRemaining","_targetVariableID":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d"},"Operation":2,"valueB":{"_value":1},"$type":"NodeCanvas.Tasks.Actions.SetInt"}]},"foldEnter":true,"foldUpdate":true,"foldExit":true,"_color":{"r":0.4117647,"g":0.945098,"b":0.254902,"a":1.0},"_name":"Standard Orbit X Gain","value":{}},"axisLookYGain":{"label":"Look Orbit Y Gain","value":{}},"$type":"NodeCanvas.Tasks.Actions.ChangeCameraSettings"},{"log":{"_value":"Jumped"},"secondsToRun":0.0,"$type":"NodeCanvas.Tasks.Actions.DebugLogText"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[{"valueA":{"_name":"airJumpsRemaining","_targetVariableID":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d"},"Operation":2,"valueB":{"_value":1},"$type":"NodeCanvas.Tasks.Actions.SetInt"}]},"foldEnter":true,"foldUpdate":true,"foldExit":true,"_color":{"r":0.4117647,"g":0.945098,"b":0.254902,"a":1.0},"_name":"Standard
Jump","_position":{"x":725.1636,"y":243.3368},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"21"},{"_actionList":{"actions":[{"valueA":{"_name":"newAirMoveSmoothing","_targetVariableID":"9ba7a222-e29f-4ef5-8f1e-144189e5e5d3"},"valueB":{"_value":1.0},"_isDisabled":true,"$type":"NodeCanvas.Tasks.Actions.SetFloat"},{"eventName":{"_value":"Air Jump","_position":{"x":758.6965,"y":226.1113},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"21"},{"_actionList":{"actions":[{"valueA":{"_name":"newAirMoveSmoothing","_targetVariableID":"9ba7a222-e29f-4ef5-8f1e-144189e5e5d3"},"valueB":{"_value":1.0},"_isDisabled":true,"$type":"NodeCanvas.Tasks.Actions.SetFloat"},{"eventName":{"_value":"Air
Reset Received"},"delay":{},"$type":"NodeCanvas.Tasks.Actions.SendEvent"},{"moveSpeed":{"label":"Move Reset Received"},"delay":{},"$type":"NodeCanvas.Tasks.Actions.SendEvent"},{"moveSpeed":{"label":"Move
Speed","value":{},"changeValue":2},"moveSpeedSoothing":{"label":"Move Speed Smoothing","value":{}},"airDirectionDecay":{"label":"Air Speed","value":{},"changeValue":2},"moveSpeedSoothing":{"label":"Move Speed Smoothing","value":{}},"airDirectionDecay":{"label":"Air
Direction Decay","value":{},"changeValue":2},"accelerationSmoothing":{"label":"Acceleration Direction Decay","value":{},"changeValue":2},"accelerationSmoothing":{"label":"Acceleration
@@ -201,7 +201,7 @@ MonoBehaviour:
Change Smoothing","value":{},"changeValue":2},"rotationSpeed":{"label":"Rotation Change Smoothing","value":{},"changeValue":2},"rotationSpeed":{"label":"Rotation
Speed","value":{},"changeValue":2},"rotationSmoothing":{"label":"Rotation Smoothing","value":{},"changeValue":2},"rotationInputBlending":{"label":"Rotation Speed","value":{},"changeValue":2},"rotationSmoothing":{"label":"Rotation Smoothing","value":{},"changeValue":2},"rotationInputBlending":{"label":"Rotation
Input Blending","value":{},"changeValue":2},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"}]},"_color":{"r":0.3647059,"g":0.3215686,"b":1.0,"a":1.0},"_name":"Airborne Input Blending","value":{},"changeValue":2},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"}]},"_color":{"r":0.3647059,"g":0.3215686,"b":1.0,"a":1.0},"_name":"Airborne
Standard Movement","_position":{"x":289.209,"y":32.46029},"$type":"NodeCanvas.StateMachines.ActionState","$id":"22"},{"_actionList":{"executionMode":1,"actions":[{"moveSpeed":{"label":"Move Standard Movement","_position":{"x":286.209,"y":32.4603},"$type":"NodeCanvas.StateMachines.ActionState","$id":"22"},{"_actionList":{"executionMode":1,"actions":[{"moveSpeed":{"label":"Move
Speed","value":{},"changeValue":1},"moveSpeedSoothing":{"label":"Move Speed Smoothing","value":{}},"airDirectionDecay":{"label":"Air Speed","value":{},"changeValue":1},"moveSpeedSoothing":{"label":"Move Speed Smoothing","value":{}},"airDirectionDecay":{"label":"Air
Direction Decay","value":{}},"accelerationSmoothing":{"label":"Acceleration Smoothing","value":{}},"deaccelerationSmoothing":{"label":"Deacceleration Direction Decay","value":{}},"accelerationSmoothing":{"label":"Acceleration Smoothing","value":{}},"deaccelerationSmoothing":{"label":"Deacceleration
Smoothing","value":{}},"feedNewDirection":{"label":"Feed New Direction","newValue":{"z":1.0}},"jumpPower":{"label":"Jump Smoothing","value":{}},"feedNewDirection":{"label":"Feed New Direction","newValue":{"z":1.0}},"jumpPower":{"label":"Jump
@@ -213,7 +213,7 @@ MonoBehaviour:
Speed","value":{}},"rotationSmoothing":{"label":"Rotation Smoothing","value":{}},"rotationInputBlending":{"label":"Rotation Speed","value":{}},"rotationSmoothing":{"label":"Rotation Smoothing","value":{}},"rotationInputBlending":{"label":"Rotation
Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"},{"fieldOfView":{"label":"FOV","value":{},"changeValue":1},"axisLookXGain":{"label":"Look Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"},{"fieldOfView":{"label":"FOV","value":{},"changeValue":1},"axisLookXGain":{"label":"Look
Orbit X Gain","value":{}},"axisLookYGain":{"label":"Look Orbit Y Gain","value":{}},"$type":"NodeCanvas.Tasks.Actions.ChangeCameraSettings"}]},"_color":{"r":1.0,"g":1.0,"b":1.0,"a":1.0},"_name":"Sprint Orbit X Gain","value":{}},"axisLookYGain":{"label":"Look Orbit Y Gain","value":{}},"$type":"NodeCanvas.Tasks.Actions.ChangeCameraSettings"}]},"_color":{"r":1.0,"g":1.0,"b":1.0,"a":1.0},"_name":"Sprint
Burst","_position":{"x":633.7453,"y":532.2648},"$type":"NodeCanvas.StateMachines.ActionState","$id":"23"},{"_onEnterList":{"executionMode":1,"actions":[{"valueA":{"_name":"airJumpsRemaining","_targetVariableID":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d"},"valueB":{"_value":4},"$type":"NodeCanvas.Tasks.Actions.SetVariable`1[[System.Int32, Burst","_position":{"x":633.7453,"y":530.2648},"$type":"NodeCanvas.StateMachines.ActionState","$id":"23"},{"_onEnterList":{"executionMode":1,"actions":[{"valueA":{"_name":"airJumpsRemaining","_targetVariableID":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d"},"valueB":{"_value":4},"$type":"NodeCanvas.Tasks.Actions.SetVariable`1[[System.Int32,
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},{"moveSpeed":{"label":"Move mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},{"moveSpeed":{"label":"Move
Speed","value":{}},"moveSpeedSoothing":{"label":"Move Speed Smoothing","value":{},"changeValue":1},"airDirectionDecay":{"label":"Air Speed","value":{}},"moveSpeedSoothing":{"label":"Move Speed Smoothing","value":{},"changeValue":1},"airDirectionDecay":{"label":"Air
Direction Decay","value":{}},"accelerationSmoothing":{"label":"Acceleration Smoothing","value":{}},"deaccelerationSmoothing":{"label":"Deacceleration Direction Decay","value":{}},"accelerationSmoothing":{"label":"Acceleration Smoothing","value":{}},"deaccelerationSmoothing":{"label":"Deacceleration
@@ -247,7 +247,7 @@ MonoBehaviour:
Speed","value":{}},"rotationSmoothing":{"label":"Rotation Smoothing","value":{}},"rotationInputBlending":{"label":"Rotation Speed","value":{}},"rotationSmoothing":{"label":"Rotation Smoothing","value":{}},"rotationInputBlending":{"label":"Rotation
Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[{"valueA":{"_name":"airJumpsRemaining","_targetVariableID":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d"},"Operation":2,"valueB":{"_value":1},"$type":"NodeCanvas.Tasks.Actions.SetInt"}]},"foldEnter":true,"foldExit":true,"_color":{"r":0.4117647,"g":0.945098,"b":0.254902,"a":1.0},"_name":"Run Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"}]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[{"valueA":{"_name":"airJumpsRemaining","_targetVariableID":"23f0ddc0-c4e8-462f-a7e0-fdd8e818d08d"},"Operation":2,"valueB":{"_value":1},"$type":"NodeCanvas.Tasks.Actions.SetInt"}]},"foldEnter":true,"foldExit":true,"_color":{"r":0.4117647,"g":0.945098,"b":0.254902,"a":1.0},"_name":"Run
Jump","_position":{"x":1013.465,"y":94.1021},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"25"},{"_subTree":{"_value":1},"_variablesMap":[{"_targetSubGraphVariableID":"e1cfd0be-7f55-420d-bdd8-e72531fc61ba","_canWrite":true,"_type":"UnityEngine.Transform","_name":"mainCamera","_targetVariableID":"2bc9b3d6-dcbe-45de-8f8c-911adedd6ab0"},{"_targetSubGraphVariableID":"c4e68b75-5129-428c-8177-abb7b38986f5","_canWrite":true,"_type":"PlayerFacingDirection","_value":{"$content":0,"$type":"PlayerFacingDirection"}}],"_position":{"x":-510.8982,"y":192.1267},"$type":"NodeCanvas.StateMachines.ConcurrentSubTree"},{"_subTree":{"_value":2},"_tag":"","_position":{"x":88.88627,"y":313.6888},"_comment":"","$type":"NodeCanvas.StateMachines.ConcurrentSubTree"},{"_conditionList":{"conditions":[]},"_actionList":{"executionMode":1,"actions":[{"targetVector":{"_name":"outputMoveDirection","_targetVariableID":"3b9833f5-870a-4182-9824-e31a9896eec2"},"x":{"_name":""},"y":{"_name":"_currentYMoveDirection"},"z":{"_name":""},"$type":"NodeCanvas.Tasks.Actions.DecomposeVector"}]},"_position":{"x":40.44446,"y":196.4959},"$type":"NodeCanvas.StateMachines.OnFSMUpdate"},{"_onEnterList":{"executionMode":1,"actions":[]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"_color":{"r":0.4980392,"g":1.0,"b":0.9803922,"a":1.0},"_name":"Airborne Jump","_position":{"x":1013.465,"y":94.1021},"$type":"NodeCanvas.StateMachines.SuperActionState","$id":"25"},{"_subTree":{"_value":1},"_variablesMap":[{"_targetSubGraphVariableID":"e1cfd0be-7f55-420d-bdd8-e72531fc61ba","_canWrite":true,"_type":"UnityEngine.Transform","_name":"mainCamera","_targetVariableID":"2bc9b3d6-dcbe-45de-8f8c-911adedd6ab0"},{"_targetSubGraphVariableID":"c4e68b75-5129-428c-8177-abb7b38986f5","_canWrite":true,"_type":"PlayerFacingDirection","_value":{"$content":0,"$type":"PlayerFacingDirection"}}],"_position":{"x":-510.8982,"y":192.1267},"$type":"NodeCanvas.StateMachines.ConcurrentSubTree"},{"_subTree":{"_value":2},"_tag":"","_position":{"x":88.88627,"y":313.6888},"_comment":"","$type":"NodeCanvas.StateMachines.ConcurrentSubTree"},{"_conditionList":{"conditions":[]},"_actionList":{"executionMode":1,"actions":[{"targetVector":{"_name":"outputMoveDirection","_targetVariableID":"3b9833f5-870a-4182-9824-e31a9896eec2"},"x":{"_name":""},"y":{"_name":"_currentYMoveDirection"},"z":{"_name":""},"$type":"NodeCanvas.Tasks.Actions.DecomposeVector"}]},"_position":{"x":40.44446,"y":196.4959},"$type":"NodeCanvas.StateMachines.OnFSMUpdate"},{"_onEnterList":{"executionMode":1,"actions":[]},"_onUpdateList":{"executionMode":1,"actions":[]},"_onExitList":{"executionMode":1,"actions":[]},"_color":{"r":0.4980392,"g":1.0,"b":0.9803922,"a":1.0},"_name":"Airborne
Standby","_position":{"x":1509.989,"y":-548.8954},"$type":"NodeCanvas.StateMachines.SuperActionState"},{"_subTree":{"_value":3},"_position":{"x":1125.669,"y":-308.5995},"$type":"NodeCanvas.StateMachines.ConcurrentSubTree"}],"connections":[{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"619300a4-be8b-4ad4-ba2a-978468094ba2"},"valueB":{},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"actionName":{"_value":"Jump"},"actionPhase":{"_value":3},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"21"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"eventName":{"_value":"Grapple Standby","_position":{"x":1509.989,"y":-548.8954},"$type":"NodeCanvas.StateMachines.SuperActionState"},{"_subTree":{"_value":3},"_position":{"x":1125.669,"y":-308.5995},"$type":"NodeCanvas.StateMachines.ConcurrentSubTree"},{"_subFSM":{"_value":4},"_position":{"x":175.7607,"y":577.6639},"$type":"NodeCanvas.StateMachines.ConcurrentSubFSM"}],"connections":[{"_condition":{"valueA":{"_name":"isGrounded","_targetVariableID":"619300a4-be8b-4ad4-ba2a-978468094ba2"},"valueB":{},"$type":"NodeCanvas.Tasks.Conditions.CheckBoolean"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"conditions":[{"actionName":{"_value":"Jump"},"actionPhase":{"_value":3},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},{"actionName":{"_value":"Jump"},"actionPhase":{"_value":4},"_invert":true,"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},{"observerLabel":{"_value":"itemdrop"},"outputHitTo":{},"deactivateOnFinish":false,"_invert":true,"$type":"NodeCanvas.Tasks.Conditions.CheckEnvironmentObserver"}],"$type":"NodeCanvas.Framework.ConditionList"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"21"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"eventName":{"_value":"Grapple
Launch"},"saveEventValue":{"_name":"_grappleLaunchDir"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent`1[[UnityEngine.Vector3, Launch"},"saveEventValue":{"_name":"_grappleLaunchDir"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent`1[[UnityEngine.Vector3,
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"7"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"eventName":{"_value":"Grapple UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"7"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"eventName":{"_value":"Grapple
Pull"},"saveEventValue":{"_name":"_grappleLaunchDir"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent`1[[UnityEngine.Vector3, Pull"},"saveEventValue":{"_name":"_grappleLaunchDir"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent`1[[UnityEngine.Vector3,
@@ -277,11 +277,12 @@ MonoBehaviour:
- {fileID: 11400000, guid: beebc26815c062d4c80362506bb8ad84, type: 2} - {fileID: 11400000, guid: beebc26815c062d4c80362506bb8ad84, type: 2}
- {fileID: 11400000, guid: 40971083372a2534babfd95df6867650, type: 2} - {fileID: 11400000, guid: 40971083372a2534babfd95df6867650, type: 2}
- {fileID: 11400000, guid: a15c6b1054c8b5b40ae430307e706008, type: 2} - {fileID: 11400000, guid: a15c6b1054c8b5b40ae430307e706008, type: 2}
- {fileID: 11400000, guid: ec44b1e70d02d1642a18b6971abb0910, type: 2}
_graphSource: _graphSource:
_version: 3.31 _version: 3.31
_category: _category:
_comments: _comments:
_translation: {x: 160, y: 590} _translation: {x: 739, y: 476}
_zoomFactor: 0.7184368 _zoomFactor: 1
_haltSerialization: 0 _haltSerialization: 0
_externalSerializationFile: {fileID: 0} _externalSerializationFile: {fileID: 0}

View File

@@ -0,0 +1,27 @@
%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: f945e777233a59f4aba40aeca29093a6, type: 3}
m_Name: PlayerInteractionFSM
m_EditorClassIdentifier: NodeCanvas::NodeCanvas.StateMachines.FSM
_serializedGraph: '{"type":"NodeCanvas.StateMachines.FSM","nodes":[{"_position":{"x":404.0,"y":380.0},"$type":"NodeCanvas.StateMachines.EmptyState","$id":"0"},{"_actionList":{"executionMode":1,"actions":[]},"_color":{"r":1.0,"g":0.42,"b":0.32,"a":1.0},"_position":{"x":681.0,"y":540.0},"$type":"NodeCanvas.StateMachines.ActionState","$id":"1"},{"_position":{"x":626.0,"y":134.0},"$type":"NodeCanvas.StateMachines.AnyState","$id":"2"},{"_name":"Lock
Interact","_position":{"x":564.0,"y":266.0},"$type":"NodeCanvas.StateMachines.EmptyState","$id":"3"}],"connections":[{"_condition":{"conditions":[{"actionName":{"_value":"Interact"},"actionPhase":{"_value":2},"$type":"NodeCanvas.Tasks.Conditions.CheckInput"},{"observerLabel":{"_value":"itemdrop"},"outputHitTo":{"_name":"_interacted"},"deactivateOnFinish":false,"$type":"NodeCanvas.Tasks.Conditions.CheckEnvironmentObserver"}],"$type":"NodeCanvas.Framework.ConditionList"},"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"0"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"eventName":{"_value":"Interact
Disabled"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent"},"_sourceNode":{"$ref":"2"},"_targetNode":{"$ref":"3"},"$type":"NodeCanvas.StateMachines.FSMConnection"},{"_condition":{"eventName":{"_value":"Interact
Enabled"},"$type":"NodeCanvas.Tasks.Conditions.CheckEvent"},"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"0"},"$type":"NodeCanvas.StateMachines.FSMConnection"}],"canvasGroups":[],"localBlackboard":{"_variables":{}}}'
_objectReferences: []
_graphSource:
_version: 3.31
_category:
_comments:
_translation: {x: 76, y: 96}
_zoomFactor: 1
_haltSerialization: 0
_externalSerializationFile: {fileID: 0}

View File

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

View File

@@ -1,4 +1,5 @@
{ {
"version": 1,
"name": "PlayerInputs", "name": "PlayerInputs",
"maps": [ "maps": [
{ {
@@ -103,6 +104,15 @@
"processors": "", "processors": "",
"interactions": "", "interactions": "",
"initialStateCheck": false "initialStateCheck": false
},
{
"name": "Interact",
"type": "Button",
"id": "100e5802-d4a5-4877-a39d-35c098d97d5b",
"expectedControlType": "",
"processors": "",
"interactions": "",
"initialStateCheck": false
} }
], ],
"bindings": [ "bindings": [
@@ -347,6 +357,17 @@
"action": "Debug Lock Page", "action": "Debug Lock Page",
"isComposite": false, "isComposite": false,
"isPartOfComposite": true "isPartOfComposite": true
},
{
"name": "",
"id": "28cfeddc-5f13-4a70-9340-7c76e10e3e3b",
"path": "<Gamepad>/buttonSouth",
"interactions": "",
"processors": "",
"groups": ";Controller",
"action": "Interact",
"isComposite": false,
"isPartOfComposite": false
} }
] ]
} }

View File

@@ -131,6 +131,8 @@ GameObject:
- component: {fileID: 2842793574603981349} - component: {fileID: 2842793574603981349}
- component: {fileID: 43868462096200776} - component: {fileID: 43868462096200776}
- component: {fileID: 6067609290387865387} - component: {fileID: 6067609290387865387}
- component: {fileID: 323016802234025917}
- component: {fileID: -6606553239814530074}
m_Layer: 0 m_Layer: 0
m_Name: Player m_Name: Player
m_TagString: Untagged m_TagString: Untagged
@@ -262,7 +264,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 2d0c4f0666ff5f245bf2a135c782127b, type: 3} m_Script: {fileID: 11500000, guid: 2d0c4f0666ff5f245bf2a135c782127b, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
inputSignal: {fileID: 11400000, guid: 69b5f370da7b862439a366000ea6e230, type: 2}
rawMoveInput: {x: 0, y: 0} rawMoveInput: {x: 0, y: 0}
rawLookInput: {x: 0, y: 0} rawLookInput: {x: 0, y: 0}
graph: {fileID: 0} graph: {fileID: 0}
@@ -429,6 +430,31 @@ MonoBehaviour:
hitRotationOffset: {x: 0, y: 0, z: 0} hitRotationOffset: {x: 0, y: 0, z: 0}
gizmoDrawingCondition: 2 gizmoDrawingCondition: 2
children: [] children: []
- label: itemdrop
castType: 3
active: 1
length: 2.25
direction: {x: 0, y: 0, z: 1}
offset: {x: 0, y: 0.8, z: 0}
ignoreLayers:
serializedVersion: 2
m_Bits: 64
width: 0
size: {x: 2.1, y: 2.9, z: 0.4}
rotation: {x: 9, y: 0, z: 0}
overlapHits: []
drawLabel: 0
labelTextLocation: 0
labelSize: 0
labelLocationOffset: {x: 0, y: 0, z: 0}
labelRotationOffset: {x: 0, y: 0, z: 0}
drawHitName: 0
hitTextLocation: 0
hitTextSize: 0
hitLocationOffset: {x: 0, y: 0, z: 0}
hitRotationOffset: {x: 0, y: 0, z: 0}
gizmoDrawingCondition: 0
children: []
references: references:
version: 2 version: 2
RefIds: [] RefIds: []
@@ -628,6 +654,37 @@ MonoBehaviour:
SwitchTransformSpaceWhenParented: 0 SwitchTransformSpaceWhenParented: 0
Interpolate: 1 Interpolate: 1
SlerpPosition: 0 SlerpPosition: 0
--- !u!114 &323016802234025917
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2757828562731694833}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 96023d711211b9843b01db23192fa84c, type: 3}
m_Name:
m_EditorClassIdentifier: Core::Reset.Units.InteractionHandler
--- !u!114 &-6606553239814530074
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2757828562731694833}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d57ab8ec1cbbdcf46813f268625d3494, type: 3}
m_Name:
m_EditorClassIdentifier: Core::Reset.Units.Inventory
rangedWeapon: {fileID: 0}
meleeWeapon: {fileID: 0}
spellAbility1: {fileID: 0}
spellAbility2: {fileID: 0}
toolAbility1: {fileID: 0}
toolAbility2: {fileID: 0}
storedItems: []
--- !u!1 &9138484595871696647 --- !u!1 &9138484595871696647
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@@ -0,0 +1,18 @@
%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: BlockInputSignal
m_EditorClassIdentifier:
_parameters:
- _ID: e1c42702-42ed-4f84-b52d-4e72b42a7de5
_name: action
_type: UnityEngine.InputSystem.InputAction

View File

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

7253
Assets/Scenes/ItemTest.unity Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 520e0dc411c2684479fba0c4f32b733c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -510,7 +510,7 @@ MeshCollider:
serializedVersion: 5 serializedVersion: 5
m_Convex: 0 m_Convex: 0
m_CookingOptions: 30 m_CookingOptions: 30
m_Mesh: {fileID: 1967531061} m_Mesh: {fileID: 1291984846}
--- !u!33 &65649608 --- !u!33 &65649608
MeshFilter: MeshFilter:
m_ObjectHideFlags: 10 m_ObjectHideFlags: 10
@@ -518,7 +518,7 @@ MeshFilter:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 65649606} m_GameObject: {fileID: 65649606}
m_Mesh: {fileID: 1967531061} m_Mesh: {fileID: 1291984846}
--- !u!23 &65649609 --- !u!23 &65649609
MeshRenderer: MeshRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -763,7 +763,7 @@ MonoBehaviour:
m_AreaError: 15 m_AreaError: 15
m_PreserveMeshAssetOnDestroy: 0 m_PreserveMeshAssetOnDestroy: 0
assetGuid: assetGuid:
m_Mesh: {fileID: 1967531061} m_Mesh: {fileID: 1291984846}
m_VersionIndex: 564 m_VersionIndex: 564
m_IsSelectable: 1 m_IsSelectable: 1
m_SelectedFaces: m_SelectedFaces:
@@ -3843,6 +3843,184 @@ Mesh:
- serializedVersion: 1 - serializedVersion: 1
m_IndexStart: 0 m_IndexStart: 0
m_IndexCount: 0 m_IndexCount: 0
--- !u!43 &1291984846
Mesh:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh-38274(Clone)(Clone)
serializedVersion: 12
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 24
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 9
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 100, y: 0, z: 100}
m_Shapes:
vertices: []
shapes: []
channels: []
fullWeights: []
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_BonesAABB: []
m_VariableBoneCountWeights:
m_Data:
m_MeshCompression: 0
m_IsReadable: 1
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexFormat: 0
m_IndexBuffer: 000001000200010003000200010004000300040005000300020003000600030007000600030005000700050008000700
m_VertexData:
serializedVersion: 3
m_VertexCount: 9
m_Channels:
- stream: 0
offset: 0
format: 0
dimension: 3
- stream: 0
offset: 12
format: 0
dimension: 3
- stream: 0
offset: 24
format: 0
dimension: 4
- stream: 0
offset: 40
format: 0
dimension: 4
- stream: 0
offset: 56
format: 0
dimension: 2
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
m_DataSize: 576
_typelessdata: 0000c8c2000000000000c8c2000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f0000c8c20000c8c20000c8c20000000000000000000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f0000c8c20000000000000000000000000000c8c2000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f000000000000c8c2000000000000000000000000000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f00000000000000000000c8c2000000000000c842000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f0000c8c20000c84200000000000000000000c842000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f000000000000c8420000c842000000000000c8c2000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f0000c8420000c8c20000c8420000000000000000000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f0000c842000000000000c842000000000000c842000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f0000c8420000c842
m_CompressedMesh:
m_Vertices:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_UV:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Normals:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Tangents:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Weights:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_NormalSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_TangentSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_FloatColors:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_BoneIndices:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_Triangles:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_UVInfo: 0
m_LocalAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 100, y: 0, z: 100}
m_MeshUsageFlags: 0
m_CookingOptions: 30
m_BakedConvexCollisionMesh:
m_BakedTriangleCollisionMesh:
'm_MeshMetrics[0]': 1
'm_MeshMetrics[1]': 1
m_MeshOptimizationFlags: 1
m_StreamData:
serializedVersion: 2
offset: 0
size: 0
path:
m_MeshLodInfo:
serializedVersion: 2
m_LodSelectionCurve:
serializedVersion: 1
m_LodSlope: 0
m_LodBias: 0
m_NumLevels: 1
m_SubMeshes:
- serializedVersion: 2
m_Levels:
- serializedVersion: 1
m_IndexStart: 0
m_IndexCount: 0
--- !u!1 &1293873422 --- !u!1 &1293873422
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -6518,184 +6696,6 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Padding: {x: -8, y: -5, z: -8, w: -5} m_Padding: {x: -8, y: -5, z: -8, w: -5}
m_Softness: {x: 0, y: 0} m_Softness: {x: 0, y: 0}
--- !u!43 &1967531061
Mesh:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh-38274
serializedVersion: 12
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 24
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 9
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 100, y: 0, z: 100}
m_Shapes:
vertices: []
shapes: []
channels: []
fullWeights: []
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_BonesAABB: []
m_VariableBoneCountWeights:
m_Data:
m_MeshCompression: 0
m_IsReadable: 1
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexFormat: 0
m_IndexBuffer: 000001000200010003000200010004000300040005000300020003000600030007000600030005000700050008000700
m_VertexData:
serializedVersion: 3
m_VertexCount: 9
m_Channels:
- stream: 0
offset: 0
format: 0
dimension: 3
- stream: 0
offset: 12
format: 0
dimension: 3
- stream: 0
offset: 24
format: 0
dimension: 4
- stream: 0
offset: 40
format: 0
dimension: 4
- stream: 0
offset: 56
format: 0
dimension: 2
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
m_DataSize: 576
_typelessdata: 0000c8c2000000000000c8c2000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f0000c8c20000c8c20000c8c20000000000000000000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f0000c8c20000000000000000000000000000c8c2000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f000000000000c8c2000000000000000000000000000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f00000000000000000000c8c2000000000000c842000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f0000c8c20000c84200000000000000000000c842000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f000000000000c8420000c842000000000000c8c2000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f0000c8420000c8c20000c8420000000000000000000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f0000c842000000000000c842000000000000c842000000000000803f000000000000803f0000000000000000000080bf750ace3e750ace3e750ace3e0000803f0000c8420000c842
m_CompressedMesh:
m_Vertices:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_UV:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Normals:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Tangents:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Weights:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_NormalSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_TangentSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_FloatColors:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_BoneIndices:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_Triangles:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_UVInfo: 0
m_LocalAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 100, y: 0, z: 100}
m_MeshUsageFlags: 0
m_CookingOptions: 30
m_BakedConvexCollisionMesh:
m_BakedTriangleCollisionMesh:
'm_MeshMetrics[0]': 1
'm_MeshMetrics[1]': 1
m_MeshOptimizationFlags: 1
m_StreamData:
serializedVersion: 2
offset: 0
size: 0
path:
m_MeshLodInfo:
serializedVersion: 2
m_LodSelectionCurve:
serializedVersion: 1
m_LodSlope: 0
m_LodBias: 0
m_NumLevels: 1
m_SubMeshes:
- serializedVersion: 2
m_Levels:
- serializedVersion: 1
m_IndexStart: 0
m_IndexCount: 0
--- !u!43 &2089547447 --- !u!43 &2089547447
Mesh: Mesh:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@@ -9,6 +9,8 @@ namespace NodeCanvas.Tasks.Conditions {
public BBParameter<string> observerLabel; public BBParameter<string> observerLabel;
public BBParameter<RaycastHit> outputHitTo; public BBParameter<RaycastHit> outputHitTo;
public bool deactivateOnFinish = true;
protected override string info{ protected override string info{
get { get {
return $"Check Environment Observer, [\"{observerLabel.value}\"]"; return $"Check Environment Observer, [\"{observerLabel.value}\"]";
@@ -33,8 +35,10 @@ namespace NodeCanvas.Tasks.Conditions {
//Called whenever the condition gets disabled. //Called whenever the condition gets disabled.
protected override void OnDisable() { protected override void OnDisable() {
if (deactivateOnFinish){
agent.FindObserverFromString(observerLabel.value).active = false; agent.FindObserverFromString(observerLabel.value).active = false;
} }
}
//Called once per frame while the condition is active. //Called once per frame while the condition is active.
//Return whether the condition is success or failure. //Return whether the condition is success or failure.

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using NodeCanvas.Framework; using NodeCanvas.Framework;
using ParadoxNotion; using ParadoxNotion;
using ParadoxNotion.Design; using ParadoxNotion.Design;
using ParadoxNotion.Services;
using UnityEngine; using UnityEngine;
using UnityEngine.InputSystem; using UnityEngine.InputSystem;
@@ -13,14 +14,30 @@ namespace NodeCanvas.Tasks.Conditions {
public BBParameter<string> actionName; public BBParameter<string> actionName;
public BBParameter<InputActionPhase> actionPhase; public BBParameter<InputActionPhase> actionPhase;
private SignalDefinition signalDefinition; private bool blocked;
// Add buffered input here
private SignalDefinition inputSignalDefinition;
private SignalDefinition blockInputDefinition;
protected override string info { protected override string info {
get { return $"Input <b>{actionName.value}</b> was <b>{actionPhase.value}</b>"; } get { return $"Input <b>{actionName.value}</b> was <b>{actionPhase.value}</b>"; }
} }
protected override string OnInit(){ protected override string OnInit(){
MonoManager.current.onLateUpdate += UnblockOnFrameEnd;
try { try {
signalDefinition = Resources.Load<SignalDefinition>("InputSignal"); inputSignalDefinition = Resources.Load<SignalDefinition>("InputSignal");
} catch (Exception e) {
Debug.LogError($"Error finding the Input Signal defintion: {e.Message}");
throw;
}
try {
blockInputDefinition = Resources.Load<SignalDefinition>("BlockInputSignal");
} catch (Exception e) { } catch (Exception e) {
Debug.LogError($"Error finding the Input Signal defintion: {e.Message}"); Debug.LogError($"Error finding the Input Signal defintion: {e.Message}");
throw; throw;
@@ -30,25 +47,52 @@ namespace NodeCanvas.Tasks.Conditions {
} }
protected override void OnEnable() { protected override void OnEnable() {
signalDefinition.onInvoke -= OnSignalInvoke; inputSignalDefinition.onInvoke -= InputSignalInvoke;
signalDefinition.onInvoke += OnSignalInvoke; inputSignalDefinition.onInvoke += InputSignalInvoke;
blockInputDefinition.onInvoke -= BlockInputDefinition;
blockInputDefinition.onInvoke += BlockInputDefinition;
} }
protected override void OnDisable() { protected override void OnDisable() {
signalDefinition.onInvoke -= OnSignalInvoke; inputSignalDefinition.onInvoke -= InputSignalInvoke;
blockInputDefinition.onInvoke -= BlockInputDefinition;
} }
void OnSignalInvoke(Transform sender, Transform receiver, bool isGlobal, params object[] args){ void InputSignalInvoke(Transform sender, Transform receiver, bool isGlobal, params object[] args){
// Take the input arguments as objects and convert them to InputAction & Phases // Take the input arguments as objects and convert them to InputAction & Phases
InputAction thisAction = (InputAction)args[0]; InputAction thisAction = (InputAction)args[0];
InputActionPhase thisActionPhase = (InputActionPhase)args[1]; InputActionPhase thisActionPhase = (InputActionPhase)args[1];
if (actionName.value == thisAction.name && actionPhase.value == thisActionPhase) { // Debug.Log(thisActionPhase);
if (actionName.value == thisAction.name && actionPhase.value == thisActionPhase && !blocked) {
Debug.Log($"Recieved an unblocked {thisAction} @ {Time.time}.");
YieldReturn(true); YieldReturn(true);
} }
} }
void BlockInputDefinition(Transform sender, Transform receiver, bool isGlobal, params object[] args){
// Take the input arguments as objects and convert them to InputAction & Phases
string thisAction = (string)args[0];
if (actionName.value == thisAction) {
Debug.Log($"Blocking {thisAction} @ {Time.time}.");
blocked = true;
}
}
void UnblockOnFrameEnd(){
if (blocked) {
blocked = false;
Debug.Log($"Unblocking {actionName} @ {Time.time}.");
}
}
protected override bool OnCheck() { return false; } protected override bool OnCheck() { return false; }
} }
} }

View File

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

View File

@@ -0,0 +1,6 @@
using UnityEngine;
public interface IInteractable{
public void Interact();
public void CancelInteract();
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 002886b8496bd41498825928776fb5a1

View File

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

View File

@@ -0,0 +1,7 @@
using UnityEngine;
namespace Reset.Items{
public class Ability : Item, IEquipable{
public NodeCanvas.Framework.Graph behaviourGraph;
}
}

View File

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

View File

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

View File

@@ -0,0 +1,6 @@
using UnityEngine;
public interface IEquipable
{
}

View File

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

View File

@@ -0,0 +1,24 @@
using System.Collections.Generic;
using Unity.Netcode;
using UnityEngine;
namespace Reset.Items{
public abstract class Item : ScriptableObject{
public string itemName{ get; set; }
public float permanency;
public float essenceRequiredForPermanency;
private Event onDropDelegates;
public void DropItem(){
}
public virtual ItemDrop CreateItemDropFrom(){
ItemDrop newItemDrop = new GameObject().AddComponent<ItemDrop>();
newItemDrop.item = this;
return newItemDrop;
}
}
}

View File

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

View File

@@ -0,0 +1,38 @@
using System;
using Unity.Netcode;
using UnityEngine;
namespace Reset.Items{
public class ItemDrop : NetworkBehaviour, IInteractable{
public Item item;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start(){
}
// Update is called once per frame
void Update(){
}
public void Interact(){
if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsConnectedClient) {
Debug.Log("RPC Sent");
DestroyOnOwnerRpc();
} else {
Debug.Log("Destroyed");
Destroy(gameObject);
}
}
public void CancelInteract(){
throw new NotImplementedException();
}
[Rpc(SendTo.Owner)]
public void DestroyOnOwnerRpc(){
Destroy(gameObject);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 47fcfe0cd0436de41a99c2ed60f488a8

View File

@@ -0,0 +1,15 @@
using System;
using NodeCanvas.StateMachines;
using UnityEngine;
namespace Reset.Items{
[CreateAssetMenu(menuName = "Reset/Weapon", fileName = "New Weapon")]
public class Weapon : Item, IEquipable{
public GameObject weaponModel;
public NodeCanvas.Framework.Graph weaponFSM;
void Awake(){
}
}
}

View File

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

View File

@@ -0,0 +1,49 @@
using Reset.Items;
using UnityEngine;
using UnityEngine.InputSystem;
namespace Reset.Units{
public class InteractionHandler : MonoBehaviour{
private PlayerEnvironmentManager envManager;
private Inventory inventory;
private EnvironmentObserver observer;
void Awake(){
envManager = GetComponent<PlayerEnvironmentManager>();
inventory = GetComponent<Inventory>();
observer = envManager.FindObserverFromString("itemdrop");
observer.active = true;
}
public void InteractWith(GameObject target){
IInteractable interactable = target.GetComponent<IInteractable>();
if (interactable == null) {
Debug.LogError("This item cannot be interacted with, it has no Interactable interface");
return;
}
if (target.GetComponent<ItemDrop>()) {
inventory.AddToInventory(target.GetComponent<ItemDrop>().item);
}
interactable.Interact();
// Don't do any actions that use the same button (hard set to Jump for now)
Debug.Log($"Just collected the item, consuming the input @ {Time.time}.");
GetComponent<PlayerControls>().SendInputBlock("Jump");
}
void OnInteract(){
CheckForInteraction();
}
private void CheckForInteraction(){
if (observer.active && observer.Evaluate(gameObject)) {
InteractWith(observer.hit.transform.gameObject);
}
}
}
}

View File

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

View File

@@ -0,0 +1,31 @@
using System.Collections.Generic;
using Reset.Items;
using UnityEngine;
namespace Reset.Units{
public class Inventory : MonoBehaviour{
public Weapon rangedWeapon;
public Weapon meleeWeapon;
public Ability spellAbility1;
public Ability spellAbility2;
public Ability toolAbility1;
public Ability toolAbility2;
public List<Item> storedItems = new List<Item>(15);
void Start(){
}
public void AddToInventory(Item newItem){
storedItems.Add(newItem);
}
// Update is called once per frame
void Update(){
}
}
}

View File

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

View File

@@ -10,13 +10,15 @@ using ParadoxNotion;
using Reset; using Reset;
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
using Unity.Cinemachine; using Unity.Cinemachine;
using Object = UnityEngine.Object;
public class PlayerControls : MonoBehaviour{ public class PlayerControls : MonoBehaviour{
// References // References
private Player thisPlayer; private Player thisPlayer;
private PlayerInput input; private PlayerInput input;
public SignalDefinition inputSignal; private SignalDefinition inputSignal;
private SignalDefinition blockSignal;
// TODO: Turn these into accessors // TODO: Turn these into accessors
public Vector2 rawMoveInput; public Vector2 rawMoveInput;
@@ -25,6 +27,21 @@ public class PlayerControls : MonoBehaviour{
public GraphOwner graph; public GraphOwner graph;
void Awake(){ void Awake(){
try {
inputSignal = Resources.Load<SignalDefinition>("InputSignal");
} catch (Exception e) {
Debug.LogError($"Error finding the Input Signal defintion: {e.Message}");
throw;
}
try {
blockSignal = Resources.Load<SignalDefinition>("BlockInputSignal");
} catch (Exception e) {
Debug.LogError($"Error finding the Input Signal defintion: {e.Message}");
throw;
}
thisPlayer = GetComponent<Player>(); thisPlayer = GetComponent<Player>();
graph = GetComponent<GraphOwner>(); graph = GetComponent<GraphOwner>();
input = GetComponent<PlayerInput>(); input = GetComponent<PlayerInput>();
@@ -34,29 +51,34 @@ public class PlayerControls : MonoBehaviour{
// Add the delegates for each method // Add the delegates for each method
foreach (InputAction action in input.actions) { foreach (InputAction action in input.actions) {
action.started += SendToGraph; action.started += SendInputSignal;
action.canceled += SendToGraph; action.canceled += SendInputSignal;
action.performed += SendToGraph; action.performed += SendInputSignal;
} }
} }
// Remove the delegates for each method // Remove the delegates for each method
void OnDisable(){ void OnDisable(){
foreach (InputAction action in input.actions) { foreach (InputAction action in input.actions) {
action.started -= SendToGraph; action.started -= SendInputSignal;
action.canceled -= SendToGraph; action.canceled -= SendInputSignal;
action.performed -= SendToGraph; action.performed -= SendInputSignal;
} }
} }
// This will call the OnSignalInvoke for this type of Signal Defintion. CheckInput is the recieving end. // This will call the SignalInvoke for this type of Signal Defintion. CheckInput is the recieving end.
public void SendToGraph(InputAction.CallbackContext ctx){ public void SendInputSignal(InputAction.CallbackContext ctx){
inputSignal.Invoke(transform, transform, false, new object[]{ inputSignal.Invoke(transform, transform, false, new object[]{
ctx.action, ctx.action,
ctx.phase ctx.phase
}); });
} }
public void SendInputBlock(string actionName){
Debug.Log($"Sending block request...");
blockSignal.Invoke(transform, transform, false, new object[]{actionName});
}
public void OnMove(InputValue value){ public void OnMove(InputValue value){
rawMoveInput.x = value.Get<Vector2>().x; rawMoveInput.x = value.Get<Vector2>().x;
rawMoveInput.y = value.Get<Vector2>().y; rawMoveInput.y = value.Get<Vector2>().y;