9 Commits

Author SHA1 Message Date
Chris
eb1622d4ed added: revive ui bar 2025-10-22 11:24:58 -04:00
Chris
bd97b3eeb5 added: player dies if not picked up in time 2025-10-20 21:23:07 -04:00
Chris
0bb10a8f46 added: full logic and ability for downing and picking up allies 2025-10-20 16:36:23 -04:00
Chris
021e664320 Merge branch 'refs/heads/dev' into feature/player.initial-combat 2025-10-20 13:57:04 -04:00
Chris
7628541758 added: get direction in local space from units 2025-10-20 13:47:49 -04:00
Chris
6d57b7bb56 added: new maru model and downed animation 2025-10-20 13:47:16 -04:00
Chris
aa3c51f06e added: checking if IInteractable is interactable added 2025-10-20 13:46:12 -04:00
Chris
77fcd2059a added: new tasks for interactions with units 2025-10-20 13:45:36 -04:00
Chris
efd665f7d2 maint: updated burst 1.8.24 > 1.8.25 2025-10-19 15:10:57 -04:00
29 changed files with 1283 additions and 53 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,139 @@
fileFormatVersion: 2
guid: 4dc587b0f2924c34990ef2f162499eba
ModelImporter:
serializedVersion: 24200
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations:
- serializedVersion: 16
name: Downed
takeName: Downed
internalID: -5093893791167760947
firstFrame: -1
lastFrame: 120
wrapMode: 0
orientationOffsetY: 0
level: 0
cycleOffset: 0
loop: 0
hasAdditiveReferencePose: 0
loopTime: 1
loopBlend: 0
loopBlendOrientation: 0
loopBlendPositionY: 0
loopBlendPositionXZ: 0
keepOriginalOrientation: 0
keepOriginalPositionY: 1
keepOriginalPositionXZ: 0
heightFromFeet: 0
mirror: 0
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
curves: []
events: []
transformMask: []
maskType: 3
maskSource: {instanceID: 0}
additiveReferencePoseFrame: 0
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importPhysicalCameras: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
generateMeshLods: 0
meshLodGenerationFlags: 0
maximumMeshLod: -1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
strictVertexDataChecks: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
importBlendShapeDeformPercent: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -497,6 +497,31 @@ BlendTree:
m_UseAutomaticThresholds: 0
m_NormalizedBlendValues: 0
m_BlendType: 0
--- !u!1101 &-1649584047298262204
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: PickUp
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -3079066222818897921}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.87603307
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &-1540905845034213700
AnimatorStateTransition:
m_ObjectHideFlags: 1
@@ -611,7 +636,13 @@ AnimatorController:
m_Name: MaruTestController
serializedVersion: 5
m_AnimatorParameters:
- m_Name: MoveX
- m_Name: Move Direction X
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: Move Direction Y
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
@@ -623,12 +654,6 @@ AnimatorController:
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: MoveY
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: GoHardMelee
m_Type: 9
m_DefaultFloat: 0
@@ -641,6 +666,18 @@ AnimatorController:
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: Downed
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: PickUp
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
@@ -752,12 +789,16 @@ AnimatorStateMachine:
- serializedVersion: 1
m_State: {fileID: -4291637482382203046}
m_Position: {x: 910, y: 230, z: 0}
- serializedVersion: 1
m_State: {fileID: 6032011949097874162}
m_Position: {x: 30, y: 250, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_AnyStateTransitions:
- {fileID: 3576987541970407646}
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 10, y: 20, z: 0}
m_AnyStatePosition: {x: -190, y: 260, z: 0}
m_EntryPosition: {x: 10, y: 150, z: 0}
m_ExitPosition: {x: 1310, y: 280, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
@@ -814,6 +855,31 @@ AnimatorState:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &3576987541970407646
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: Downed
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 6032011949097874162}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &4546395547719917436
AnimatorStateTransition:
m_ObjectHideFlags: 1
@@ -934,13 +1000,40 @@ BlendTree:
m_CycleOffset: 0
m_DirectBlendParameter: Blend
m_Mirror: 0
m_BlendParameter: MoveX
m_BlendParameterY: MoveY
m_BlendParameter: Move Direction X
m_BlendParameterY: Move Direction Y
m_MinThreshold: 0
m_MaxThreshold: 3
m_UseAutomaticThresholds: 0
m_NormalizedBlendValues: 0
m_BlendType: 1
--- !u!1102 &6032011949097874162
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Downed
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: -1649584047298262204}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: -5093893791167760947, guid: 4dc587b0f2924c34990ef2f162499eba, type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &8988256169245471875
AnimatorStateTransition:
m_ObjectHideFlags: 1

Binary file not shown.

View File

@@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: f48a3ffa82d4f324d82694fcbc66bb9a
ModelImporter:
serializedVersion: 24200
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importPhysicalCameras: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
generateMeshLods: 0
meshLodGenerationFlags: 0
maximumMeshLod: -1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
strictVertexDataChecks: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
importBlendShapeDeformPercent: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -137,6 +137,7 @@ GameObject:
- component: {fileID: 5070944620793365545}
- component: {fileID: 4227131494895359615}
- component: {fileID: 4020293503545581060}
- component: {fileID: 2832127593411522816}
m_Layer: 7
m_Name: Player
m_TagString: Untagged
@@ -159,6 +160,7 @@ Transform:
m_Children:
- {fileID: 2655796284435897345}
- {fileID: 4019564870895517434}
- {fileID: 4382182686028875865}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2538182172493791937
@@ -173,7 +175,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkObject
GlobalObjectIdHash: 3816484910
GlobalObjectIdHash: 1109077195
InScenePlacedSourceGlobalObjectIdHash: 0
DeferredDespawnTick: 0
Ownership: 1
@@ -199,7 +201,80 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
ShowTopMostFoldoutHeaderGroup: 1
state:
testSTate:
m_InternalValue:
utf8LengthInBytes: 0
bytes:
offset0000:
byte0000: 0
byte0001: 0
byte0002: 0
byte0003: 0
byte0004: 0
byte0005: 0
byte0006: 0
byte0007: 0
byte0008: 0
byte0009: 0
byte0010: 0
byte0011: 0
byte0012: 0
byte0013: 0
byte0014: 0
byte0015: 0
offset0016:
byte0000: 0
byte0001: 0
byte0002: 0
byte0003: 0
byte0004: 0
byte0005: 0
byte0006: 0
byte0007: 0
byte0008: 0
byte0009: 0
byte0010: 0
byte0011: 0
byte0012: 0
byte0013: 0
byte0014: 0
byte0015: 0
offset0032:
byte0000: 0
byte0001: 0
byte0002: 0
byte0003: 0
byte0004: 0
byte0005: 0
byte0006: 0
byte0007: 0
byte0008: 0
byte0009: 0
byte0010: 0
byte0011: 0
byte0012: 0
byte0013: 0
byte0014: 0
byte0015: 0
byte0048: 0
byte0049: 0
byte0050: 0
byte0051: 0
byte0052: 0
byte0053: 0
byte0054: 0
byte0055: 0
byte0056: 0
byte0057: 0
byte0058: 0
byte0059: 0
byte0060: 0
byte0061: 0
controls: {fileID: 0}
_isDowned:
m_InternalValue: 1
pickupTarget: {fileID: 0}
--- !u!114 &8163344541298437235
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -212,6 +287,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b3b4e13d59527d1429a62dde97c6a001, type: 3}
m_Name:
m_EditorClassIdentifier:
ShowTopMostFoldoutHeaderGroup: 1
data:
directionChangingSoftness:
targetValue: 20
@@ -548,6 +624,33 @@ MonoBehaviour:
hitRotationOffset: {x: 0, y: 0, z: 0}
gizmoDrawingCondition: 0
children: []
- label: player
castType: 4
active: 1
length: 2
direction: {x: 0, y: 0, z: 1}
offset: {x: 0, y: 0.75, z: -0.5}
ignoreLayers:
serializedVersion: 2
m_Bits: 128
ignoreObjects: []
dontIgnoreSelf: 0
width: 1
size: {x: 0, y: 0, z: 0}
rotation: {x: 0, 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:
version: 2
RefIds: []
@@ -761,10 +864,11 @@ MonoBehaviour:
UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"Combat
Information":{"_value":{},"_name":"Combat Information","_id":"a15396c3-5ba0-4789-b5c5-39a6cfea1943","$type":"NodeCanvas.Framework.Variable`1[[NodeCanvas.Framework.VariableSeperator,
ParadoxNotion, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"inGoHard":{"_propertyPath":"PlayerMeter.inGoHard","_name":"inGoHard","_id":"dc9f60c8-856e-4970-bf11-25745eff1201","$type":"NodeCanvas.Framework.Variable`1[[System.Boolean,
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}}}'
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"testobject":{"_name":"testobject","_id":"45e90651-1912-40ef-b4fc-6c27d00d0ef0","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.GameObject,
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}}}'
_objectReferences:
- {fileID: 0}
- {fileID: 6535719103590072454}
- {fileID: 8505492416078151957}
_serializedVariables:
- _json: '{"_value":{},"_name":"Resolved Movement","_id":"58618e1a-1bf3-4346-a961-2787a78116fa","$type":"NodeCanvas.Framework.Variable`1[[NodeCanvas.Framework.VariableSeperator,
ParadoxNotion, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}'
@@ -794,13 +898,16 @@ MonoBehaviour:
UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}'
_references:
- {fileID: 0}
- {fileID: 6535719103590072454}
- {fileID: 8505492416078151957}
- _json: '{"_value":{},"_name":"Combat Information","_id":"a15396c3-5ba0-4789-b5c5-39a6cfea1943","$type":"NodeCanvas.Framework.Variable`1[[NodeCanvas.Framework.VariableSeperator,
ParadoxNotion, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}'
_references: []
- _json: '{"_propertyPath":"PlayerMeter.inGoHard","_name":"inGoHard","_id":"dc9f60c8-856e-4970-bf11-25745eff1201","$type":"NodeCanvas.Framework.Variable`1[[System.Boolean,
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}'
_references: []
- _json: '{"_name":"testobject","_id":"45e90651-1912-40ef-b4fc-6c27d00d0ef0","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.GameObject,
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}'
_references: []
--- !u!95 &8583102325603564116
Animator:
serializedVersion: 7
@@ -941,7 +1048,28 @@ MonoBehaviour:
TransitionDuration: 0.08350754
TriggerNameHash: -309998415
TransitionIndex: 0
m_Animator: {fileID: 6535719103590072454}
- IsCrossFadeExit: 0
Layer: 0
OriginatingState: -660779543
DestinationState: -50309357
TransitionDuration: 0.25
TriggerNameHash: -743040919
TransitionIndex: 0
m_Animator: {fileID: 8505492416078151957}
--- !u!114 &2832127593411522816
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: a481e07cce98ed54ea4f1e9622c7df8b, type: 3}
m_Name:
m_EditorClassIdentifier: Core::Reset.Units.UnitAnimation
ShowTopMostFoldoutHeaderGroup: 1
modelAnimator: {fileID: 8505492416078151957}
--- !u!1 &9138484595871696647
GameObject:
m_ObjectHideFlags: 0
@@ -1084,6 +1212,10 @@ PrefabInstance:
propertyPath: m_Name
value: MaruTestMesh
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: e3ac69b01ac41514ab5cde0dffb31c13, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@@ -1184,3 +1316,99 @@ Animator:
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!1001 &4276760010964545458
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 7329826263822975762}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
propertyPath: m_Name
value: PlayerModel
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
insertIndex: -1
addedObject: {fileID: 8505492416078151957}
m_SourcePrefab: {fileID: 100100000, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
--- !u!1 &4006923029357400803 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
m_PrefabInstance: {fileID: 4276760010964545458}
m_PrefabAsset: {fileID: 0}
--- !u!95 &8505492416078151957
Animator:
serializedVersion: 7
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4006923029357400803}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: 8def683e913d7b54087d096cf3fc05b8, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_AnimatePhysics: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!4 &4382182686028875865 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: f48a3ffa82d4f324d82694fcbc66bb9a, type: 3}
m_PrefabInstance: {fileID: 4276760010964545458}
m_PrefabAsset: {fileID: 0}

View File

@@ -1826,7 +1826,8 @@ PrefabInstance:
UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"Combat
Information":{"_value":{},"_name":"Combat Information","_id":"a15396c3-5ba0-4789-b5c5-39a6cfea1943","$type":"NodeCanvas.Framework.Variable`1[[NodeCanvas.Framework.VariableSeperator,
ParadoxNotion, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"inGoHard":{"_propertyPath":"PlayerMeter.inGoHard","_name":"inGoHard","_id":"dc9f60c8-856e-4970-bf11-25745eff1201","$type":"NodeCanvas.Framework.Variable`1[[System.Boolean,
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}}}'
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"pickupTarget":{"_propertyPath":"Reset.Units.Player.pickupTarget","_name":"pickupTarget","_id":"bf809a37-76c1-4dd7-8528-cc09527cb016","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.GameObject,
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}}}'
objectReference: {fileID: 0}
- target: {fileID: 6546916578030478377, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: _objectReferences.Array.size
@@ -1842,10 +1843,19 @@ PrefabInstance:
value: '{"_name":"modelAnimator","_id":"64fd28ff-2ca7-4b11-89b9-2c0cf8961bf8","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.Animator,
UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}'
objectReference: {fileID: 0}
- target: {fileID: 6546916578030478377, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: _serializedVariables.Array.data[11]._json
value: '{"_propertyPath":"Reset.Units.Player.pickupTarget","_name":"pickupTarget","_id":"bf809a37-76c1-4dd7-8528-cc09527cb016","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.GameObject,
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}'
objectReference: {fileID: 0}
- target: {fileID: 6546916578030478377, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: _serializedVariables.Array.data[8]._references.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6694215117007243537, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6755910944311034920, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 25.23057
@@ -1882,6 +1892,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 66.36815
objectReference: {fileID: 0}
- target: {fileID: 7010788291086685387, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7087274578062743959, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 83.97552
@@ -2078,6 +2092,10 @@ PrefabInstance:
propertyPath: data.rotationSpeed.defaultValue
value: 10
objectReference: {fileID: 0}
- target: {fileID: 8191935187182503649, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8195681124149962496, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -63.06196
@@ -2182,6 +2200,22 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: -61.47872
objectReference: {fileID: 0}
- target: {fileID: 8855283078872505435, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8855283078872505435, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8855283078872505435, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8855283078872505435, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8921845175749348414, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 45.77425
@@ -3558,12 +3592,17 @@ PrefabInstance:
UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"Combat
Information":{"_value":{},"_name":"Combat Information","_id":"a15396c3-5ba0-4789-b5c5-39a6cfea1943","$type":"NodeCanvas.Framework.Variable`1[[NodeCanvas.Framework.VariableSeperator,
ParadoxNotion, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"inGoHard":{"_propertyPath":"PlayerMeter.inGoHard","_name":"inGoHard","_id":"dc9f60c8-856e-4970-bf11-25745eff1201","$type":"NodeCanvas.Framework.Variable`1[[System.Boolean,
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}}}'
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"testobject":{"_name":"testobject","_id":"1ed67ab7-76d3-45fa-b36b-7e676e69dcea","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.GameObject,
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}}}'
objectReference: {fileID: 0}
- target: {fileID: 6546916578030478377, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: _objectReferences.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6546916578030478377, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: _serializedVariables.Array.size
value: 12
objectReference: {fileID: 0}
- target: {fileID: 6546916578030478377, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: _serializedVariables.Array.data[6]._json
value: '{"_propertyPath":"UnityEngine.CharacterController.isGrounded","_name":"isGrounded","_id":"5dbc6a46-39ce-4d74-87a2-ac8211a5a77f","_debugBoundValue":true,"$type":"NodeCanvas.Framework.Variable`1[[System.Boolean,
@@ -3574,6 +3613,11 @@ PrefabInstance:
value: '{"_name":"modelAnimator","_id":"64fd28ff-2ca7-4b11-89b9-2c0cf8961bf8","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.Animator,
UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}'
objectReference: {fileID: 0}
- target: {fileID: 6546916578030478377, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: _serializedVariables.Array.data[11]._json
value: '{"_name":"testobject","_id":"1ed67ab7-76d3-45fa-b36b-7e676e69dcea","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.GameObject,
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}'
objectReference: {fileID: 0}
- target: {fileID: 6546916578030478377, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: _serializedVariables.Array.data[8]._references.Array.size
value: 0
@@ -5288,6 +5332,50 @@ Mesh:
- serializedVersion: 1
m_IndexStart: 0
m_IndexCount: 0
--- !u!1 &1291419215
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1291419217}
- component: {fileID: 1291419216}
m_Layer: 0
m_Name: WidgetEventDispatcher
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1291419216
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1291419215}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 318dc804b7b04630a9ed534a2243e51f, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Multiplayer.Widgets.Core::Unity.Multiplayer.Widgets.WidgetEventDispatcher
--- !u!4 &1291419217
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1291419215}
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: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1379726749
GameObject:
m_ObjectHideFlags: 0
@@ -6368,12 +6456,17 @@ PrefabInstance:
UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"Combat
Information":{"_value":{},"_name":"Combat Information","_id":"a15396c3-5ba0-4789-b5c5-39a6cfea1943","$type":"NodeCanvas.Framework.Variable`1[[NodeCanvas.Framework.VariableSeperator,
ParadoxNotion, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"},"inGoHard":{"_propertyPath":"PlayerMeter.inGoHard","_name":"inGoHard","_id":"dc9f60c8-856e-4970-bf11-25745eff1201","$type":"NodeCanvas.Framework.Variable`1[[System.Boolean,
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"}}}'
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"},"testobject":{"_name":"testobject","_id":"de2c7183-a5c3-4036-b92c-4b952c7a7af0","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.GameObject,
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}}}'
objectReference: {fileID: 0}
- target: {fileID: 6546916578030478377, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: _objectReferences.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6546916578030478377, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: _serializedVariables.Array.size
value: 12
objectReference: {fileID: 0}
- target: {fileID: 6546916578030478377, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: _serializedVariables.Array.data[6]._json
value: '{"_propertyPath":"UnityEngine.CharacterController.isGrounded","_name":"isGrounded","_id":"5dbc6a46-39ce-4d74-87a2-ac8211a5a77f","_debugBoundValue":true,"$type":"NodeCanvas.Framework.Variable`1[[System.Boolean,
@@ -6384,6 +6477,11 @@ PrefabInstance:
value: '{"_name":"modelAnimator","_id":"64fd28ff-2ca7-4b11-89b9-2c0cf8961bf8","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.Animator,
UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}'
objectReference: {fileID: 0}
- target: {fileID: 6546916578030478377, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: _serializedVariables.Array.data[11]._json
value: '{"_name":"testobject","_id":"de2c7183-a5c3-4036-b92c-4b952c7a7af0","$type":"NodeCanvas.Framework.Variable`1[[UnityEngine.GameObject,
UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]"}'
objectReference: {fileID: 0}
- target: {fileID: 6546916578030478377, guid: 091cfac8be4c5a144a0b8997a9f1ff28, type: 3}
propertyPath: _serializedVariables.Array.data[8]._references.Array.size
value: 0
@@ -8530,3 +8628,4 @@ SceneRoots:
- {fileID: 1834179742}
- {fileID: 1113569334}
- {fileID: 4518178797721885223}
- {fileID: 1291419217}

View File

@@ -0,0 +1,49 @@
using Drawing;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using Reset.Units;
using Unity.Mathematics;
using Unity.Netcode;
using UnityEngine;
namespace NodeCanvas.Tasks.Actions {
[Category("Reset/Temporary")]
public class DrawReviveBar : ActionTask {
//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(){
// using (Draw.WithColor(Color.forestGreen)){
// EndAction(true);
// }
}
//Called once per frame while the action is active.
protected override void OnUpdate(){
agent.GetComponent<Player>().persistDrawingRevive = .5f;
agent.GetComponent<Player>().DrawReviveBarRpc(elapsedTime);
}
//Called when the task is disabled.
protected override void OnStop() {
}
//Called when the task is paused.
protected override void OnPause() {
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 3344c25cfd59ce44dbd4e72bddf0fd68

View File

@@ -0,0 +1,49 @@
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
namespace Reset.Core {
[Category("Reset")]
[Description("Checks if the object has IInteractable and if the interactable object is available for use.")]
public class IsInteractable : ConditionTask{
public BBParameter<GameObject> target;
protected override string info{
get{
// string agentName = agent == null ? agentType.ToString() : target.ToString();
return $"<b>{target.ToString()}</b> is interactable";
}
}
//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;
}
//Called whenever the condition gets enabled.
protected override void OnEnable() {
}
//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(){
IInteractable interactable = agent.GetComponent<IInteractable>();
if (interactable == null) {
return false;
}
return interactable.CanInteract();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 05ba64cebc9dea24daaf3f204b387610

View File

@@ -0,0 +1,50 @@
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
namespace Reset.Units {
[Category("Reset")]
[Description("Moves a unit and calls the appropropriate RPC to move the unit on the owner")]
public class MoveUnit : ActionTask<Unit>{
protected override string info{
get => $"Move Unit to <b>{position.value}</b>";
}
public BBParameter<Vector3> 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
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 (agent.UnitIsLocal()) {
agent.SetNewPosition(position.value);
} else {
agent.SetNewPositionRpc(position.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

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 643835ba2f810ea48813c97dc4213947

View File

@@ -0,0 +1,49 @@
using System;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using Unity.Netcode;
using Unity.Netcode.Components;
using UnityEngine;
namespace Reset.Core {
[Category("Reset")]
[Description("Sends an animation trigger with network sync to networked objects")]
public class SendAnimationTrigger : ActionTask<NetworkAnimator>{
public BBParameter<string> trigger;
//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(){
try {
agent.SetTrigger(trigger.value);
} catch (Exception e) {
Debug.LogError($"Did not set Network Animator trigger <i>{trigger.name}</i> on <b>{(agent == null ? null : agent.name)}</b>: {e.Message}");
}
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

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 02e8360f34e218546b718ebe401dd5b6

View File

@@ -0,0 +1,63 @@
using System;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using Unity.Netcode;
using UnityEngine;
namespace Reset.Units {
[Category("Reset")]
[Description("Send a string as an event to another unit. Works online as well")]
public class SendEventToUnit : ActionTask<Unit>{
public BBParameter<GameObject> target;
public string eventToSend;
protected override string info{
get{
return $"Send event <b>{eventToSend}</b> to <b>{target}</b>";
}
}
//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(){
Unit targetUnit = target.value.GetComponent<Unit>();
try {
if (targetUnit != null) {
if (target.value.GetComponent<Unit>().UnitIsNetworked()) {
targetUnit.DoGraphEventRpc(eventToSend);
} else {
targetUnit.GetComponent<GraphOwner>().SendEvent("eventToSend");
}
}
} catch (Exception e) {
Debug.LogError($"Failed to send event {eventToSend} to {target}: {e.Message}");
}
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

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

View File

@@ -2,6 +2,8 @@ using UnityEngine;
public interface IInteractable{
public void Interact();
public bool CanInteract();
public void CancelInteract();
public void OnObserverDetected(EnvironmentObserver observer);
}

View File

@@ -46,6 +46,10 @@ namespace Reset.Items{
}
}
public bool CanInteract(){
throw new NotImplementedException();
}
IEnumerator SpawnItems(){
for (int i = 0; i < Random.Range(minItemsToSpawn, maxItemsToSpawn); i++) {

View File

@@ -29,6 +29,10 @@ namespace Reset.Items{
}
}
public bool CanInteract(){
throw new NotImplementedException();
}
public void CancelInteract(){
throw new NotImplementedException();
}

View File

@@ -1,24 +1,28 @@
using System;
using System.Collections;
using Drawing;
using Reset;
using Reset.Core;
using Reset.Core.Tools;
using Reset.Units;
using UnityEngine;
using Sirenix.OdinInspector;
using Sirenix.Serialization;
using UnityEngine;
using Unity.Netcode;
namespace Reset.Units{
public class Player : Unit, IKillable{
public class Player : Unit, IKillable, IInteractable{
[HideInInspector] public PlayerControls controls;
float IKillable.maxHealth{ get; set; }
float IKillable.currentHealth{ get; set; }
public float maxHealth{ get; set; }
public float currentHealth{ get; set; }
public NetworkVariable<bool> _isDowned;
public bool IsDowned => _isDowned.Value;
private float timeDowned;
public GameObject pickupTarget;
void Awake(){
controls = GetComponent<PlayerControls>();
maxHealth = 20f;
}
public void Attach(){
@@ -58,14 +62,121 @@ namespace Reset.Units{
public void TakeDamage(DamageSource source){
((IKillable)this).currentHealth -= source.damageDealt;
if (UnitIsNetworked()) {
SetNewHealthRpc(currentHealth);
}
}
// TODO: Move somewhere not stupid so there's not an identical method in Enemy.cs
[Rpc(SendTo.Everyone)]
public void SetNewHealthRpc(float health){
currentHealth = health;
// NOTE: only here for testing. Move out of here into some "post damage" check method
if (((IKillable)this).currentHealth <= 0) {
Kill();
// if (UnitIsNetworked()) {
Down();
// } else {
// Kill();
// }
}
}
public void Kill(){
throw new NotImplementedException();
public void Down(){
Graph.SendEvent("Downed");
}
public void Kill(){
Graph.SendEvent("Killed");
}
public void Interact(){
// Check if the other player can be interacted with at all
if (pickupTarget&& pickupTarget.GetComponent<Player>().CanInteract()) {
// Tell the local player to start picking up the ally and switch states
Graph.SendEvent("Picking Up Ally");
// Tell the target player to start getting picked up.
pickupTarget.GetComponent<Player>().StartPickupRpc();
// Wait for the pickup timer to finish
StartCoroutine(PickupTimer());
}
}
[Rpc(SendTo.Owner)]
public void StartPickupRpc(){
// When picked up by another player, move into the pick up state
// TODO: Turn all these send events into a goddamn task maybe? State stuff should happen in the state machine. Concurrent stuff should happen in code
Graph.SendEvent("Pick Up Start");
}
IEnumerator PickupTimer(){
// Start a timer and wait for it to complete
float elapsed = 0f;
while (elapsed < 7f) {
elapsed += 1f * Time.deltaTime;
yield return null;
}
Graph.SendEvent("Pick Up Success");
}
public bool CanInteract(){
return IsDowned;
}
public void CancelInteract(){
Graph.SendEvent("Pick Up Failed");
}
public void OnObserverDetected(EnvironmentObserver observer){
// Try and get a Player component from the current hit object
// The rest of the logic will continue as expected so long as an
pickupTarget = observer.hit.collider.gameObject;
DrawInteractStatus();
}
void DrawInteractStatus(){
using (Draw.WithColor(Color.blue)) {
Draw.ingame.Label2D(transform.position + Vector3.up * 2.5f, "Interactable",
Color.orchid);
}
}
[Rpc(SendTo.Everyone)]
public void DrawReviveBarRpc(float elapsedTime){
Debug.Log("test is drawn");
using (Draw.ingame.WithLineWidth(5f)) {
using (Draw.InLocalSpace(transform)){
float width = .9f;
float widthDone = width * elapsedTime / 5f;
widthDone = Mathf.Clamp(widthDone, 0, width);
Vector3 pos = Vector3.up * 1.8f + Vector3.left * width + Vector3.forward * .01f;
Draw.ingame.Line(Camera.main.transform.rotation * pos, Camera.main.transform.rotation *
(pos + Vector3.right * width * 2f), Color.rebeccaPurple);
Vector3 donePos = Vector3.up * 1.8f + Vector3.left * widthDone;
Draw.ingame.Line(Camera.main.transform.rotation * donePos, Camera.main.transform.rotation *
(donePos + Vector3.right * widthDone * 2f), Color.red);
}
}
lastKnownReviveTime = elapsedTime;
}
void LateUpdate(){
// Clear the pickupTarget every frame
// NOTE: Will this work online?
pickupTarget = null;
}
}
}

View File

@@ -157,7 +157,8 @@ public class EnvironmentObserver{
}
if (hit.transform != null) {
if (hit.transform.GetComponent<IInteractable>() != null) {
IInteractable interactable = hit.transform.GetComponent<IInteractable>();
if (interactable != null && interactable.CanInteract()) {
hit.transform.GetComponent<IInteractable>().OnObserverDetected(this);
}
return true;

View File

@@ -2,17 +2,55 @@
using System.Collections;
using System.Threading.Tasks;
using Drawing;
using NodeCanvas.BehaviourTrees;
using NodeCanvas.Framework;
using NodeCanvas.StateMachines;
using Reset;
using Reset.Units;
using Unity.Collections;
using Unity.Netcode;
using UnityEngine;
namespace Reset.Units{
public class Unit : NetworkBehaviour{
public class Unit : NetworkBehaviour, INetworkSerializeByMemcpy{
public string state;
public NetworkVariable<FixedString64Bytes> testSTate;
private FSMOwner fsm;
private UnitMovementHandler _movement;
internal UnitMovementHandler Movement{
get{
if (!_movement) {
_movement = GetComponent<UnitMovementHandler>();
}
return _movement;
}
}
private GraphOwner _graph;
internal GraphOwner Graph{
get{
if (!_graph) {
_graph = GetComponent<GraphOwner>();
}
return _graph;
}
}
private void Awake(){
fsm = GetComponent<FSMOwner>();
}
public virtual void Start(){
UnitStart();
}
public virtual void UnitStart(){ }
public bool UnitIsNetworked(){
@@ -40,6 +78,11 @@ namespace Reset.Units{
public virtual void UnitUpdate(){ }
void UpdateGizmos(){
DrawOnlineStatusGizmo();
DrawStateGizmo();
}
private void DrawOnlineStatusGizmo(){
string onlineStatus = "Not Online";
Color onlineColor = Color.gray;
@@ -56,9 +99,60 @@ namespace Reset.Units{
Draw.ingame.Label2D(transform.position + Vector3.up * 2.5f, onlineStatus, onlineColor);
}
[Rpc(SendTo.Owner)]
public void SetNewPositionRpc(Vector3 position){
SetNewPosition(position);
}
public void SetNewPosition(Vector3 position){
var contr = GetComponent<CharacterController>();
if (contr)
contr.enabled = false;
transform.position = position;
if (contr)
contr.enabled = true;
}
private void DrawStateGizmo(){
if (fsm && UnitIsLocal()) {
testSTate.Value = fsm.currentRootStateName;
// if (UnitIsNetworked()) {
// // state = fsm.currentRootStateName;
// SendStateInformationRpc(fsm.currentRootStateName);
// } else {
// state = fsm.currentRootStateName;
// }
} else {
fsm = GetComponent<FSMOwner>();
}
// state = state.ToString().ToUpper();
try {
Draw.ingame.Label2D(transform.position + Vector3.up * 2.7f, testSTate.Value.ToString(), Color.red);
} catch (Exception e) {
Debug.LogError(e.Message);
}
}
[Rpc(SendTo.Everyone)]
public void SendStateInformationRpc(string newState){
Debug.Log($"newstate! {newState}");
state = newState;
}
[Rpc(SendTo.Owner)]
public void TakeOwnershipRpc(ulong clientID){
GetComponent<NetworkObject>().ChangeOwnership(clientID);
}
[Rpc(SendTo.Owner)]
public void DoGraphEventRpc(string eventToSend){
Debug.Log(eventToSend);
GetComponent<FSMOwner>().SendEvent(eventToSend); }
}
}

View File

@@ -0,0 +1,44 @@
using System;
using UnityEngine;
namespace Reset.Units{
public class UnitAnimation : UnitComponent{
public Animator modelAnimator;
// Temporary
private float inputMagnitude;
void Start(){
}
void Update(){
try {
// Temporary
inputMagnitude = Mathf.MoveTowards(inputMagnitude, GetComponent<PlayerControls>().rawMoveInput.magnitude * 2f, 6f * Time.deltaTime);
modelAnimator.SetFloat("Move Direction X", Unit.Movement.GetResolvedDirectionLocal().x * inputMagnitude);
modelAnimator.SetFloat("Move Direction Y", Unit.Movement.GetResolvedDirectionLocal().y * inputMagnitude);
} catch (Exception e) {
Debug.LogError($"Failed in setting X and Y move direction floats: {e.Message}");
}
}
public void SendTriggerToAnimator(string trigger){
if (!modelAnimator) {
Debug.LogError($"There is no animator set to recieve the trigger '{trigger}' on unit {name}.", gameObject);
return;
}
try {
modelAnimator.SetTrigger(trigger);
}
catch (Exception e)
{
Debug.LogError($"Failed to send trigger to Animator: {e.Message}");
}
}
}
}

View File

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

View File

@@ -335,6 +335,9 @@ namespace Reset.Units{
return resolvedMovement.moveDirection.World;
}
public Vector2 GetResolvedDirectionLocal(){
return resolvedMovement.moveDirection.Local;
}
public Vector3 GetResolvedDirectionVector3(){
return resolvedMovement.moveDirection.World.ToVector3();
}

View File

@@ -1,6 +1,7 @@
{
"dependencies": {
"com.unity.ai.navigation": "2.0.8",
"com.unity.burst": "1.8.25",
"com.unity.cinemachine": "3.1.2",
"com.unity.collab-proxy": "2.8.2",
"com.unity.ide.rider": "3.0.36",

View File

@@ -33,8 +33,8 @@
"url": "https://packages.unity.com"
},
"com.unity.burst": {
"version": "1.8.24",
"depth": 1,
"version": "1.8.25",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.mathematics": "1.2.1",