change: adding stats to combat movement
This commit is contained in:
@@ -12,13 +12,21 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 7a686a47eee2fa44cb0a34b5d86e4d5e, type: 3}
|
m_Script: {fileID: 11500000, guid: 7a686a47eee2fa44cb0a34b5d86e4d5e, type: 3}
|
||||||
m_Name: AttackCombo1
|
m_Name: AttackCombo1
|
||||||
m_EditorClassIdentifier: NodeCanvas::NodeCanvas.BehaviourTrees.BehaviourTree
|
m_EditorClassIdentifier: NodeCanvas::NodeCanvas.BehaviourTrees.BehaviourTree
|
||||||
_serializedGraph: '{"type":"NodeCanvas.BehaviourTrees.BehaviourTree","nodes":[{"policy":1,"_position":{"x":381.0,"y":180.0},"$type":"NodeCanvas.BehaviourTrees.Parallel","$id":"0"},{"repeaterMode":2,"repeatTimes":{"_value":1},"_position":{"x":232.0,"y":320.0},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"1"},{"_action":{"field":{"_baseInfo":"Reset.Units.UnitMovementHandler|outputMoveDirection"},"setValue":{"_type":"UnityEngine.Vector3","_value":{"z":0.57,"$type":"UnityEngine.Vector3"}},"$type":"NodeCanvas.Tasks.Actions.SetField","$version":1},"_position":{"x":101.0,"y":426.0},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"2"},{"_position":{"x":506.0,"y":339.0},"$type":"NodeCanvas.BehaviourTrees.Sequencer","$id":"3"},{"_action":{"actions":[{"parameter":{"_value":"Melee"},"parameterHashID":{},"overrideAgent":{"_type":"UnityEngine.Animator","_name":"myAnimator","_targetVariableID":"2b9f09c0-47f9-42d4-8832-3ba15765ced5"},"$type":"NodeCanvas.Tasks.Actions.MecanimSetTrigger"},{"waitTime":{"_value":0.35},"$type":"NodeCanvas.Tasks.Actions.Wait"}],"$type":"NodeCanvas.Framework.ActionList"},"_position":{"x":477.0,"y":445.0},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"4"},{"_action":{"actions":[{"parameter":{"_value":"Melee"},"parameterHashID":{},"overrideAgent":{"_type":"UnityEngine.Animator","_name":"myAnimator","_targetVariableID":"2b9f09c0-47f9-42d4-8832-3ba15765ced5"},"$type":"NodeCanvas.Tasks.Actions.MecanimSetTrigger"},{"waitTime":{"_value":0.2},"$type":"NodeCanvas.Tasks.Actions.Wait"}],"$type":"NodeCanvas.Framework.ActionList"},"_position":{"x":675.0,"y":445.0},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"5"},{"_action":{"actions":[{"parameter":{"_value":"Melee"},"parameterHashID":{},"overrideAgent":{"_type":"UnityEngine.Animator","_name":"myAnimator","_targetVariableID":"2b9f09c0-47f9-42d4-8832-3ba15765ced5"},"$type":"NodeCanvas.Tasks.Actions.MecanimSetTrigger"},{"waitTime":{"_value":0.5},"$type":"NodeCanvas.Tasks.Actions.Wait"}],"$type":"NodeCanvas.Framework.ActionList"},"_position":{"x":874.0,"y":442.0},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"6"}],"connections":[{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"3"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"2"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"4"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"5"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"6"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"}],"canvasGroups":[],"localBlackboard":{"_variables":{}},"derivedData":{"repeat":true,"$type":"NodeCanvas.BehaviourTrees.BehaviourTree+DerivedSerializationData"}}'
|
_serializedGraph: '{"type":"NodeCanvas.BehaviourTrees.BehaviourTree","nodes":[{"policy":1,"_position":{"x":358.7176,"y":177.9743},"$type":"NodeCanvas.BehaviourTrees.Parallel","$id":"0"},{"repeaterMode":2,"repeatTimes":{"_value":1},"_position":{"x":208.7047,"y":317.9743},"$type":"NodeCanvas.BehaviourTrees.Repeater","$id":"1"},{"_action":{"actions":[{"method":{"_baseInfo":"Reset.Units.UnitMovementHandler|SmoothToSpeed|System.Void","_paramsInfo":"System.Single|System.Single"},"parameters":[{"_type":"System.Single","_value":{"$content":10.0,"$type":"System.Single"}},{"_type":"System.Single","_value":{"$content":0.1,"$type":"System.Single"}}],"returnValue":{},"$type":"NodeCanvas.Tasks.Actions.ExecuteFunction_Multiplatform"},{"method":{"_baseInfo":"Reset.Units.UnitMovementHandler|SetNewDirection|System.Void","_paramsInfo":"UnityEngine.Vector3"},"parameters":[{"_type":"UnityEngine.Vector3","_value":{"z":0.1,"$type":"UnityEngine.Vector3"}}],"returnValue":{},"$type":"NodeCanvas.Tasks.Actions.ExecuteFunction_Multiplatform"},{"moveSpeed":{"label":"Move
|
||||||
|
Speed","value":{}},"moveSpeedSoothing":{"label":"Move Speed Smoothing","value":{}},"airDirectionDecay":{"label":"Air
|
||||||
|
Direction Decay","value":{}},"accelerationSmoothing":{"label":"Acceleration Smoothing","value":{}},"deaccelerationSmoothing":{"label":"Deacceleration
|
||||||
|
Smoothing","value":{}},"addDirectionFromInput":{"x":5.0,"y":4.0},"addInputStrength":0.69,"jumpPower":{"label":"Jump
|
||||||
|
Power","value":{}},"jumpPowerDecay":{"label":"Jump Decay Speed","value":{}},"gravityPower":{"label":"Gravity
|
||||||
|
Power","value":{}},"gravityMax":{"label":"Gravity Max","value":{}},"gravityAcceleration":{"label":"Gravity
|
||||||
|
Acceleration Speed","value":{}},"gravityScale":{"label":"Gravity Scale","value":{}},"settingsChangeSmoothing":{"label":"Settings
|
||||||
|
Change Smoothing","value":{}},"rotationSpeed":{"label":"Rotation Speed","value":{}},"rotationSmoothing":{"label":"Rotation
|
||||||
|
Smoothing","value":{}},"rotationInputBlending":{"label":"Rotation Input Blending","value":{}},"feedNewRotation":{},"feedRelativeTo":{},"$type":"Reset.Core.ChangeMovementSettings"}],"$type":"NodeCanvas.Framework.ActionList"},"_position":{"x":83.7561,"y":445.308},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"2"},{"_position":{"x":506.0,"y":339.0},"$type":"NodeCanvas.BehaviourTrees.Sequencer","$id":"3"},{"_action":{"actions":[{"parameter":{"_value":"Melee"},"parameterHashID":{},"overrideAgent":{"_type":"UnityEngine.Animator","_name":"myAnimator","_targetVariableID":"2b9f09c0-47f9-42d4-8832-3ba15765ced5"},"$type":"NodeCanvas.Tasks.Actions.MecanimSetTrigger"},{"waitTime":{"_value":0.35},"$type":"NodeCanvas.Tasks.Actions.Wait"}],"$type":"NodeCanvas.Framework.ActionList"},"_position":{"x":477.0,"y":445.0},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"4"},{"_action":{"actions":[{"parameter":{"_value":"Melee"},"parameterHashID":{},"overrideAgent":{"_type":"UnityEngine.Animator","_name":"myAnimator","_targetVariableID":"2b9f09c0-47f9-42d4-8832-3ba15765ced5"},"$type":"NodeCanvas.Tasks.Actions.MecanimSetTrigger"},{"waitTime":{"_value":0.2},"$type":"NodeCanvas.Tasks.Actions.Wait"}],"$type":"NodeCanvas.Framework.ActionList"},"_position":{"x":675.0,"y":445.0},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"5"},{"_action":{"actions":[{"parameter":{"_value":"Melee"},"parameterHashID":{},"overrideAgent":{"_type":"UnityEngine.Animator","_name":"myAnimator","_targetVariableID":"2b9f09c0-47f9-42d4-8832-3ba15765ced5"},"$type":"NodeCanvas.Tasks.Actions.MecanimSetTrigger"},{"waitTime":{"_value":0.5},"$type":"NodeCanvas.Tasks.Actions.Wait"}],"$type":"NodeCanvas.Framework.ActionList"},"_position":{"x":874.0,"y":444.0},"$type":"NodeCanvas.BehaviourTrees.ActionNode","$id":"6"}],"connections":[{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"1"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"0"},"_targetNode":{"$ref":"3"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"1"},"_targetNode":{"$ref":"2"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"4"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"5"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"},{"_sourceNode":{"$ref":"3"},"_targetNode":{"$ref":"6"},"$type":"NodeCanvas.BehaviourTrees.BTConnection"}],"canvasGroups":[],"localBlackboard":{"_variables":{}},"derivedData":{"repeat":true,"$type":"NodeCanvas.BehaviourTrees.BehaviourTree+DerivedSerializationData"}}'
|
||||||
_objectReferences: []
|
_objectReferences: []
|
||||||
_graphSource:
|
_graphSource:
|
||||||
_version: 3.31
|
_version: 3.31
|
||||||
_category:
|
_category:
|
||||||
_comments:
|
_comments:
|
||||||
_translation: {x: 97, y: -95}
|
_translation: {x: 483, y: 63}
|
||||||
_zoomFactor: 1
|
_zoomFactor: 1
|
||||||
_haltSerialization: 0
|
_haltSerialization: 0
|
||||||
_externalSerializationFile: {fileID: 0}
|
_externalSerializationFile: {fileID: 0}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public interface IEquipable
|
namespace Reset.Items{
|
||||||
{
|
public interface IEquipable{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using NodeCanvas.Tasks.Actions;
|
||||||
using Reset.Items;
|
using Reset.Items;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@@ -23,6 +24,21 @@ namespace Reset.Units{
|
|||||||
storedItems.Add(newItem);
|
storedItems.Add(newItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Equip(Item item){
|
||||||
|
if (item is not IEquipable) {
|
||||||
|
Debug.LogError("This item is not equippable.", item);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item is Weapon thisWeapon) {
|
||||||
|
if (meleeWeapon != null) {
|
||||||
|
storedItems.Add(meleeWeapon);
|
||||||
|
}
|
||||||
|
|
||||||
|
meleeWeapon = thisWeapon;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update(){
|
void Update(){
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user