From e95462af00206651dbf013de3ade4906484bb0a0 Mon Sep 17 00:00:00 2001 From: Syntriax Date: Sat, 17 Dec 2022 11:59:08 +0300 Subject: [PATCH 1/2] Changed Some Fields --- Runtime/IMovementController.cs | 4 ++-- Runtime/Implementations/AirMovement1D.cs | 2 +- Runtime/Implementations/GroundMovement1D.cs | 2 +- Runtime/MovementController.cs | 6 +++--- package.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Runtime/IMovementController.cs b/Runtime/IMovementController.cs index 28bf228..d72295b 100644 --- a/Runtime/IMovementController.cs +++ b/Runtime/IMovementController.cs @@ -7,9 +7,9 @@ namespace Syntriax.Modules.Movement public interface IMovementController { /// - /// Member Toggle State + /// Member to switch on or off /// - IToggleState ToggleState { get; } + IToggleState ToggleStateMember { get; } /// /// Currently active diff --git a/Runtime/Implementations/AirMovement1D.cs b/Runtime/Implementations/AirMovement1D.cs index 155e6b5..cde4d06 100644 --- a/Runtime/Implementations/AirMovement1D.cs +++ b/Runtime/Implementations/AirMovement1D.cs @@ -19,7 +19,7 @@ namespace Syntriax.Modules.Movement.Implementations if (groundTrigger != null) { - groundTrigger.OnTriggered += OnGroundTrigger; + groundTrigger.OnTriggerStateChanged += OnGroundTrigger; CanTakeOver = false; } } diff --git a/Runtime/Implementations/GroundMovement1D.cs b/Runtime/Implementations/GroundMovement1D.cs index 5271430..776d983 100644 --- a/Runtime/Implementations/GroundMovement1D.cs +++ b/Runtime/Implementations/GroundMovement1D.cs @@ -21,7 +21,7 @@ namespace Syntriax.Modules.Movement.Implementations if (groundTrigger != null) { - groundTrigger.OnTriggered += OnGroundTrigger; + groundTrigger.OnTriggerStateChanged += OnGroundTrigger; CanTakeOver = false; } } diff --git a/Runtime/MovementController.cs b/Runtime/MovementController.cs index f2c4cae..6ab402d 100644 --- a/Runtime/MovementController.cs +++ b/Runtime/MovementController.cs @@ -31,11 +31,11 @@ namespace Syntriax.Modules.Movement } } - private bool areBothToggleStatesToggled => ToggleState.IsToggledNullChecked() && toggleStateOnGameObject.IsToggledNullChecked(); + private bool areBothToggleStatesToggled => ToggleStateMember.IsToggledNullChecked() && toggleStateOnGameObject.IsToggledNullChecked(); public List Movements { get; protected set; } = new List(32); - public IToggleState ToggleState { get; protected set; } = new ToggleStateMember(true); + public IToggleState ToggleStateMember { get; protected set; } = new ToggleStateMember(true); protected IToggleState toggleStateOnGameObject = null; @@ -48,7 +48,7 @@ namespace Syntriax.Modules.Movement toggleStateOnGameObject = GetComponent(); toggleStateOnGameObject.OnToggleStateChanged += (_) => InvokeOnMoveAction(); - ToggleState.OnToggleStateChanged += (_) => InvokeOnMoveAction(); + ToggleStateMember.OnToggleStateChanged += (_) => InvokeOnMoveAction(); } protected virtual void FixedUpdate() diff --git a/package.json b/package.json index a01f5ba..d13f671 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.syntriax.movement", - "version": "0.1.2", + "version": "0.1.3", "displayName": "Movement Module", "description": "Dependends On:\nhttps://git.syntriax.com/Syntriax/ToggleState.git\nhttps://git.syntriax.com/Syntriax/Trigger.git\nhttps://git.syntriax.com/Syntriax/Factory.git", "unity": "2019.1", From c244ddeb984592f30e45061506a59d469eef48cc Mon Sep 17 00:00:00 2001 From: Syntriax Date: Sat, 17 Dec 2022 12:04:14 +0300 Subject: [PATCH 2/2] Moved few Implemantations to Samples Folder --- Editor/DefinitionCreatorEditor.cs | 6 +++--- .../Syntriax.Modules.Movement.Editor.asmdef | 3 ++- .../{Implementations => }/DefaultMovement.cs | 5 ++++- .../DefaultMovement.cs.meta | 0 Runtime/MovementController.cs | 4 ++-- Runtime/Implementations.meta => Samples.meta | 2 +- .../AirMovement1D.cs | 2 +- .../AirMovement1D.cs.meta | 0 .../GroundMovement1D.cs | 2 +- .../GroundMovement1D.cs.meta | 0 .../Syntriax.Modules.Movement.Samples.asmdef | 19 +++++++++++++++++++ ...triax.Modules.Movement.Samples.asmdef.meta | 7 +++++++ package.json | 2 +- 13 files changed, 41 insertions(+), 11 deletions(-) rename Runtime/{Implementations => }/DefaultMovement.cs (71%) rename Runtime/{Implementations => }/DefaultMovement.cs.meta (100%) rename Runtime/Implementations.meta => Samples.meta (77%) rename {Runtime/Implementations => Samples}/AirMovement1D.cs (96%) rename {Runtime/Implementations => Samples}/AirMovement1D.cs.meta (100%) rename {Runtime/Implementations => Samples}/GroundMovement1D.cs (95%) rename {Runtime/Implementations => Samples}/GroundMovement1D.cs.meta (100%) create mode 100644 Samples/Syntriax.Modules.Movement.Samples.asmdef create mode 100644 Samples/Syntriax.Modules.Movement.Samples.asmdef.meta diff --git a/Editor/DefinitionCreatorEditor.cs b/Editor/DefinitionCreatorEditor.cs index 6238c2a..f1257a5 100644 --- a/Editor/DefinitionCreatorEditor.cs +++ b/Editor/DefinitionCreatorEditor.cs @@ -75,7 +75,7 @@ namespace Syntriax.Modules.Movement.Editor movementDefinition.MovementConfigs = new MovementConfig[] { - new MovementConfig(typeof(Implementations.GroundMovement1D).FullName, 5f) + new MovementConfig(typeof(Samples.GroundMovement1D).FullName, 5f) }; movementDefinition.MonoBehaviours = new string[] @@ -92,8 +92,8 @@ namespace Syntriax.Modules.Movement.Editor movementDefinition.MovementConfigs = new MovementConfig[] { - new MovementConfig(typeof(Implementations.AirMovement1D).FullName, 5f), - new MovementConfig(typeof(Implementations.GroundMovement1D).FullName, 5f) + new MovementConfig(typeof(Samples.AirMovement1D).FullName, 5f), + new MovementConfig(typeof(Samples.GroundMovement1D).FullName, 5f) }; movementDefinition.MonoBehaviours = new string[] diff --git a/Editor/Syntriax.Modules.Movement.Editor.asmdef b/Editor/Syntriax.Modules.Movement.Editor.asmdef index 8844535..80c2cb2 100644 --- a/Editor/Syntriax.Modules.Movement.Editor.asmdef +++ b/Editor/Syntriax.Modules.Movement.Editor.asmdef @@ -4,7 +4,8 @@ "references": [ "GUID:d4c952ed5f59c5a449cda1b0080ed841", "GUID:efa9a9bc94c60c74684aafb7428fbf61", - "GUID:c967acc4be781ca44b42a1887eb1ac7a" + "GUID:c967acc4be781ca44b42a1887eb1ac7a", + "GUID:863b8995abde2cf40b8b4cb709452a32" ], "includePlatforms": [ "Editor" diff --git a/Runtime/Implementations/DefaultMovement.cs b/Runtime/DefaultMovement.cs similarity index 71% rename from Runtime/Implementations/DefaultMovement.cs rename to Runtime/DefaultMovement.cs index 07ee97b..3fac37c 100644 --- a/Runtime/Implementations/DefaultMovement.cs +++ b/Runtime/DefaultMovement.cs @@ -1,7 +1,10 @@ using UnityEngine; -namespace Syntriax.Modules.Movement.Implementations +namespace Syntriax.Modules.Movement { + /// + /// A /> + /// public class DefaultMovement : MovementBase { public override void ApplyMovement() { } diff --git a/Runtime/Implementations/DefaultMovement.cs.meta b/Runtime/DefaultMovement.cs.meta similarity index 100% rename from Runtime/Implementations/DefaultMovement.cs.meta rename to Runtime/DefaultMovement.cs.meta diff --git a/Runtime/MovementController.cs b/Runtime/MovementController.cs index 6ab402d..729247e 100644 --- a/Runtime/MovementController.cs +++ b/Runtime/MovementController.cs @@ -41,8 +41,8 @@ namespace Syntriax.Modules.Movement protected virtual void Start() { - if (GetComponent() == null) - gameObject.AddComponent(); + if (GetComponent() == null) + gameObject.AddComponent(); RecacheMovements(); toggleStateOnGameObject = GetComponent(); diff --git a/Runtime/Implementations.meta b/Samples.meta similarity index 77% rename from Runtime/Implementations.meta rename to Samples.meta index c14cbc9..f01ab38 100644 --- a/Runtime/Implementations.meta +++ b/Samples.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 15528ebd51d27d54398c55826710f23e +guid: 231b2d16dd7862d41bc2111d759f6ca2 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/Implementations/AirMovement1D.cs b/Samples/AirMovement1D.cs similarity index 96% rename from Runtime/Implementations/AirMovement1D.cs rename to Samples/AirMovement1D.cs index cde4d06..b7345b1 100644 --- a/Runtime/Implementations/AirMovement1D.cs +++ b/Samples/AirMovement1D.cs @@ -1,7 +1,7 @@ using Syntriax.Modules.Trigger; using UnityEngine; -namespace Syntriax.Modules.Movement.Implementations +namespace Syntriax.Modules.Movement.Samples { [RequireComponent(typeof(Rigidbody2D))] public class AirMovement1D : MovementBase1D diff --git a/Runtime/Implementations/AirMovement1D.cs.meta b/Samples/AirMovement1D.cs.meta similarity index 100% rename from Runtime/Implementations/AirMovement1D.cs.meta rename to Samples/AirMovement1D.cs.meta diff --git a/Runtime/Implementations/GroundMovement1D.cs b/Samples/GroundMovement1D.cs similarity index 95% rename from Runtime/Implementations/GroundMovement1D.cs rename to Samples/GroundMovement1D.cs index 776d983..6f29b2b 100644 --- a/Runtime/Implementations/GroundMovement1D.cs +++ b/Samples/GroundMovement1D.cs @@ -1,7 +1,7 @@ using Syntriax.Modules.Trigger; using UnityEngine; -namespace Syntriax.Modules.Movement.Implementations +namespace Syntriax.Modules.Movement.Samples { [RequireComponent(typeof(Rigidbody2D))] public class GroundMovement1D : MovementBase1D diff --git a/Runtime/Implementations/GroundMovement1D.cs.meta b/Samples/GroundMovement1D.cs.meta similarity index 100% rename from Runtime/Implementations/GroundMovement1D.cs.meta rename to Samples/GroundMovement1D.cs.meta diff --git a/Samples/Syntriax.Modules.Movement.Samples.asmdef b/Samples/Syntriax.Modules.Movement.Samples.asmdef new file mode 100644 index 0000000..fd66084 --- /dev/null +++ b/Samples/Syntriax.Modules.Movement.Samples.asmdef @@ -0,0 +1,19 @@ +{ + "name": "Syntriax.Modules.Movement.Samples", + "rootNamespace": "", + "references": [ + "GUID:efa9a9bc94c60c74684aafb7428fbf61", + "GUID:1f5f15fe7e49bdb48a76c5ce9b1c9f2f", + "GUID:d4c952ed5f59c5a449cda1b0080ed841", + "GUID:c967acc4be781ca44b42a1887eb1ac7a" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Samples/Syntriax.Modules.Movement.Samples.asmdef.meta b/Samples/Syntriax.Modules.Movement.Samples.asmdef.meta new file mode 100644 index 0000000..8551f8b --- /dev/null +++ b/Samples/Syntriax.Modules.Movement.Samples.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 863b8995abde2cf40b8b4cb709452a32 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json index d13f671..887d512 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.syntriax.movement", - "version": "0.1.3", + "version": "0.1.4", "displayName": "Movement Module", "description": "Dependends On:\nhttps://git.syntriax.com/Syntriax/ToggleState.git\nhttps://git.syntriax.com/Syntriax/Trigger.git\nhttps://git.syntriax.com/Syntriax/Factory.git", "unity": "2019.1",