mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-29 15:30:18 +00:00
cache non-aim states
This commit is contained in:
parent
abac2b54f5
commit
7294320ff0
1 changed files with 4 additions and 0 deletions
|
@ -51,6 +51,7 @@ namespace SanAndreasUnity.Behaviours
|
||||||
public StateContainer<Peds.States.BaseScriptState> StateContainer => _stateContainer;
|
public StateContainer<Peds.States.BaseScriptState> StateContainer => _stateContainer;
|
||||||
|
|
||||||
public IReadOnlyList<Peds.States.IAimState> CachedAimStates { get; private set; } = System.Array.Empty<Peds.States.IAimState>();
|
public IReadOnlyList<Peds.States.IAimState> CachedAimStates { get; private set; } = System.Array.Empty<Peds.States.IAimState>();
|
||||||
|
public IReadOnlyList<Peds.States.BaseScriptState> CachedNonAimStates { get; private set; } = System.Array.Empty<Peds.States.BaseScriptState>();
|
||||||
|
|
||||||
public Peds.States.BaseScriptState CurrentState { get { return (Peds.States.BaseScriptState) m_stateMachine.CurrentState; } }
|
public Peds.States.BaseScriptState CurrentState { get { return (Peds.States.BaseScriptState) m_stateMachine.CurrentState; } }
|
||||||
|
|
||||||
|
@ -154,6 +155,9 @@ namespace SanAndreasUnity.Behaviours
|
||||||
.GetStatesThatInherit<Peds.States.IAimState>()
|
.GetStatesThatInherit<Peds.States.IAimState>()
|
||||||
.Cast<Peds.States.IAimState>()
|
.Cast<Peds.States.IAimState>()
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
this.CachedNonAimStates = _stateContainer.States
|
||||||
|
.Where(_ => _ is not Peds.States.IAimState)
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
this.AwakeForDamage ();
|
this.AwakeForDamage ();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue