private void UpdateStates(float deltaTime)
            {
                bool  mustUpdateWeights = false;
                float totalWeight       = 0f;
                int   count             = m_States.Count;

                for (int i = 0; i < count; i++)
                {
                    StateInfo state = m_States[i];
                    if (state == null)
                    {
                        continue;
                    }

                    state.InvalidateTime();

                    // 处理混合树状态
                    if (state.isBlendTree)
                    {
                        bool  isChangeParam = false;
                        float lastParam     = 0;
                        float param         = m_Params.GetFloat(state.blendTreeParameter);
                        isChangeParam = !_lastParamValue.TryGetValue(state.blendTreeParameter, out lastParam);
                        if (!isChangeParam)
                        {
                            isChangeParam = lastParam != param;
                        }
                        if (isChangeParam)
                        {
                            state.CalBlendTreeWeight(param);
                            _lastParamValue[state.blendTreeParameter] = param;
                        }
                    }

                    // 处理状态过渡 设置权重
                    if (state.fading)
                    {
                        state.SetWeight(Mathf.MoveTowards(state.weight, state.targetWeight, state.fadeSpeed * deltaTime));
                        if (Mathf.Approximately(state.weight, state.targetWeight))
                        {
                            state.ForceWeight(state.targetWeight);
                            if (state.weight == 0f)
                            {
                                state.Stop();
                            }
                        }
                    }

                    // 处理状态开关
                    if (state.enabledDirty)
                    {
                        if (state.enabled)
                        {
                            state.Play();
                        }
                        else
                        {
                            state.Pause();
                        }


                        Playable input = m_Mixer.GetInput(i);
                        //if state is disabled but the corresponding input is connected, disconnect it
                        if (input.IsValid() && !state.enabled)
                        {
                            DisconnectInput(i);
                        }
                        else if (state.enabled && !input.IsValid())
                        {
                            ConnectInput(state.index);
                        }
                    }

                    // 处理非循环状态的自然关闭
                    if (state.enabled && state.wrapMode == WrapMode.Once)
                    {
                        bool  stateIsDone = state.isDone;
                        float speed       = state.speed;
                        float time        = state.GetTime();
                        float duration    = state.playableDuration;

                        stateIsDone |= speed < 0f && time < 0f;
                        stateIsDone |= speed >= 0f && time >= duration;
                        if (stateIsDone)
                        {
                            state.Stop();
                            state.Disable();
                            DisconnectInput(state.index);
                        }
                    }

                    totalWeight += state.weight;
                    if (state.weightDirty)
                    {
                        mustUpdateWeights = true;
                    }
                    state.ResetDirtyFlags();
                }

                // 有状态权重变化 更改playable权重
                if (mustUpdateWeights)
                {
                    bool hasAnyWeight = totalWeight > 0.0f;
                    for (int i = 0; i < m_States.Count; i++)
                    {
                        StateInfo state  = m_States[i];
                        float     weight = hasAnyWeight ? state.weight / totalWeight : 0.0f;
                        m_Mixer.SetInputWeight(state.index, weight);
                    }
                }
            }