- Movement & Controller
- Special Actions
- ToggleState
- ColliderChecker
- and 2D Implementations
This commit is contained in:
2022-03-08 10:13:27 +03:00
parent 91839d2323
commit f0ffc2a8c4
81 changed files with 419 additions and 751 deletions

10
State/IToggleState.cs Normal file
View File

@@ -0,0 +1,10 @@
using UnityEngine.Events;
namespace Syntriax.Modules.Movement.State
{
public interface IToggleState
{
bool Toggled { get; set; }
UnityEvent<bool> OnToggleStateChanged { get; }
}
}

View File

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

View File

@@ -0,0 +1,25 @@
using UnityEngine.Events;
namespace Syntriax.Modules.Movement.State
{
public class MemberToggleState : IToggleState
{
private bool _enabled = true;
public bool Toggled
{
get => _enabled;
set
{
bool isNewValue = _enabled != value;
_enabled = value;
if (isNewValue)
OnToggleStateChanged.Invoke(value);
}
}
public UnityEvent<bool> OnToggleStateChanged { get; protected set; } = new UnityEvent<bool>();
}
}

View File

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

25
State/ToggleState.cs Normal file
View File

@@ -0,0 +1,25 @@
using UnityEngine;
using UnityEngine.Events;
namespace Syntriax.Modules.Movement.State
{
public class ToggleState : MonoBehaviour, IToggleState
{
private bool _enabled = true;
public bool Toggled
{
get => _enabled;
set
{
bool isNewValue = _enabled != value;
_enabled = value;
if (isNewValue)
OnToggleStateChanged.Invoke(value);
}
}
public UnityEvent<bool> OnToggleStateChanged { get; protected set; } = new UnityEvent<bool>();
}
}

11
State/ToggleState.cs.meta Normal file
View File

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