Example #1
0
        void Awake()
        {
            MonoScript ms = MonoScript.FromScriptableObject(this);
            var        m_ScriptFilePath = AssetDatabase.GetAssetPath(ms);
            var        m_ScriptFolder   = Path.GetDirectoryName(m_ScriptFilePath);

            //将skin从resources目录下移动到editor下
            if (EditorGUIUtility.isProSkin)
            {
                skin = AssetDatabase.LoadAssetAtPath <GUISkin>(m_ScriptFolder + "/UIControlDataSkinPro.guiskin");
            }
            else
            {
                skin = AssetDatabase.LoadAssetAtPath <GUISkin>(m_ScriptFolder + "/UIControlDataSkinPersonal.guiskin");
            }

            if (popupAlignLeft == null)
            {
                popupAlignLeft           = new GUIStyle("Popup");
                popupAlignLeft.alignment = TextAnchor.MiddleLeft;
            }

            allTypeNames = UIControlData.GetAllTypeNames();
            allTypes     = UIControlData.GetAllTypes();
        }
Example #2
0
        void Awake()
        {
            if (skin == null)
            {
                if (EditorGUIUtility.isProSkin)
                {
                    skin = Resources.Load("UIControlDataSkinPro") as GUISkin;
                }
                else
                {
                    skin = Resources.Load("UIControlDataSkinPersonal") as GUISkin;
                }
            }

            if (popupAlignLeft == null)
            {
                popupAlignLeft           = new GUIStyle("Popup");
                popupAlignLeft.alignment = TextAnchor.MiddleLeft;
            }

            allTypeNames = UIControlData.GetAllTypeNames();
            allTypes     = UIControlData.GetAllTypes();
        }