Beispiel #1
0
    /// <summary>
    /// 绘制攻击定义列表
    /// </summary>
    /// <param name="clip"></param>
    public static void DrawHitDefinitionList(AIClip clip)
    {
        GUILayout.BeginHorizontal();
        GUILayout.Label("攻击定义列表:", GUILayout.Width(80));
        #region copy and paste icons
        if (GUILayout.Button(AIFGUISKin.IconCopy, GUILayout.Width(30), GUILayout.Height(30)))
        {
            if (AIDataSelection.selectedHitData != null)
            {
                CustomClipBoard.CopyData(AIDataSelection.selectedHitData);
            }
        }
        if (GUILayout.Button(AIFGUISKin.IconPaste, GUILayout.Width(30), GUILayout.Height(30)))
        {
            object clipBoardObj;
            CustomClipBoard.GetCopyObject(out clipBoardObj);
            if (clipBoardObj == null)
            {
                Debug.LogError("剪切板没有内容可以粘贴");
            }
            else
            {
                clipBoardObj = Utility.XmlDeepCloneObject(clipBoardObj);

                if (clipBoardObj is AiClipHitData)
                {
                    clip.hitCheckList.Add(clipBoardObj as AiClipHitData);
                }
            }
        }
        #endregion
        if (GUILayout.Button(AIFGUISKin.IconNewItem, GUILayout.Width(30), GUILayout.Height(30)))
        {
            clip.hitCheckList.Add(new AiClipHitData());
        }


        GUILayout.EndHorizontal();
        for (int i = 0; i < clip.hitCheckList.Count; i++)
        {
            AiClipHitData hitCheck = clip.hitCheckList[i];
            GUILayout.BeginHorizontal();
            Color col = hitCheck == AIDataSelection.selectedHitData?Color.green:GUI.color;
            if (AIFUIUtility.LayoutButtonWithColor(hitCheck.name, col, 150))
            {
                AIDataSelection.SelectedHitData(hitCheck);
                HitDataEditWnd.Open(hitCheck);
            }
            if (GUILayout.Button("X", GUILayout.Width(40)))
            {
                if (EditorUtility.DisplayDialog("tips", "确定删除攻击定义?", "OK"))
                {
                    clip.hitCheckList.Remove(hitCheck);
                    break;
                }
            }
            GUILayout.EndHorizontal();
        }
    }
Beispiel #2
0
 /// <summary>
 /// 复制选中
 /// </summary>
 public static void CopySelection()
 {
     if (selectedAiClip != null)
     {
         CustomClipBoard.CopyData(selectedAiClip);
     }
     else if (selecteClipGroup != null)
     {
         CustomClipBoard.CopyData(selecteClipGroup);
     }
     else if (selectedDataUnit != null)
     {
         CustomClipBoard.CopyData(selectedDataUnit);
     }
 }
Beispiel #3
0
    /// <summary>
    /// 绘制片断时间列表
    /// </summary>
    /// <param name="clip"></param>
    public static void DrawAiEvetList(AIClip clip)
    {
        GUILayout.BeginHorizontal();
        GUILayout.Label("事件列表", GUILayout.Width(60));
        #region copy and paste icons
        if (GUILayout.Button(AIFGUISKin.IconCopy, GUILayout.Width(30), GUILayout.Height(30)))
        {
            if (AIDataSelection.aiEvent != null)
            {
                CustomClipBoard.CopyData(AIDataSelection.aiEvent);
            }
        }
        if (GUILayout.Button(AIFGUISKin.IconPaste, GUILayout.Width(30), GUILayout.Height(30)))
        {
            object clipBoardObj;
            CustomClipBoard.GetCopyObject(out clipBoardObj);
            if (clipBoardObj == null)
            {
                Debug.LogError("剪切板没有内容可以粘贴");
            }
            else
            {
                clipBoardObj = Utility.XmlDeepCloneObject(clipBoardObj);

                if (clipBoardObj is AIClipEvent)
                {
                    clip.AiClipEvents.Add(clipBoardObj as AIClipEvent);
                }
            }
        }
        #endregion
        if (GUILayout.Button(AIFGUISKin.IconNewItem, GUILayout.Width(30), GUILayout.Height(30)))
        {
            AIEventEditWnd.OpenCreateEditor(delegate(AIClipEvent e)
            {
                clip.AiClipEvents.Add(e);
            });
        }
        GUILayout.EndHorizontal();
        if (clip.AiClipEvents.Count == 0)
        {
            GUILayout.Label("事件列表为空");
        }
        else
        {
            for (int i = 0; i < clip.AiClipEvents.Count; i++)
            {
                AIClipEvent evet = clip.AiClipEvents[i];
                GUILayout.BeginHorizontal();
                Color col = AIDataSelection.aiEvent == evet ? Color.green : GUI.color;
                if (AIFUIUtility.LayoutButtonWithColor(evet.eventName, col, 150))
                {
                    AIDataSelection.SelectedAIEvent(evet);
                    AIEventEditWnd.OpenAsEditMode(evet);
                }
                if (GUILayout.Button("X", GUILayout.Width(30)))
                {
                    if (EditorUtility.DisplayDialog("警告", "确定删除事件吗", "确定", "取消"))
                    {
                        clip.AiClipEvents.Remove(evet);
                        return;
                    }
                }
                GUILayout.EndHorizontal();
            }
        }
    }