From d69ac71ff2651398ba4ee72f6ff63a43b84f422d Mon Sep 17 00:00:00 2001 From: christides11 <29593332+christides11@users.noreply.github.com> Date: Sun, 24 Apr 2022 18:10:01 -0400 Subject: [PATCH] feat: Added function MarkForStateChange. --- Assembly-CSharp.csproj | 3 - Assets/HnSF/Fighter/IFighterStateManager.cs | 1 + .../Samples/TDAction/Fighters/ADV/ADV.prefab | 57 ++----------------- .../TDAction/Fighters/ADV/ADVMoveset.asset | 2 +- .../Fighter/Managers/FighterCombatManager.cs | 29 +++++----- .../Fighter/Managers/FighterInputManager.cs | 3 - .../Fighter/Managers/FighterPhysicsManager.cs | 29 +--------- .../Fighter/Managers/FighterStateManager.cs | 32 ++++------- .../Conditions/BaseConditionFunctionEnum.cs | 7 +++ .../BaseConditionFunctionEnum.cs.meta | 11 ++++ .../Conditions/BaseConditionFunctions.cs | 12 ++++ .../Conditions/BaseConditionFunctions.cs.meta | 11 ++++ .../State/Functions/BaseStateFunctionEnum.cs | 10 ++++ .../Functions/BaseStateFunctionEnum.cs.meta | 11 ++++ .../State/Functions/BaseStateFunctions.cs | 20 +++++++ .../Functions/BaseStateFunctions.cs.meta | 11 ++++ .../Scripts/State/StateConditionMapper.cs | 45 +++++++++++++++ .../State/StateConditionMapper.cs.meta | 11 ++++ .../Scripts/State/StateFunctionMapper.cs | 20 +++++++ .../Scripts/State/StateFunctionMapper.cs.meta | 11 ++++ .../Scripts/State/Variables/ChangeState.cs | 21 +++++++ .../State/Variables/ChangeState.cs.meta | 11 ++++ HnSF.Editor.csproj | 6 -- HnSF.csproj | 7 +++ Packages/manifest.json | 3 +- Packages/packages-lock.json | 22 +------ .../RiderScriptEditorPersistedState.asset | 2 +- 27 files changed, 260 insertions(+), 148 deletions(-) create mode 100644 Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctionEnum.cs create mode 100644 Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctionEnum.cs.meta create mode 100644 Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctions.cs create mode 100644 Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctions.cs.meta create mode 100644 Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctionEnum.cs create mode 100644 Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctionEnum.cs.meta create mode 100644 Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctions.cs create mode 100644 Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctions.cs.meta create mode 100644 Assets/HnSF/Samples/TDAction/Scripts/State/StateConditionMapper.cs create mode 100644 Assets/HnSF/Samples/TDAction/Scripts/State/StateConditionMapper.cs.meta create mode 100644 Assets/HnSF/Samples/TDAction/Scripts/State/StateFunctionMapper.cs create mode 100644 Assets/HnSF/Samples/TDAction/Scripts/State/StateFunctionMapper.cs.meta create mode 100644 Assets/HnSF/Samples/TDAction/Scripts/State/Variables/ChangeState.cs create mode 100644 Assets/HnSF/Samples/TDAction/Scripts/State/Variables/ChangeState.cs.meta diff --git a/Assembly-CSharp.csproj b/Assembly-CSharp.csproj index 6b0bd63c..3f64ad20 100644 --- a/Assembly-CSharp.csproj +++ b/Assembly-CSharp.csproj @@ -918,9 +918,6 @@ C:\Projects\Unity\hack-and-slash-framework\Library\ScriptAssemblies\Unity.TextMeshPro.Editor.dll - - C:\Projects\Unity\hack-and-slash-framework\Library\ScriptAssemblies\Unity.VisualStudio.Editor.dll - C:\Projects\Unity\hack-and-slash-framework\Library\ScriptAssemblies\medvedya.select_implementation_property_drawer.dll diff --git a/Assets/HnSF/Fighter/IFighterStateManager.cs b/Assets/HnSF/Fighter/IFighterStateManager.cs index 6963948b..66c2ec44 100644 --- a/Assets/HnSF/Fighter/IFighterStateManager.cs +++ b/Assets/HnSF/Fighter/IFighterStateManager.cs @@ -9,6 +9,7 @@ public interface IFighterStateManager Combat.MovesetDefinition GetMoveset(int index); + void MarkForStateChange(int state); bool ChangeState(int state, int stateFrame = 0, bool callOnInterrupt = true); StateTimeline GetState(int state); StateTimeline GetState(int moveset, int state); diff --git a/Assets/HnSF/Samples/TDAction/Fighters/ADV/ADV.prefab b/Assets/HnSF/Samples/TDAction/Fighters/ADV/ADV.prefab index 5d8b612a..6c41da92 100644 --- a/Assets/HnSF/Samples/TDAction/Fighters/ADV/ADV.prefab +++ b/Assets/HnSF/Samples/TDAction/Fighters/ADV/ADV.prefab @@ -96,7 +96,6 @@ GameObject: - component: {fileID: 6164416680294650169} - component: {fileID: 3204139750782918213} - component: {fileID: 7070423521996889968} - - component: {fileID: 2446682337119611762} - component: {fileID: -473810435442433682} - component: {fileID: 1199271652} - component: {fileID: 1199271654} @@ -173,23 +172,6 @@ BoxCollider2D: serializedVersion: 2 m_Size: {x: 0.8, y: 1.75} m_EdgeRadius: 0 ---- !u!320 &2446682337119611762 -PlayableDirector: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3890948787661181835} - m_Enabled: 1 - serializedVersion: 3 - m_PlayableAsset: {fileID: 0} - m_InitialState: 0 - m_WrapMode: 0 - m_DirectorUpdateMode: 3 - m_InitialTime: 0 - m_SceneBindings: [] - m_ExposedReferences: - m_References: [] --- !u!114 &-473810435442433682 MonoBehaviour: m_ObjectHideFlags: 0 @@ -206,8 +188,8 @@ MonoBehaviour: _combatManager: {fileID: 1199271654} _physicsManager: {fileID: 1199271653} _inputManager: {fileID: 7836252275299144723} - visual: {fileID: 2309637557716152273} definition: {fileID: 11400000, guid: c380ee3a80157994caef3895f8ca8dde, type: 2} + visual: {fileID: 2309637557716152273} --- !u!114 &1199271652 MonoBehaviour: m_ObjectHideFlags: 0 @@ -220,40 +202,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: da649541cf321194e8b82f361c458e60, type: 3} m_Name: m_EditorClassIdentifier: - baseHitInfo: - ID: 0 - coreHitInfo: - ID: 0 - airOnly: 0 - groundOnly: 0 - causesTumble: 0 - knockdown: 0 - groundBounces: 0 - groundBounceForce: 0 - wallBounces: 0 - wallBounceForce: 0 - damageOnHit: 0 - opponentForce: {x: 0, y: 1, z: 0} - forceIncludeYForce: 0 - opponentForceMultiplier: 1 - opponentMaxMagnitude: 1 - opponentMinMagnitude: 1 - pushPullCenterOffset: {x: 0, y: 0, z: 0} - hitKills: 1 - continuousHit: 0 - spaceBetweenHits: 0 - opponentResetXForce: 1 - opponentResetYForce: 1 - autoLink: 0 - autoLinkPercentage: 1 - forceType: 0 - forceRelation: 0 - attackerHitstop: 0 - hitstop: 0 - hitstun: 0 + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: 0 fighterManager: {fileID: -473810435442433682} - currentState: 0 - currentStateFrame: 0 --- !u!114 &1199271654 MonoBehaviour: m_ObjectHideFlags: 0 @@ -266,6 +218,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 27ad487a7dc3f04419ddca98540bb42a, type: 3} m_Name: m_EditorClassIdentifier: + team: 0 --- !u!114 &1199271653 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/HnSF/Samples/TDAction/Fighters/ADV/ADVMoveset.asset b/Assets/HnSF/Samples/TDAction/Fighters/ADV/ADVMoveset.asset index 2099db7e..f7291615 100644 --- a/Assets/HnSF/Samples/TDAction/Fighters/ADV/ADVMoveset.asset +++ b/Assets/HnSF/Samples/TDAction/Fighters/ADV/ADVMoveset.asset @@ -15,7 +15,7 @@ MonoBehaviour: states: - state: rid: 1423070975590137858 - stateTimeline: {fileID: 0} + stateTimeline: {fileID: 11400000, guid: 0ce685a764a7b84468d9883fa0fbe4c0, type: 2} references: version: 2 RefIds: diff --git a/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterCombatManager.cs b/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterCombatManager.cs index f67302a3..beb55d93 100644 --- a/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterCombatManager.cs +++ b/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterCombatManager.cs @@ -9,14 +9,17 @@ namespace HnSF.Sample.TDAction { public class FighterCombatManager : MonoBehaviour, IFighterCombatManager { - public int HitStop { get; } = 0; - public int HitStun { get; } = 0; - public int CurrentChargeLevel { get; } = 0; - public int CurrentChargeLevelCharge { get; } = 0; + public int HitStop { get; protected set; } = 0; + public int HitStun { get; protected set; } = 0; + public int CurrentChargeLevel { get; protected set; } = 0; + public int CurrentChargeLevelCharge { get; protected set; } = 0; + public int team = 0; + public void Cleanup() { - throw new System.NotImplementedException(); + CurrentChargeLevel = 0; + CurrentChargeLevelCharge = 0; } public bool CheckForInputSequence(InputSequence sequence, uint baseOffset = 0, bool processSequenceButtons = false, @@ -27,42 +30,42 @@ public bool CheckForInputSequence(InputSequence sequence, uint baseOffset = 0, b public void SetHitStop(int value) { - throw new System.NotImplementedException(); + HitStop = value; } public void AddHitStop(int value) { - throw new System.NotImplementedException(); + HitStop += value; } public void SetHitStun(int value) { - throw new System.NotImplementedException(); + HitStun = value; } public void AddHitStun(int value) { - throw new System.NotImplementedException(); + HitStun += value; } public void SetChargeLevel(int value) { - throw new System.NotImplementedException(); + CurrentChargeLevel = value; } public void SetChargeLevelCharge(int value) { - throw new System.NotImplementedException(); + CurrentChargeLevelCharge = value; } public void IncrementChargeLevelCharge(int maxCharge) { - throw new System.NotImplementedException(); + CurrentChargeLevelCharge = Mathf.Clamp(CurrentChargeLevelCharge+1, 0, maxCharge); } public int GetTeam() { - throw new System.NotImplementedException(); + return team; } } } \ No newline at end of file diff --git a/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterInputManager.cs b/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterInputManager.cs index 1ef37788..56d896b4 100644 --- a/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterInputManager.cs +++ b/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterInputManager.cs @@ -1,8 +1,5 @@ -using System.Collections; -using System.Collections.Generic; using UnityEngine; - namespace HnSF.Sample.TDAction { public class FighterInputManager : MonoBehaviour diff --git a/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterPhysicsManager.cs b/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterPhysicsManager.cs index 42a5eab1..4916f7e3 100644 --- a/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterPhysicsManager.cs +++ b/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterPhysicsManager.cs @@ -45,34 +45,11 @@ public void SetGrounded(bool value) { IsGrounded = value; } - - public virtual void ApplyGravity() - { - /* - FighterManager m = ((FighterManager)manager); - float maxFallSpeed = m.CombatManager.HitStun > 0 ? m.statManager.CurrentStats.hitstunMaxFallSpeed.GetCurrentValue() - : m.statManager.CurrentStats.maxFallSpeed.GetCurrentValue(); - float gravity = m.CombatManager.HitStun > 0 ? m.statManager.CurrentStats.hitstunGravity.GetCurrentValue() - : m.statManager.CurrentStats.gravity.GetCurrentValue(); - HandleGravity(maxFallSpeed, gravity, GravityScale);*/ - } - - public virtual void ApplyGravity(float maxFallSpeed, float gravity, float gravityScale) + + public virtual void ApplyGravity(float maxFallSpeed, float gravity) { Vector2 tempMovement = this.forceMovement; - if (tempMovement.y > -(maxFallSpeed)) - { - tempMovement.y -= gravity * gravityScale; - if (tempMovement.y < -(maxFallSpeed)) - { - tempMovement.y = -maxFallSpeed; - } - } - else if (tempMovement.y < -(maxFallSpeed)) - { - tempMovement.y *= decelerationFactor; - } - + tempMovement.y = Mathf.MoveTowards(tempMovement.y, maxFallSpeed, gravity * Time.fixedDeltaTime); this.forceMovement = tempMovement; } diff --git a/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterStateManager.cs b/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterStateManager.cs index c3c14457..ee5dd209 100644 --- a/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterStateManager.cs +++ b/Assets/HnSF/Samples/TDAction/Scripts/Fighter/Managers/FighterStateManager.cs @@ -10,21 +10,16 @@ namespace HnSF.Sample.TDAction { public class FighterStateManager : MonoBehaviour, IFighterStateManager { - public int MovesetCount { get; } - public int CurrentStateMoveset { get; } - - public HitInfoBase baseHitInfo; - - public HitInfo coreHitInfo; - - public int CurrentState + public int MovesetCount { - get { return currentState; } - } - public int CurrentStateFrame - { - get { return currentStateFrame; } + get { return fighterManager.definition.movesets.Length; } } + [field: SerializeField] + public int CurrentStateMoveset { get; protected set; } = 0; + [field: SerializeField] + public int CurrentState { get; protected set; } = 0; + [field: SerializeField] + public int CurrentStateFrame { get; protected set; } = 0; protected Dictionary states = new Dictionary(); @@ -32,9 +27,6 @@ public int CurrentStateFrame private int nextState = 0; public FighterManager fighterManager; - public int currentState = 0; - public int currentStateFrame = 0; - private void Awake() { @@ -71,8 +63,8 @@ public bool ChangeState(int state, int stateFrame = 0, bool callOnInterrupt = tr SetFrame(states[CurrentState].totalFrames); } - currentStateFrame = stateFrame; - currentState = state; + CurrentStateFrame = stateFrame; + CurrentState = state; if(CurrentStateFrame == 0) { InitState(); @@ -105,12 +97,12 @@ public void SetMoveset(int movesetIndex) public void SetFrame(int frame) { - currentStateFrame = frame; + CurrentStateFrame = frame; } public void IncrementFrame() { - currentStateFrame++; + CurrentStateFrame++; } } } \ No newline at end of file diff --git a/Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctionEnum.cs b/Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctionEnum.cs new file mode 100644 index 00000000..0c70bec1 --- /dev/null +++ b/Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctionEnum.cs @@ -0,0 +1,7 @@ +namespace HnSF.Sample.TDAction.State +{ + public enum ConditionFunctionEnum : int + { + NONE = 0 + } +} \ No newline at end of file diff --git a/Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctionEnum.cs.meta b/Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctionEnum.cs.meta new file mode 100644 index 00000000..137e2555 --- /dev/null +++ b/Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctionEnum.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fa4d1ae8d35a9f84e9a14c5c02602f32 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctions.cs b/Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctions.cs new file mode 100644 index 00000000..3863788a --- /dev/null +++ b/Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctions.cs @@ -0,0 +1,12 @@ +using HnSF.Fighters; + +namespace HnSF.Sample.TDAction +{ + public class BaseConditionFunctions + { + public static bool NoCondition(IFighterBase fighter, IConditionVariables variables) + { + return true; + } + } +} \ No newline at end of file diff --git a/Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctions.cs.meta b/Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctions.cs.meta new file mode 100644 index 00000000..e44eb3af --- /dev/null +++ b/Assets/HnSF/Samples/TDAction/Scripts/State/Conditions/BaseConditionFunctions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9a47816801ca8374abde6a11801a9e03 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctionEnum.cs b/Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctionEnum.cs new file mode 100644 index 00000000..d20b6b8c --- /dev/null +++ b/Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctionEnum.cs @@ -0,0 +1,10 @@ +namespace HnSF.Sample.TDAction.State +{ + [System.Serializable] + public enum StateFunctionEnum : int + { + NULL = 0, + CHANGE_STATE, + APPLY_GRAVITY + } +} \ No newline at end of file diff --git a/Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctionEnum.cs.meta b/Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctionEnum.cs.meta new file mode 100644 index 00000000..287b07ab --- /dev/null +++ b/Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctionEnum.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c426fa37e6958a84b9ee71c57afcde86 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctions.cs b/Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctions.cs new file mode 100644 index 00000000..e405301e --- /dev/null +++ b/Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctions.cs @@ -0,0 +1,20 @@ +using System.Collections; +using System.Collections.Generic; +using HnSF.Fighters; +using UnityEngine; + +namespace HnSF.Sample.TDAction +{ + public static class BaseStateFunctions + { + public static void ChangeState(IFighterBase fighter, IStateVariables variables) + { + State.ChangeState vars = (State.ChangeState)variables; + fighter.StateManager.MarkForStateChange(vars.stateID); + } + + public static void ApplyGravity(IFighterBase fighter, IStateVariables variables) + { + } + } +} \ No newline at end of file diff --git a/Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctions.cs.meta b/Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctions.cs.meta new file mode 100644 index 00000000..2b3175e6 --- /dev/null +++ b/Assets/HnSF/Samples/TDAction/Scripts/State/Functions/BaseStateFunctions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c73a2671da1f508459436b580c5227ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HnSF/Samples/TDAction/Scripts/State/StateConditionMapper.cs b/Assets/HnSF/Samples/TDAction/Scripts/State/StateConditionMapper.cs new file mode 100644 index 00000000..e3c3d197 --- /dev/null +++ b/Assets/HnSF/Samples/TDAction/Scripts/State/StateConditionMapper.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using HnSF.Fighters; + +namespace HnSF.Sample.TDAction.State +{ + public class StateConditionMapper + { + public Dictionary> functions = + new Dictionary>(); + + public StateConditionMapper() + { + functions.Add((int)ConditionFunctionEnum.NONE, BaseConditionFunctions.NoCondition); + } + + public virtual bool TryRegisterCondition(int id, Func condition) + { + if (functions.ContainsKey(id)) return false; + functions.Add(id, condition); + return true; + } + + public virtual void RegisterCondition(int id, Func condition) + { + functions.Add(id, condition); + } + + public virtual bool OverrideCondition(int id, Func condition) + { + functions[id] = condition; + return true; + } + + public virtual void RemoveCondition(int id) + { + functions.Remove(id); + } + + public virtual bool TryCondition(int id, IFighterBase cm, IConditionVariables variables) + { + return functions[id](cm, variables); + } + } +} \ No newline at end of file diff --git a/Assets/HnSF/Samples/TDAction/Scripts/State/StateConditionMapper.cs.meta b/Assets/HnSF/Samples/TDAction/Scripts/State/StateConditionMapper.cs.meta new file mode 100644 index 00000000..178ef055 --- /dev/null +++ b/Assets/HnSF/Samples/TDAction/Scripts/State/StateConditionMapper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c1759bdaa453f2242a084ed2f08c594b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HnSF/Samples/TDAction/Scripts/State/StateFunctionMapper.cs b/Assets/HnSF/Samples/TDAction/Scripts/State/StateFunctionMapper.cs new file mode 100644 index 00000000..d536f193 --- /dev/null +++ b/Assets/HnSF/Samples/TDAction/Scripts/State/StateFunctionMapper.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using HnSF.Fighters; +using UnityEngine; + +namespace HnSF.Sample.TDAction.State +{ + public class StateFunctionMapper + { + public Dictionary> functions = + new Dictionary>(); + + public StateFunctionMapper() + { + //functions.Add((int)StateFunctionEnum.APPLY_Y_FORCE, BaseStateFunctions.ApplyYForce); + functions.Add((int)StateFunctionEnum.CHANGE_STATE, BaseStateFunctions.ChangeState); + } + } +} \ No newline at end of file diff --git a/Assets/HnSF/Samples/TDAction/Scripts/State/StateFunctionMapper.cs.meta b/Assets/HnSF/Samples/TDAction/Scripts/State/StateFunctionMapper.cs.meta new file mode 100644 index 00000000..646d100b --- /dev/null +++ b/Assets/HnSF/Samples/TDAction/Scripts/State/StateFunctionMapper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e08ccc870e2e3ff478e8d994ae75ef32 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HnSF/Samples/TDAction/Scripts/State/Variables/ChangeState.cs b/Assets/HnSF/Samples/TDAction/Scripts/State/Variables/ChangeState.cs new file mode 100644 index 00000000..fade406a --- /dev/null +++ b/Assets/HnSF/Samples/TDAction/Scripts/State/Variables/ChangeState.cs @@ -0,0 +1,21 @@ +using UnityEngine; + +namespace HnSF.Sample.TDAction.State +{ + public struct ChangeState : IStateVariables + { + public int FunctionMap => (int)StateFunctionEnum.CHANGE_STATE; + public IConditionVariables Condition => condition; + public Vector2[] FrameRanges + { + get => frameRanges; + set => frameRanges = value; + } + + [SerializeField] public Vector2[] frameRanges; + [SelectImplementation(typeof(IConditionVariables))] [SerializeField, SerializeReference] + public IConditionVariables condition; + + public int stateID; + } +} \ No newline at end of file diff --git a/Assets/HnSF/Samples/TDAction/Scripts/State/Variables/ChangeState.cs.meta b/Assets/HnSF/Samples/TDAction/Scripts/State/Variables/ChangeState.cs.meta new file mode 100644 index 00000000..2063dcd3 --- /dev/null +++ b/Assets/HnSF/Samples/TDAction/Scripts/State/Variables/ChangeState.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2f1d98a657f48bd499d496fca77aecfa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/HnSF.Editor.csproj b/HnSF.Editor.csproj index 112bd13e..0b4b1104 100644 --- a/HnSF.Editor.csproj +++ b/HnSF.Editor.csproj @@ -939,12 +939,6 @@ C:\Projects\Unity\hack-and-slash-framework\Library\ScriptAssemblies\UnityEngine.UI.dll - - C:\Projects\Unity\hack-and-slash-framework\Library\ScriptAssemblies\UnityEngine.TestRunner.dll - - - C:\Projects\Unity\hack-and-slash-framework\Library\ScriptAssemblies\UnityEditor.TestRunner.dll - diff --git a/HnSF.csproj b/HnSF.csproj index a7648a19..1d1ca733 100644 --- a/HnSF.csproj +++ b/HnSF.csproj @@ -105,6 +105,13 @@ + + + + + + + diff --git a/Packages/manifest.json b/Packages/manifest.json index 929e8f09..9867e712 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -5,8 +5,7 @@ "com.unity.2d.sprite": "1.0.0", "com.unity.2d.tilemap": "1.0.0", "com.unity.cinemachine": "2.8.4", - "com.unity.ide.rider": "3.0.13", - "com.unity.ide.visualstudio": "2.0.14", + "com.unity.ide.rider": "3.0.14", "com.unity.progrids": "3.0.3-preview.6", "com.unity.render-pipelines.universal": "12.1.6", "com.unity.textmeshpro": "3.0.6", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index f9f49622..bcb375ac 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -50,7 +50,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.rider": { - "version": "3.0.13", + "version": "3.0.14", "depth": 0, "source": "registry", "dependencies": { @@ -58,15 +58,6 @@ }, "url": "https://packages.unity.com" }, - "com.unity.ide.visualstudio": { - "version": "2.0.14", - "depth": 0, - "source": "registry", - "dependencies": { - "com.unity.test-framework": "1.1.9" - }, - "url": "https://packages.unity.com" - }, "com.unity.mathematics": { "version": "1.2.5", "depth": 1, @@ -127,17 +118,6 @@ "com.unity.searcher": "4.9.1" } }, - "com.unity.test-framework": { - "version": "1.1.31", - "depth": 1, - "source": "registry", - "dependencies": { - "com.unity.ext.nunit": "1.0.6", - "com.unity.modules.imgui": "1.0.0", - "com.unity.modules.jsonserialize": "1.0.0" - }, - "url": "https://packages.unity.com" - }, "com.unity.textmeshpro": { "version": "3.0.6", "depth": 0, diff --git a/ProjectSettings/RiderScriptEditorPersistedState.asset b/ProjectSettings/RiderScriptEditorPersistedState.asset index 9230f5ac..d7c29fdd 100644 --- a/ProjectSettings/RiderScriptEditorPersistedState.asset +++ b/ProjectSettings/RiderScriptEditorPersistedState.asset @@ -12,4 +12,4 @@ MonoBehaviour: m_Script: {fileID: 0} m_Name: m_EditorClassIdentifier: Unity.Rider.Editor:Packages.Rider.Editor:RiderScriptEditorPersistedState - lastWriteTicks: -8585507721642881489 + lastWriteTicks: -8585507711600005355