using System.Collections; using System.Collections.Generic; using UnityEngine; public class Film : MonoBehaviour { private Animator mAni; private void Start() { mAni = GetComponentInChildren(); PlayScene("0"); } public void PlayScene(string pSceneCode) { if (mAni == null) return; if (!mAni.HasState(0, Animator.StringToHash(pSceneCode)))//兼容1-1-2这种 { string tNewCode = pSceneCode.Replace("_", "-"); mAni.Play(tNewCode); } else { mAni.Play(pSceneCode); } } }