public void ResolveCodeOrState(StatesInfo statesInfo) { if (codeOrStateResolved) { return; } string code_str = code.AsString().Trim().Replace(" ", ""); if (PopState == code_str) { targetState = PopState; code = null; } else { string state = statesInfo.StateNames.SingleOrDefault(it => pushState + it == code_str); if (state != null) { targetState = state; code = null; } } codeOrStateResolved = true; }
public override void UpdateThis() { base.UpdateThis(); StateInfo = new StatesInfo(anim.GetCurrentAnimatorStateInfo(0)); StateInfo.GetStatesInfo(this); ShootingObject.GetJsonData(); }
private static void WriteStates <TObject, TId>(string header, StatesInfo <TObject, TId> info) { Console.WriteLine(header); foreach (var state in info.SetStates) { Console.WriteLine(state.Id); } }
public static bool AnySiblingStates <TObject, TId>(this StatesInfo <TObject, TId> statesInfo) { return(statesInfo.SetStates .GroupBy(s => s.Parent) .Any(g => g.Count() > 1)); }
public static bool NoStates <TObject, TId>(this StatesInfo <TObject, TId> statesInfo) { return(!statesInfo.SetStates.Any()); }