Compare commits
No commits in common. "8963df6f464011580c4837ea2a8d334b7e9b3e1d" and "c8105122fbfb3b855b4a4e9214711cd0cfb83a1b" have entirely different histories.
8963df6f46
...
c8105122fb
|
@ -47,13 +47,13 @@ namespace Syntriax.Modules.Trigger
|
||||||
}
|
}
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
private State.IStateEnable _stateEnable = null;
|
private State.IStateEnable stateEnable = null;
|
||||||
public State.IStateEnable StateEnable
|
public State.IStateEnable StateEnable
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
_stateEnable = _stateEnable ?? GetComponent<State.IStateEnable>() ?? gameObject.AddComponent<State.StateEnableMonoBehaviour>();
|
stateEnable = stateEnable ?? GetComponent<State.IStateEnable>() ?? gameObject.AddComponent<State.StateEnableMonoBehaviour>();
|
||||||
return _stateEnable;
|
return stateEnable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -6,7 +6,7 @@ namespace Syntriax.Modules.Trigger
|
||||||
public interface ITrigger
|
public interface ITrigger
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <see cref="IStateEnable"/> to control the state of the <see cref="ITrigger"/> is on or off
|
/// <see cref="IStateEnable"/> to switch on or off
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IStateEnable StateEnable { get; }
|
IStateEnable StateEnable { get; }
|
||||||
|
|
||||||
|
|
|
@ -8,17 +8,17 @@ namespace Syntriax.Modules.Trigger
|
||||||
{
|
{
|
||||||
public Action<bool> OnTriggerStateChanged { get; set; } = null;
|
public Action<bool> OnTriggerStateChanged { get; set; } = null;
|
||||||
|
|
||||||
private IStateEnable _stateEnable = null;
|
private IStateEnable stateEnable = null;
|
||||||
public IStateEnable StateEnable
|
public IStateEnable StateEnable
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_stateEnable == null)
|
if (stateEnable == null)
|
||||||
{
|
{
|
||||||
_stateEnable = GetComponent<IStateEnable>() ?? gameObject.AddComponent<StateEnableMonoBehaviour>();
|
stateEnable = GetComponent<IStateEnable>() ?? gameObject.AddComponent<StateEnableMonoBehaviour>();
|
||||||
_stateEnable.OnEnabledChanged += OnEnabledChanged;
|
stateEnable.OnEnabledChanged += OnEnabledChanged;
|
||||||
}
|
}
|
||||||
return _stateEnable;
|
return stateEnable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue