Moved Files from Movement Module

This commit is contained in:
Syntriax 2022-11-14 12:55:53 +03:00
parent d654544667
commit fefaf7ab39
7 changed files with 99 additions and 0 deletions

10
IToggleState.cs Normal file
View File

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

11
IToggleState.cs.meta Normal file
View File

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

24
MemberToggleState.cs Normal file
View File

@ -0,0 +1,24 @@
using System;
namespace Syntriax.Modules.Movement.State
{
public class MemberToggleState : IToggleState
{
private bool _toggled = true;
public bool Toggled
{
get => _toggled;
set
{
bool oldValue = _toggled;
_toggled = value;
if (oldValue = !value)
OnToggleStateChanged?.Invoke(value);
}
}
public Action<bool> OnToggleStateChanged { get; set; } = null;
}
}

11
MemberToggleState.cs.meta Normal file
View File

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

7
README.md.meta Normal file
View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a21f9cba390715748b464c9228237ed1
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

25
ToggleState.cs Normal file
View File

@ -0,0 +1,25 @@
using System;
using UnityEngine;
namespace Syntriax.Modules.Movement.State
{
public class ToggleState : MonoBehaviour, IToggleState
{
private bool _toggled = true;
public bool Toggled
{
get => _toggled;
set
{
bool oldValue = _toggled;
_toggled = value;
if (oldValue = !value)
OnToggleStateChanged?.Invoke(value);
}
}
public Action<bool> OnToggleStateChanged { get; set; } = null;
}
}

11
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: