コード例 #1
0
        private void DrawSelectBtn(int index)
        {
            AnimInfoEditor info = Player.Anims[index] as AnimInfoEditor;

            if (info == null)
            {
                return;
            }
            info.SetName(index + 1);
            if (info.Target == null)
            {
                info.Target = Player;
            }
            //info.IndexID = index + 1;
            info.DrawSelectGUI();

            if (info.IsSelect == true)
            {
                if (SelectAnimInfo != null && SelectAnimInfo.IndexID != info.IndexID)
                {
                    SelectAnimInfo.IsSelect = false;
                }
                SelectAnimInfo = info;
            }
            if (info.DelayRemove == true)
            {
                RemoveAnimInfo = info;
            }
        }
コード例 #2
0
 /// <summary>
 /// 绘制动作列表
 /// </summary>
 private void DrawAnimList()
 {
     // EditorUI.DrawBox("动作列表", ListRect.width, ListRect.height + 20, Tooltip_20_UpperCenter);
     GUILayout.BeginArea(ListRect, UIStyles.SelectionRect);
     GUILayout.Label("动作列表", UIStyles.DO_18_White_UpperCenter, GUILayout.Height(20));
     GUILayout.Space(4);
     ListPos = EditorGUILayout.BeginScrollView(ListPos);
     if (Player.Anims.Count > 0)
     {
         for (int i = 0; i < Player.Anims.Count; i++)
         {
             DrawSelectBtn(i);
         }
     }
     ChangeSelect();
     GUILayout.Space(4);
     if (GUILayout.Button("+", UIStyles.WO))
     {
         AnimInfoEditor info = new AnimInfoEditor();
         info.SetName(Player.Anims.Count + 1);
         Player.Anims.Add(info);
         GetUnitStates();
     }
     EditorGUILayout.EndScrollView();
     GUILayout.EndArea();
 }
コード例 #3
0
 private void ChangeSelect()
 {
     if (RemoveAnimInfo != null)
     {
         int index = RemoveAnimInfo.IndexID - 1;
         if (Player.Anims.Count > index)
         {
             Player.Anims.RemoveAt(index);
             RemoveAnimInfo.Dispose();
         }
         RemoveAnimInfo = null;
     }
 }