bool ContainsState(AlmenaraGames.MLPASAnimatorSFX state, out ValuesOverride valuesOverride) { if (newValues.Exists(x => x.stateName == state.runtimeStateName && x.layer == state.transitionLayer)) { valuesOverride = newValues.Find(x => x.stateName == state.runtimeStateName && x.layer == state.transitionLayer); return(true); } valuesOverride = null; return(false); }
bool ContainsStateEditor(AlmenaraGames.MLPASAnimatorSFX state, out ValuesOverride valuesOverride) { UnityEditor.Animations.StateMachineBehaviourContext[] context = UnityEditor.Animations.AnimatorController.FindStateMachineBehaviourContext(state); UnityEditor.Animations.AnimatorState cState = (context[0].animatorObject as UnityEditor.Animations.AnimatorState); UnityEditor.Animations.AnimatorStateMachine cStateMachine = (context[0].animatorObject as UnityEditor.Animations.AnimatorStateMachine); string stateName = cState != null ? cState.name : cStateMachine.name; int layer = context[0].layerIndex; if ((obj.targetObject as MLPASAnimatorSFXController).newValues.Exists(x => x.stateName == stateName && x.layer == layer)) { valuesOverride = (obj.targetObject as MLPASAnimatorSFXController).newValues.Find(x => x.stateName == stateName && x.layer == layer); return(true); } valuesOverride = null; return(false); }