Esempio n. 1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            Inspector.DrawComObj("Config", mTarget.mConfig);

            Excel2Lua.DrawBuildButton();

            mTarget.DrawSaveButton();
        }
Esempio n. 2
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            Inspector.DrawComObj("Config", mTarget.MConfig);

            if (GUI.changed)
            {
                EditorUtility.SetDirty(mTarget);
            }
        }
Esempio n. 3
0
    public override void OnInspectorGUI()
    {
        Inspector.DrawComObj("EditorConfig", EditorConfig.Instance().MConfig);

        bool enabled = GUI.enabled;

        GUI.enabled = true;
        if (!File.Exists(assetPath))
        {
            return;
        }
        if (assetPath.IsExcel())
        {
            if (mTarget != null)
            {
                (mTarget as BookStruct).DrawInspector();
            }
        }
        else if (assetPath.IsText())
        {
            DrawText();
        }
        GUI.enabled = enabled;
    }
Esempio n. 4
0
    public void DrawInspector(int indent = 0, GUILayoutOption[] guiOpts = null)
    {
        // base.DrawInspector();
        var rect = EditorGUILayout.GetControlRect();
        var sn   = 5;
        var idx  = -1;

        if (GUI.Button(rect.Split(++idx, sn), "Save"))
        {
            Book.Write(Name);
        }

        guiOpts = new GUILayoutOption[]
        {
            GUILayout.Width(30),
            GUILayout.ExpandWidth(true),
        };
        foreach (var s in Sheets)
        {
            Inspector.DrawComObj(s.Name, s, null, () => {
                s.DrawInspector(0, guiOpts);
            });
        }

        if (GUI.changed)
        {
            if (Book is XSSFWorkbook)
            {
                XSSFFormulaEvaluator.EvaluateAllFormulaCells(Book);
            }
            else
            {
                HSSFFormulaEvaluator.EvaluateAllFormulaCells(Book);
            }
        }
    }
Esempio n. 5
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            mTarget.runInBackground = PlayerSettings.runInBackground =
                EditorGUILayout.Toggle("runInBackground", mTarget.runInBackground);

            GUILayoutOption[] guiOpts = new GUILayoutOption[]
            {
                GUILayout.Width(30),
                GUILayout.ExpandWidth(true),
            };

            mTarget.Version.Draw(0, guiOpts);


            EditorGUILayout.Space();

            // Bundles
            showBundles = EditorGUILayout.Foldout(showBundles, "AssetBundle", true);
            if (showBundles)
            {
                EditorGUILayout.LabelField("HttpRoot");
                EditorGUILayout.BeginHorizontal();
                {
                    mTarget.Ip   = EditorGUILayout.TextField(mTarget.Ip);
                    mTarget.Port = EditorGUILayout.TextField(mTarget.Port);
                }
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.Space();

                using (var verticalScope2 = new EditorGUILayout.VerticalScope("box"))
                {
                    DrawBundleConfig(guiOpts);
                    verticalScope2.Dispose();
                }
            }

            //apk ios.proj exe app etc.
            Inspector.DrawList("Channels", mTarget.Channels, ref showBuilds, false, item =>
            {
                var i = item as ChannelConfig;
                if (string.IsNullOrEmpty(i.Name))
                {
                    i.Name = i.Channel + ":" + (int)i.Channel;
                }
                i.AfterDraw();
            });

            Inspector.DrawList("Configs", mTarget.Configs, ref showConfigs, false, null);

            // Inspector.DrawList("XLuaConfig", XLuaConfigUnityEngine, ref showXLuaConfig);

            // server
            Inspector.DrawComObj("BundleServer", mTarget.BundleServer);

            mTarget.DrawSaveButton();

            if (GUI.changed)
            {
                AppLog.LogLevel = mTarget.LogLevel;
                PlayerSettings.bundleVersion = mTarget.Version.ToString();
                EditorUtility.SetDirty(mTarget);
            }
        }