void UIManagerGUI()
    {
        EditorGUI.indentLevel = 0;
        isFoldUImanager       = EditorGUILayout.Foldout(isFoldUImanager, "UIManager:");
        if (isFoldUImanager)
        {
            EditorGUI.indentLevel = 1;
            m_referenceResolution = EditorGUILayout.Vector2Field("参考分辨率", m_referenceResolution);
            m_isOnlyUICamera      = EditorGUILayout.Toggle("只有一个UI摄像机", m_isOnlyUICamera);
            m_isVertical          = EditorGUILayout.Toggle("是否竖屏", m_isVertical);

            if (GUILayout.Button("创建UIManager"))
            {
                UICreateService.CreatUIManager(m_referenceResolution, m_MatchMode, m_isOnlyUICamera, m_isVertical);
            }
        }
    }
 public static void CreateGuideSystemWidnow()
 {
     if (GetGuideIsInit())
     {
         if (!GetGuideIsCreate())
         {
             //创建预设
             UICreateService.CreateGuideWindow();
         }
         else
         {
             Debug.LogError("新手引导预设已经创建");
         }
     }
     else
     {
         Debug.LogError("新手引导没有初始化");
     }
 }
Пример #3
0
    void CreateUIGUI()
    {
        EditorGUI.indentLevel = 0;
        isFoldCreateUI        = EditorGUILayout.Foldout(isFoldCreateUI, "创建UI:");

        if (isFoldCreateUI)
        {
            EditorGUI.indentLevel = 1;
            EditorGUILayout.LabelField("提示: 脚本和 UI 名称会自动添加Window后缀");
            m_uiName = EditorGUILayout.TextField("UI Name:", m_uiName);
            m_UIType = (UIType)EditorGUILayout.EnumPopup("UI Type:", m_UIType);

            isAutoCreatePrefab = EditorGUILayout.Toggle("自动生成 Prefab", isAutoCreatePrefab);

            var l_nameTmp = m_uiName + "Window";
            if (!string.IsNullOrEmpty(m_uiName))
            {
                var l_typeTmp = EditorTool.GetType(l_nameTmp);
                if (l_typeTmp != null)
                {
                    if (l_typeTmp.BaseType.Equals(typeof(UIWindowBase)))
                    {
                        if (GUILayout.Button("创建UI"))
                        {
                            UICreateService.CreatUI(l_nameTmp, m_UIType, m_UILayerManager, isAutoCreatePrefab);
                            m_uiName = "";
                        }
                    }
                    else
                    {
                        EditorGUILayout.LabelField("该类没有继承UIWindowBase");
                    }
                }
                else
                {
                    if (GUILayout.Button("创建UI脚本"))
                    {
                        UICreateService.CreatUIScript(l_nameTmp);
                    }
                }
            }
        }
    }
Пример #4
0
    void CreateUICameraGUI()
    {
        isCreateUICamera = EditorGUILayout.Foldout(isCreateUICamera, "CreateUICamera:");
        if (isCreateUICamera)
        {
            EditorGUI.indentLevel = 2;
            cameraKey             = EditorGUILayout.TextField("Camera Key", cameraKey);
            cameraDepth           = EditorGUILayout.FloatField("Camera Depth", cameraDepth);

            if (cameraKey != "")
            {
                if (GUILayout.Button("CreateUICamera"))
                {
                    UICreateService.CreateUICamera(m_UIManager, cameraKey, cameraDepth, m_referenceResolution, m_MatchMode, m_isOnlyUICamera, m_isVertical);
                    cameraKey = "";
                }
            }
            else
            {
                EditorGUILayout.LabelField("Camera Key 不能为空");
            }
        }
    }
Пример #5
0
    void CreateUIGUI()
    {
        EditorGUI.indentLevel = 0;
        isFoldCreateUI        = EditorGUILayout.Foldout(isFoldCreateUI, "创建UI:");

        if (isFoldCreateUI)
        {
            cameraKeyList = UIManager.GetCameraNames();

            EditorGUI.indentLevel = 1;
            EditorGUILayout.LabelField("提示: 脚本和 UI 名称会自动添加Window后缀");
            m_UIname = EditorGUILayout.TextField("UI Name:", m_UIname);

            m_UICameraKeyIndex = EditorGUILayout.Popup("Camera", m_UICameraKeyIndex, cameraKeyList);

            m_UIType = (UIType)EditorGUILayout.EnumPopup("UI Type:", m_UIType);

            isUseLua = EditorGUILayout.Toggle("使用 Lua", isUseLua);
            if (isUseLua)
            {
                EditorGUI.indentLevel++;
                isAutoCreateLuaFile = EditorGUILayout.Toggle("自动创建Lua脚本", isAutoCreateLuaFile);
                EditorGUI.indentLevel--;
            }

            isAutoCreatePrefab = EditorGUILayout.Toggle("自动生成 Prefab", isAutoCreatePrefab);

            if (m_UIname != "")
            {
                string l_nameTmp = m_UIname + "Window";

                if (!isUseLua)
                {
                    Type l_typeTmp = EditorTool.GetType(l_nameTmp);
                    if (l_typeTmp != null)
                    {
                        if (l_typeTmp.BaseType.Equals(typeof(UIWindowBase)))
                        {
                            if (GUILayout.Button("创建UI"))
                            {
                                UICreateService.CreatUI(l_nameTmp, cameraKeyList[m_UICameraKeyIndex], m_UIType, m_UILayerManager, isAutoCreatePrefab);
                                m_UIname = "";
                            }
                        }
                        else
                        {
                            EditorGUILayout.LabelField("该类没有继承UIWindowBase");
                        }
                    }
                    else
                    {
                        if (GUILayout.Button("创建UI脚本"))
                        {
                            UICreateService.CreatUIScript(l_nameTmp);
                        }
                    }
                }
                else
                {
                    if (GUILayout.Button("创建UI"))
                    {
                        UICreateService.CreatUIbyLua(l_nameTmp, m_UIType, m_UILayerManager, isAutoCreatePrefab);
                        if (isAutoCreateLuaFile)
                        {
                            UICreateService.CreatUILuaScript(l_nameTmp);
                        }

                        m_UIname = "";
                    }
                }
            }
        }
    }