/// <summary> /// </summary> public void OnEnable() { try { m_states = self.layers[0].stateMachine.states; } catch (System.Exception e) { Debug.Log(e.ToString()); return; } AnimationControllerHelper.DefaultStatePosition(self); }
void MenuSort() { AnimationControllerHelper.DefaultStatePosition( anmCtr ); var states = anmCtr.layers[ 0 ].stateMachine.states; System.Array.Sort( states, ( x, y ) => string.Compare( x.state.name, y.state.name ) ); Vector2 def = new Vector2( -204.0f, 72.0f ); //float posY = 0; for( int i = 0; i < states.Length; ++i ) { string name = states[ i ].state.name; //int j; //for( j = 0; j < m_matchPattern.Count; ++j ) { // var s = m_matchPattern[ j ]; // if( s == "##-" ) { // m_states[ i ].position = def; // def.y += 24; // break; // } // if( s[ 0 ] == '#' ) continue; // var mm = Regex.Matches( name, s ); // if( 0 < mm.Count ) { // m_states[ i ].position = new Vector3( m_position[ j ].x, m_position[ j ].y, 0.00f ); // break; // } //} //if( m_matchPattern.Count <= j ) { states[ i ].position = def; def.y += 36; //} } anmCtr.layers[ 0 ].stateMachine.states = states; makeClipList(); Repaint(); }