示例#1
0
 void Update()
 {
     #region  中变形动画状态机
     if (Selection.objects.Length == 1 && Selection.objects[0].GetType() == typeof(MeshAnimatorController) && _MeshAnimatorController != Selection.objects[0])
     {
         _MeshAnimatorController = (MeshAnimatorController)Selection.objects[0];
         _Selected            = null;
         _SelectedLine        = -1;
         _RecordMousePosition = false;
         Focus();
     }
     #endregion
 }
    static void Create()
    {
        //创建一个新的状态机
        MeshAnimatorController meshAnimatorController = CreateInstance <MeshAnimatorController>();

        meshAnimatorController._MeshAnimationVertexNumber   = 0;
        meshAnimatorController._MeshAnimationAssets         = new List <MeshAnimationAsset>();
        meshAnimatorController._MeshAnimationAssetPosition  = new List <Vector2>();
        meshAnimatorController._MeshAnimationTransitions    = new List <Vector2>();
        meshAnimatorController._MeshAnimationTransitionType = new List <bool>();
        meshAnimatorController._MeshAnimationTransitionName = new List <string>();
        meshAnimatorController._HasExitTimes = new List <bool>();

        //创建本地文件
        string path = "Assets/New Mesh Animator Controller.asset";

        AssetDatabase.CreateAsset(meshAnimatorController, path);
    }
 public void OnEnable()
 {
     _MeshAnimatorController = (MeshAnimatorController)target;
 }