Ejemplo n.º 1
0
        public override void DrawProperties()
        {
            Sprite2D obj = target as Sprite2D;

            //スプライト
            UtageEditorToolKit.BeginGroup("Sprite");
            UtageEditorToolKit.PropertyField(serializedObject, "sprite", "Sprite");
            UtageEditorToolKit.PropertyField(serializedObject, "sizeType", "Type");

            bool isCustomSize = obj.SizeType != Sprite2D.SpriteSizeType.Default;

            if (isCustomSize)
            {
                EditorGUILayout.BeginHorizontal();
                UtageEditorToolKit.PropertyField(serializedObject, "customSize", "Size");
                if (GUILayout.Button("Reset", GUILayout.Width(50f)))
                {
                    Undo.RecordObject(obj, "isCustomSize Change");
                    obj.Size = obj.BaseSize;
                    EditorUtility.SetDirty(target);
                }
                EditorGUILayout.EndHorizontal();
            }

            EditorGUILayout.LabelField("Texture Size", obj.BaseSize.x + " x " + obj.BaseSize.y);

            UtageEditorToolKit.EndGroup();

            DrawNode2DProperties();
        }
Ejemplo n.º 2
0
 //グループ開始
 public void BeginGroup(string groupName)
 {
     if (!string.IsNullOrEmpty(groupName))
     {
         UtageEditorToolKit.BeginGroup(groupName);
     }
 }
Ejemplo n.º 3
0
        void DrawProperties()
        {
            UguiLetterBoxCamera obj = target as UguiLetterBoxCamera;

            UtageEditorToolKit.PropertyField(serializedObject, "pixelsToUnits", "Pixels To Units");
            if (obj.PixelsToUnits < 1)
            {
                obj.PixelsToUnits = 1;
            }

            //基本画面サイズ
            UtageEditorToolKit.PropertyField(serializedObject, "width", "Game Screen Width");
            if (obj.Width < 1)
            {
                obj.Width = 1;
            }
            UtageEditorToolKit.PropertyField(serializedObject, "height", "Game Screen Height");
            if (obj.Height < 1)
            {
                obj.Height = 1;
            }

            //基本画面サイズ
            UtageEditorToolKit.BeginGroup("Flexible", serializedObject, "isFlexible");
            if (obj.IsFlexible)
            {
                GUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Wide  ", GUILayout.Width(50));
                UtageEditorToolKit.PropertyField(serializedObject, "maxWidth", "", GUILayout.Width(50));
                if (obj.MaxWidth < obj.Width)
                {
                    obj.MaxWidth = obj.Width;
                }
                EditorGUILayout.LabelField(" x " + obj.Height, GUILayout.Width(50));
//				UtageEditorToolKit.PropertyField(serializedObject, "minHeight", "Height");
//				obj.MinHeight = Mathf.Clamp(obj.MinHeight, 1, obj.Height);
                GUILayout.EndHorizontal();

                GUILayout.Space(4f);
                GUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Nallow  ", GUILayout.Width(50));
//				UtageEditorToolKit.PropertyField(serializedObject, "minWidth", "Width");
//				obj.MinWidth = Mathf.Clamp(obj.MinWidth, 1, obj.Width);
                EditorGUILayout.LabelField("" + obj.Width + " x ", GUILayout.Width(50));

                UtageEditorToolKit.PropertyField(serializedObject, "maxHeight", "", GUILayout.Width(50));
                if (obj.MaxHeight < obj.Height)
                {
                    obj.MaxHeight = obj.Height;
                }
                GUILayout.EndHorizontal();
            }
            UtageEditorToolKit.EndGroup();

            EditorGUILayout.LabelField("Current Size = " + obj.CurrentWidth + " x " + obj.CurrentHeight);

            UtageEditorToolKit.PropertyField(serializedObject, "anchor", "Anchor");
        }
        void DrawProject()
        {
            SerializedObject serializedObject = new SerializedObject(ProjectData);

            serializedObject.Update();

            UtageEditorToolKit.BeginGroup("Import Files");
            UtageEditorToolKit.PropertyFieldArray(serializedObject, "excelList", "Excel List");
            UtageEditorToolKit.EndGroup();

            GUILayout.Space(8f);

            EditorGUI.BeginDisabledGroup(!ProjectData.IsEnableImport);
            if (GUILayout.Button("Import", GUILayout.Width(180)))
            {
                Import();
            }
            EditorGUI.EndDisabledGroup();

            GUILayout.Space(8f);

            UtageEditorToolKit.BeginGroup("Covert Setting");

            EditorGUILayout.BeginHorizontal();
            UtageEditorToolKit.PropertyField(serializedObject, "convertPath", "Output directory");
            if (GUILayout.Button("Select", GUILayout.Width(100)))
            {
                string convertPath = ProjectData.ConvertPath;
                string dir         = string.IsNullOrEmpty(convertPath) ? "" : Path.GetDirectoryName(convertPath);
                string name        = string.IsNullOrEmpty(convertPath) ? "" : Path.GetFileName(convertPath);
                string path        = EditorUtility.SaveFolderPanel("Select folder to output", dir, name);
                Debug.Log(path);
                if (!string.IsNullOrEmpty(path))
                {
                    ProjectData.ConvertPath = path;
                }
            }
            EditorGUILayout.EndHorizontal();

            UtageEditorToolKit.PropertyField(serializedObject, "convertVersion", "Version");

            UtageEditorToolKit.PropertyField(serializedObject, "isAutoUpdateVersionAfterConvert", "Auto Update Version");


            UtageEditorToolKit.EndGroup();
            GUILayout.Space(4f);

            EditorGUI.BeginDisabledGroup(!ProjectData.IsEnableConvert);
            UtageEditorToolKit.PropertyField(serializedObject, "isAutoConvertOnImport", "Auto Convert OnImport");
            if (GUILayout.Button("Convert", GUILayout.Width(180)))
            {
                Convert();
            }
            EditorGUI.EndDisabledGroup();


            serializedObject.ApplyModifiedProperties();
        }
Ejemplo n.º 5
0
        //Settingsプロパティの描画
        void DrawAssetFileManagerSettingsProperty(SerializedProperty property)
        {
            property = property.Copy();
            string rootPath = property.propertyPath + ".";

            UtageEditorToolKit.BeginGroup("Load Setting");

            SerializedObjectHelper.DrawProperty(rootPath + "loadType");

            //タブの表示
            List <string> tabName = new List <string>();

            foreach (AssetFileSetting setting in Settings.FileSettings)
            {
                tabName.Add(setting.FileType.ToString());
            }
            tabIndex = GUILayout.Toolbar(tabIndex, tabName.ToArray(), EditorStyles.toolbarButton);

            //タブの中身の表示

            string           arrayRootPath  = rootPath + "fileSettings." + string.Format("Array.data[{0}]", tabIndex) + ".";
            bool             isAdVanced     = Settings.LoadTypeSetting == AssetFileManagerSettings.LoadType.Advanced;
            AssetFileSetting currentSetting = Settings.FileSettings[tabIndex];

            GUILayout.Space(-5f);
            EditorGUILayout.BeginVertical("box");
            EditorGUI.indentLevel++;
            {
                GUILayout.Space(4f);
                GUILayout.BeginHorizontal();
                EditorGUILayout.BeginVertical();

                //AdVanced以外では編集不可
                if (isAdVanced)
                {
                    SerializedObjectHelper.DrawProperty(arrayRootPath + "isStreamingAssets");
                    SerializedObjectHelper.DrawProperty(arrayRootPath + "encodeType");
                }
                else
                {
                    EditorGUI.BeginDisabledGroup(true);
                    EditorGUILayout.Toggle("IsStreamingAssets", currentSetting.IsStreamingAssets);
                    EditorGUILayout.LabelField("EncodeType", currentSetting.EncodeType.ToString());
                    EditorGUI.EndDisabledGroup();
                }
                SerializedObjectHelper.DrawProperty(arrayRootPath + "extensions");
            }
            EditorGUI.indentLevel--;
            UtageEditorToolKit.EndGroup();


            UtageEditorToolKit.EndGroup();
        }
Ejemplo n.º 6
0
        void OnGUI()
        {
            UtageEditorToolKit.BeginGroup("Create New Project");
            GUIStyle style = new GUIStyle();

            GUILayout.Space(4f);
            GUILayout.Label("<b>" + "Input New Project Name" + "</b>", style, GUILayout.Width(80f));
            newProjectName = GUILayout.TextField(newProjectName);

            GUILayout.Space(4f);
            GUILayout.Label("<b>" + "Select Create Type" + "</b>", style, GUILayout.Width(80f));
            Type type = (Type)EditorGUILayout.EnumPopup("Type", createType);

            if (createType != type)
            {
                createType = type;
            }
            UtageEditorToolKit.EndGroup();

            bool isGameSizeEnable = (createType != Type.CreateScenarioAssetOnly);

            EditorGUI.BeginDisabledGroup(!isGameSizeEnable);
            GUILayout.Space(4f);
            UtageEditorToolKit.BeginGroup("Game Screen Size");
            int width = EditorGUILayout.IntField("Width", gameScreenWidth);

            if (gameScreenWidth != width && width > 0)
            {
                gameScreenWidth = width;
            }
            int height = EditorGUILayout.IntField("Hegiht", gameScreenHeight);

            if (gameScreenHeight != height && height > 0)
            {
                gameScreenHeight = height;
            }
            UtageEditorToolKit.EndGroup();
            EditorGUI.EndDisabledGroup();

            bool isProjectNameEnable = IsEnableProjcetName(newProjectName);

            EditorGUI.BeginDisabledGroup(!isProjectNameEnable);
            bool isCreate = GUILayout.Button("Create", GUILayout.Width(80f));

            EditorGUI.EndDisabledGroup();
            if (isCreate)
            {
                Create();
            }
        }
Ejemplo n.º 7
0
        public void DrawNode2DProperties()
        {
            Node2D obj = target as Node2D;

            UtageEditorToolKit.BeginGroup("Node2D");

            //色
            UtageEditorToolKit.BeginGroup("Color");
            UtageEditorToolKit.PropertyField(serializedObject, "isLinkColor", "Link parent");
            UtageEditorToolKit.PropertyField(serializedObject, "localColor", "Color");
            UtageEditorToolKit.EndGroup();

            //ソートデータの設定
            UtageEditorToolKit.BeginGroup("Sort");
            UtageEditorToolKit.PropertyField(serializedObject, "isLinkSorting2D", "Link parent");
//			UtageEditorToolKit.PropertyField(serializedObject, "sortData", "Data prefab");
            //値キーのポップアップ表示
            Node2DSortData.DictionarySortData2D dic = Node2DSortData.Instance.Dictionary;
            List <string> items = new List <string>();

            items.Add(Node2DSortData.KeyNone);
            foreach (Node2DSortData.DictionaryKeyValueSortData2D keyValue in dic.List)
            {
                items.Add(keyValue.Key);
            }
            int currentIndex = items.FindIndex(item => (item == obj.SortKey));
            int index        = EditorGUILayout.Popup(currentIndex, items.ToArray());

            if (index != currentIndex)
            {
                Undo.RecordObject(obj, "DefineZ Change");
                obj.SortKey = items[index];
                EditorUtility.SetDirty(target);
            }

            //描画レイヤー・描画順
            EditorGUI.BeginDisabledGroup(!obj.IsEmptySortData);
            UtageEditorToolKit.PropertyField(serializedObject, "localSortingLayer", "Sorting Layer");
            UtageEditorToolKit.PropertyField(serializedObject, "localOrderInLayer", "Order in Layer");
            EditorGUILayout.LabelField("Z", "" + obj.CachedTransform.localPosition.z);
            EditorGUI.EndDisabledGroup();

            UtageEditorToolKit.EndGroup();

            UtageEditorToolKit.EndGroup();
        }
Ejemplo n.º 8
0
        void DrawProperties()
        {
            CameraManager obj = target as CameraManager;

            UtageEditorToolKit.PropertyFieldArray(serializedObject, "cameras2D", "Cameras 2D");
            UtageEditorToolKit.PropertyField(serializedObject, "pixelsToUnits", "Pixels To Units");
            UtageEditorToolKit.PropertyFieldArray(serializedObject, "cameras3D", "Cameras 3D");
            UtageEditorToolKit.PropertyFieldArray(serializedObject, "canvases", "UI Canvases");

            //画面サイズ
            UtageEditorToolKit.BeginGroup("Game Screen size");
            UtageEditorToolKit.PropertyField(serializedObject, "defaultHeight", "Default Height");

            //縦長アスペクト比
            UtageEditorToolKit.BeginGroup("Nallow");
            UtageEditorToolKit.PropertyField(serializedObject, "nallowAspect", "Aspect");
            if (obj.NallowAspect == CameraManager.ASPECT.Custom)
            {
                UtageEditorToolKit.PropertyField(serializedObject, "customNallowAspect", "Custom Aspect");
            }
            UtageEditorToolKit.EndGroup();

            //基本アスペクト比
            UtageEditorToolKit.BeginGroup("Default");
            UtageEditorToolKit.PropertyField(serializedObject, "defaultAspect", "Aspect");
            if (obj.DefaultAspect == CameraManager.ASPECT.Custom)
            {
                UtageEditorToolKit.PropertyField(serializedObject, "customDefaultAspect", "Custom Aspect");
            }
            UtageEditorToolKit.EndGroup();

            //横長アスペクト比
            UtageEditorToolKit.BeginGroup("Wide");
            UtageEditorToolKit.PropertyField(serializedObject, "wideAspect", "Aspect");
            if (obj.WideAspect == CameraManager.ASPECT.Custom)
            {
                UtageEditorToolKit.PropertyField(serializedObject, "customWideAspect", "Custom Aspect");
            }
            UtageEditorToolKit.EndGroup();

            UtageEditorToolKit.PropertyFieldArray(serializedObject, "isAnchorBottom", "Is Anchor Bottom");

            UtageEditorToolKit.EndGroup();
        }
Ejemplo n.º 9
0
        void DrawProperties()
        {
            AdvEngineStarter obj = target as AdvEngineStarter;

            UtageEditorToolKit.PropertyField(serializedObject, "engine", "Engine");
            UtageEditorToolKit.PropertyField(serializedObject, "isLoadOnAwake", "Is Load On Awake");
            UtageEditorToolKit.PropertyField(serializedObject, "isAutomaticPlay", "Is Automatic Play");
            UtageEditorToolKit.PropertyField(serializedObject, "startScenario", "Start Scenario Label");

            //シナリオデータ
            UtageEditorToolKit.BeginGroup("Scenario Data");
            UtageEditorToolKit.PropertyField(serializedObject, "scenarioDataLoadType", "LoadType");
            switch (obj.ScenarioDataLoadType)
            {
            case AdvEngineStarter.LoadType.Local:
                UtageEditorToolKit.PropertyField(serializedObject, "settingDataManager", "Setting Data Manager");
                UtageEditorToolKit.PropertyFieldArray(serializedObject, "exportedScenarioDataTbl", "Exported Scenario Data Tbl");
                break;

            case AdvEngineStarter.LoadType.Server:
                UtageEditorToolKit.PropertyField(serializedObject, "urlScenarioData", "URL Scenario Data");
                UtageEditorToolKit.PropertyField(serializedObject, "scenarioVersion", "Boot File Version");
                break;
            }
            UtageEditorToolKit.EndGroup();


            //リソースデータ
            UtageEditorToolKit.BeginGroup("Resource Data");
            UtageEditorToolKit.PropertyField(serializedObject, "resourceLoadType", "LoadType");
            switch (obj.ResourceLoadType)
            {
            case AdvEngineStarter.LoadType.Local:
                UtageEditorToolKit.PropertyField(serializedObject, "rootResourceDir", "Root Dir");
                break;

            case AdvEngineStarter.LoadType.Server:
                UtageEditorToolKit.PropertyField(serializedObject, "urlResourceDir", "URL Resource Dir");
                break;
            }
            UtageEditorToolKit.EndGroup();
        }
Ejemplo n.º 10
0
        void OnGUI()
        {
            UtageEditorToolKit.BeginGroup("Game Screen Size");

            CustomProjectSetting projectSetting;

            projectSetting = EditorGUILayout.ObjectField("Custom Project Setting", this.customProjectSetting, typeof(CustomProjectSetting), false) as CustomProjectSetting;
            if (this.customProjectSetting != projectSetting)
            {
                this.customProjectSetting = projectSetting;
                Save();
            }

            int width = EditorGUILayout.IntField("Width", gameScreenWidth);

            if (gameScreenWidth != width && width > 0)
            {
                gameScreenWidth = width;
                Save();
            }
            int height = EditorGUILayout.IntField("Hegiht", gameScreenHeight);

            if (gameScreenHeight != height && height > 0)
            {
                gameScreenHeight = height;
                Save();
            }

            GUILayout.Space(4f);

            bool isEnable = true;

            EditorGUI.BeginDisabledGroup(!isEnable);
            if (GUILayout.Button("Create"))
            {
                CreateManagers(customProjectSetting, gameScreenWidth, gameScreenHeight);
            }
            EditorGUI.EndDisabledGroup();

            UtageEditorToolKit.EndGroup();
        }
Ejemplo n.º 11
0
        void DrawProperties(SerializedObject serializedObject)
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label("Reset to default values");
            if (GUILayout.Button("Reset", GUILayout.MaxWidth(80)))
            {
                ResetSave();
            }
            GUILayout.EndHorizontal();
            GUILayout.Space(8f);

            GUILayout.Space(4f);
            int width = EditorGUILayout.IntField("Width", gameScreenWidth);

            if (gameScreenWidth != width && width > 0)
            {
                gameScreenWidth = width;
                Save();
            }
            int height = EditorGUILayout.IntField("Hegiht", gameScreenHeight);

            if (gameScreenHeight != height && height > 0)
            {
                gameScreenHeight = height;
                Save();
            }

            GUILayout.Space(4f);
            UtageEditorToolKit.PropertyField(serializedObject, "font", "Font");
            UtageEditorToolKit.PropertyField(serializedObject, "clickSe", "Click SE");

            //トランジション
            UtageEditorToolKit.BeginGroup("Transition");
            UtageEditorToolKit.PropertyField(serializedObject, "transitionFadeBg", "Transition Fade Bg Sprite");
            UtageEditorToolKit.EndGroup();

            //選択肢
            UtageEditorToolKit.BeginGroup("Selection");
            AdvUiSelection selectionPrefab = UtageEditorToolKit.PrefabField <AdvUiSelection>("itemPrefab", this.selectionItemPrefab);

            if (this.selectionItemPrefab != selectionPrefab)
            {
                this.selectionItemPrefab = selectionPrefab;
                Save();
            }
            UtageEditorToolKit.EndGroup();

            //メッセージウィンドウ
            UtageEditorToolKit.BeginGroup("Message Window");
            UtageEditorToolKit.PropertyField(serializedObject, "msgWindowSprite", "Message Window Sprite");
            UtageEditorToolKit.PropertyField(serializedObject, "isEnableCloseButton", "Is Enable Close Button");
            EditorGUI.BeginDisabledGroup(!this.isEnableCloseButton);
            UtageEditorToolKit.PropertyField(serializedObject, "closeButtonSprite", "Close Button Sprite");
            EditorGUI.EndDisabledGroup();
            UtageEditorToolKit.EndGroup();

            //バックログ
            UtageEditorToolKit.BeginGroup("BackLog");
            UtageEditorToolKit.PropertyField(serializedObject, "isEnableBackLog", "Is Enable BackLog");
            EditorGUI.BeginDisabledGroup(!this.isEnableBackLog);
            UtageEditorToolKit.PropertyField(serializedObject, "backLogButtonSprite", "Open Button Sprite");
            UtageEditorToolKit.PropertyField(serializedObject, "backLogFilterSprite", "Filter Sprite");
            UtageEditorToolKit.PropertyField(serializedObject, "backLogCloseButtonSprite", "Close Button Sprite");
            UtageEditorToolKit.PropertyField(serializedObject, "backLogScrollUpArrow", "Scroll Arrow");
            AdvUiBacklog backLogItemPrefab = UtageEditorToolKit.PrefabField <AdvUiBacklog>("itemPrefab", this.backLogItemPrefab);

            if (this.backLogItemPrefab != backLogItemPrefab)
            {
                this.backLogItemPrefab = backLogItemPrefab;
                Save();
            }
            EditorGUI.EndDisabledGroup();
            UtageEditorToolKit.EndGroup();

            bool isEnable = (font != null && transitionFadeBg != null && msgWindowSprite != null && selectionItemPrefab != null);

            EditorGUI.BeginDisabledGroup(!isEnable);
            if (GUILayout.Button("Create"))
            {
                CreateAdvEngile();
            }
            EditorGUI.EndDisabledGroup();
        }
Ejemplo n.º 12
0
        void DrawProperties()
        {
            AdvEngineStarter obj = target as AdvEngineStarter;

            UtageEditorToolKit.PropertyField(serializedObject, "engine", "Engine");
            UtageEditorToolKit.PropertyField(serializedObject, "isLoadOnAwake", "Is Load On Awake");
            UtageEditorToolKit.PropertyField(serializedObject, "isAutomaticPlay", "Is Automatic Play");
            UtageEditorToolKit.PropertyField(serializedObject, "startScenario", "Start Scenario Label");

            //シナリオデータ
            UtageEditorToolKit.BeginGroup("Scenario Data");
            UtageEditorToolKit.PropertyField(serializedObject, "scenarioDataLoadType", "LoadType");
            switch (obj.ScenarioDataLoadType)
            {
            case AdvEngineStarter.LoadType.Local:
                UtageEditorToolKit.PropertyField(serializedObject, "scenarios", "Scenarios");
//					UtageEditorToolKit.PropertyField(serializedObject, "settingDataManager", "Setting Data Manager");
//					UtageEditorToolKit.PropertyFieldArray(serializedObject, "exportedScenarioDataTbl", "Exported Scenario Data Tbl");
                break;

            case AdvEngineStarter.LoadType.Server:
                UtageEditorToolKit.PropertyField(serializedObject, "urlScenarioData", "URL Scenario Data");
                UtageEditorToolKit.PropertyField(serializedObject, "scenarioVersion", "Boot File Version");
                UtageEditorToolKit.PropertyFieldArray(serializedObject, "chapterUrlList", "Chapter URL List");
                break;
            }
            UtageEditorToolKit.EndGroup();


            //リソースデータ
            UtageEditorToolKit.BeginGroup("Resource Data");
            UtageEditorToolKit.PropertyField(serializedObject, "resourceLoadType", "LoadType");
            switch (obj.ResourceLoadType)
            {
            case AdvEngineStarter.LoadType.Local:
                UtageEditorToolKit.PropertyField(serializedObject, "rootResourceDir", "Root Dir");
                UtageEditorToolKit.PropertyField(serializedObject, "useConvertFileListOnLocal", "Convert File List");
                UtageEditorToolKit.PropertyField(serializedObject, "useAssetBundleListOnLocal", "Asset Bundle List");
                break;

            case AdvEngineStarter.LoadType.Server:
                UtageEditorToolKit.PropertyField(serializedObject, "urlResourceDir", "URL Resource Dir");
                UtageEditorToolKit.PropertyField(serializedObject, "useConvertFileListOnServer", "Convert File List");
                UtageEditorToolKit.PropertyField(serializedObject, "useAssetBundleListOnServer", "Asset Bundle List");
                break;
            }
            UtageEditorToolKit.EndGroup();

            //リソースデータ
            UtageEditorToolKit.BeginGroup("Load Setting");
            UtageEditorToolKit.PropertyField(serializedObject, "isAutomaticInitFileLoadSetting", "Is Automatic Init");

            UtageEditorToolKit.PropertyField(serializedObject, "localLoadSetting", "Local Load Setting");
            UtageEditorToolKit.PropertyField(serializedObject, "serverLoadSetting", "Server Load Setting");

            UtageEditorToolKit.EndGroup();


            //エディターのみ
            UtageEditorToolKit.BeginGroup("Editor");
            UtageEditorToolKit.PropertyField(serializedObject, "scenarioDataProject", "Scenario Data Project");
            if (!(obj.ScenarioDataProject is AdvScenarioDataProject))
            {
                obj.ScenarioDataProject = null;
            }
            UtageEditorToolKit.EndGroup();
        }
Ejemplo n.º 13
0
        void DrawProject()
        {
            SerializedObject serializedObject = new SerializedObject(ProjectData);

            serializedObject.Update();

            /*********************************************************************/
            UtageEditorToolKit.BeginGroup("Import Scenario Files");
            UtageEditorToolKit.PropertyField(serializedObject, "autoImportType", "Auto Import Type");


            UtageEditorToolKit.PropertyFieldArray(serializedObject, "chapterDataList", "Chapters");

            GUILayout.Space(8f);

            EditorGUI.BeginDisabledGroup(!ProjectData.IsEnableImport);

            float width = EditorGUIUtility.labelWidth;

            EditorGUIUtility.labelWidth = 200;
            UtageEditorToolKit.PropertyField(serializedObject, "checkWaitType", "Check Wait Type");
            UtageEditorToolKit.PropertyField(serializedObject, "checkWhiteSpaceEndOfCell", "Check White Space EndOfCell");
            UtageEditorToolKit.PropertyField(serializedObject, "checkTextCount", "Check Text Count");
            UtageEditorToolKit.PropertyField(serializedObject, "checkTextCountAllLanguage", "Check Text Count All Language");
            UtageEditorToolKit.PropertyField(serializedObject, "quickImport", "Quick Auto Import [Warning!]");
            UtageEditorToolKit.PropertyField(serializedObject, "parseFormula", "Parse Formula");
            UtageEditorToolKit.PropertyField(serializedObject, "parseNumreic", "Parse Numreic");
            UtageEditorToolKit.PropertyField(serializedObject, "enableCommentOutOnImport", "Comment Out On Import");

            if (GUILayout.Button("Import", GUILayout.Width(180)))
            {
                Import();
            }
            EditorGUI.EndDisabledGroup();
            UtageEditorToolKit.EndGroup();

            UtageEditorToolKit.BeginGroup("File Path Check On Import");
            UtageEditorToolKit.PropertyField(serializedObject, "recourceDir", "Resource Dir");
            UtageEditorToolKit.PropertyField(serializedObject, "checkExt", "CheckExt");
            UtageEditorToolKit.EndGroup();
            EditorGUIUtility.labelWidth = width;

            GUILayout.Space(8f);

            /*********************************************************************/
            UtageEditorToolKit.BeginGroup("Custom Import Folders");
            UtageEditorToolKit.PropertyFieldArray(serializedObject, "customInportSpriteFolders", "Sprite Folder List");
            UtageEditorToolKit.PropertyFieldArray(serializedObject, "customInportAudioFolders", "Audio Folder List");
            UtageEditorToolKit.PropertyFieldArray(serializedObject, "customInportMovieFolders", "Movie Folder List");

            bool isEnableResouces = ProjectData.CustomInportAudioFolders.Count <= 0 &&
                                    ProjectData.CustomInportSpriteFolders.Count <= 0 &&
                                    ProjectData.CustomInportMovieFolders.Count <= 0;

            EditorGUI.BeginDisabledGroup(isEnableResouces);
            if (GUILayout.Button("ReimportResources", GUILayout.Width(180)))
            {
                ReImportResources();
            }
            EditorGUI.EndDisabledGroup();

            UtageEditorToolKit.EndGroup();

            GUILayout.Space(8f);

            /*********************************************************************/
            UtageEditorToolKit.BeginGroup("Covert Setting");

            EditorGUILayout.BeginHorizontal();
            UtageEditorToolKit.PropertyField(serializedObject, "convertPath", "Output directory");
            if (GUILayout.Button("Select", GUILayout.Width(100)))
            {
                string convertPath = ProjectData.ConvertPath;
                string dir         = string.IsNullOrEmpty(convertPath) ? "" : Path.GetDirectoryName(convertPath);
                string name        = string.IsNullOrEmpty(convertPath) ? "" : Path.GetFileName(convertPath);
                string path        = EditorUtility.SaveFolderPanel("Select folder to output", dir, name);
                Debug.Log(path);
                if (!string.IsNullOrEmpty(path))
                {
                    ProjectData.ConvertPath = path;
                }
            }
            EditorGUILayout.EndHorizontal();

            UtageEditorToolKit.PropertyField(serializedObject, "convertVersion", "Version");

            UtageEditorToolKit.PropertyField(serializedObject, "isAutoUpdateVersionAfterConvert", "Auto Update Version");


            UtageEditorToolKit.EndGroup();
            GUILayout.Space(4f);

            /*********************************************************************/
            EditorGUI.BeginDisabledGroup(!ProjectData.IsEnableConvert);
            UtageEditorToolKit.PropertyField(serializedObject, "isAutoConvertOnImport", "Auto Convert OnImport");
            if (GUILayout.Button("Convert", GUILayout.Width(180)))
            {
                Convert();
            }
            EditorGUI.EndDisabledGroup();
            GUILayout.Space(8f);

            serializedObject.ApplyModifiedProperties();
        }
Ejemplo n.º 14
0
        void OnGUI()
        {
            UtageEditorToolKit.BeginGroup("Create New Project");
//			GUIStyle style = new GUIStyle();
            GUILayout.Space(4f);
            UtageEditorToolKit.BoldLabel("Input New Project Name", GUILayout.Width(200f));
            newProjectName = EditorGUILayout.TextField(newProjectName);

            GUILayout.Space(4f);
            UtageEditorToolKit.BoldLabel("Select Create Type", GUILayout.Width(200f));
            Type type = (Type)EditorGUILayout.EnumPopup("Type", createType);

            if (createType != type)
            {
                createType = type;
            }
            UtageEditorToolKit.EndGroup();

            //レイヤー設定
            bool isDisableLayer = false;

            if (type == Type.AddToCurrentScene)
            {
                UtageEditorToolKit.BeginGroup("Layer Setting");
                layerName   = EditorGUILayout.TextField("Layer Name", layerName);
                layerNameUI = EditorGUILayout.TextField("UI Layer Name", layerNameUI);
                UtageEditorToolKit.EndGroup();

                if (string.IsNullOrEmpty(layerName) || string.IsNullOrEmpty(layerNameUI))
                {
                    isDisableLayer = true;
                }
            }

            //ゲームの画面サイズ
            EditorGUI.BeginDisabledGroup(!(createType != Type.CreateScenarioAssetOnly));
            GUILayout.Space(4f);
            UtageEditorToolKit.BeginGroup("Game Screen Size");
            int width = EditorGUILayout.IntField("Width", gameScreenWidth);

            if (gameScreenWidth != width && width > 0)
            {
                gameScreenWidth = width;
            }
            int height = EditorGUILayout.IntField("Height", gameScreenHeight);

            if (gameScreenHeight != height && height > 0)
            {
                gameScreenHeight = height;
            }
            UtageEditorToolKit.EndGroup();
            EditorGUI.EndDisabledGroup();

            //ゲームの画面サイズ
            EditorGUI.BeginDisabledGroup(!(createType != Type.CreateScenarioAssetOnly));
            GUILayout.Space(4f);
            UtageEditorToolKit.BeginGroup("Font");
            this.uiFont = EditorGUILayout.ObjectField("Font", UiFont, typeof(Font), false) as Font;
            UtageEditorToolKit.EndGroup();
            EditorGUI.EndDisabledGroup();

            //秘密キー
            EditorGUI.BeginDisabledGroup(!(createType != Type.CreateScenarioAssetOnly));
            GUILayout.Space(4f);
            UtageEditorToolKit.BeginGroup("Security");
            this.secretKey = EditorGUILayout.TextField("File Write Key", this.secretKey);
            bool isEnableSecretKey = !string.IsNullOrEmpty(this.secretKey);

            EditorGUI.EndDisabledGroup();
            UtageEditorToolKit.EndGroup();

            bool isProjectNameEnable = IsEnableProjcetName(newProjectName);

            EditorGUI.BeginDisabledGroup(!isProjectNameEnable || isDisableLayer || !isEnableSecretKey);
            bool isCreate = GUILayout.Button("Create", GUILayout.Width(80f));

            EditorGUI.EndDisabledGroup();
            if (isCreate)
            {
                Create();
            }
        }
        public override void DrawProperties()
        {
            TextArea2D obj = target as TextArea2D;

            //テキスト
            UtageEditorToolKit.BeginGroup("Text");
            string text = EditorGUILayout.TextArea(obj.text, GUILayout.Height(60f));

            if (text != obj.text)
            {
                Undo.RecordObject(obj, "Text Change");
                obj.text = text;
                EditorUtility.SetDirty(target);
            }


            UtageEditorToolKit.PropertyField(serializedObject, "lengthOfView", "Length");
            UtageEditorToolKit.PropertyField(serializedObject, "type", "Type");
            switch (obj.Type)
            {
            case TextArea2D.ViewType.Outline:
            case TextArea2D.ViewType.Shadow:
                UtageEditorToolKit.PropertyField(serializedObject, "colorEffect", "ColorEffect");
                break;

            case TextArea2D.ViewType.Default:
            default:
                break;
            }
            UtageEditorToolKit.EndGroup();


            UtageEditorToolKit.BeginGroup("Font");
            UtageEditorToolKit.PropertyField(serializedObject, "font", "Prefab");
            UtageEditorToolKit.PropertyField(serializedObject, "size", "Size");
            UtageEditorToolKit.PropertyField(serializedObject, "pixcelsToUnits", "Pixcels To Units");
            UtageEditorToolKit.EndGroup();

            UtageEditorToolKit.BeginGroup("Clip");
            UtageEditorToolKit.PropertyField(serializedObject, "layoutType", "Layout");
            UtageEditorToolKit.PropertyField(serializedObject, "maxWidth", "Width (px)");
            UtageEditorToolKit.PropertyField(serializedObject, "maxHeight", "Height (px)");
            UtageEditorToolKit.EndGroup();

            UtageEditorToolKit.BeginGroup("Style");
            UtageEditorToolKit.PropertyField(serializedObject, "isKerning", "Kerning");
            UtageEditorToolKit.PropertyField(serializedObject, "space", "Space (px)");
            UtageEditorToolKit.PropertyField(serializedObject, "letterSpace", "Letter Space (px)");
            UtageEditorToolKit.PropertyField(serializedObject, "lineSpace", "Line Space (px)");
            UtageEditorToolKit.EndGroup();

            UtageEditorToolKit.BeginGroup("WordWrap");
            UtageEditorToolKit.PropertyField(serializedObject, "wordWrap", "Type");
            UtageEditorToolKit.EndGroup();

            UtageEditorToolKit.BeginGroup("Debug");
            UtageEditorToolKit.PropertyField(serializedObject, "isDebugMode", "");
            UtageEditorToolKit.EndGroup();

            base.DrawProperties();
        }
        void DrawProject()
        {
            SerializedObject serializedObject = new SerializedObject(ProjectData);

            serializedObject.Update();

            /*********************************************************************/
            UtageEditorToolKit.BeginGroup("Import Scenario Files");
            UtageEditorToolKit.PropertyFieldArray(serializedObject, "chapterDataList", "Chapters");

            GUILayout.Space(8f);

            EditorGUI.BeginDisabledGroup(!ProjectData.IsEnableImport);
            if (GUILayout.Button("Import", GUILayout.Width(180)))
            {
                Import();
            }
            EditorGUI.EndDisabledGroup();
            UtageEditorToolKit.EndGroup();

            GUILayout.Space(8f);

            /*********************************************************************/
            UtageEditorToolKit.BeginGroup("Custom Import Folders");
            UtageEditorToolKit.PropertyFieldArray(serializedObject, "customInportSpriteFolders", "Sprite Folder List");
            UtageEditorToolKit.PropertyFieldArray(serializedObject, "customInportAudioFolders", "Audio Folder List");
            UtageEditorToolKit.PropertyFieldArray(serializedObject, "customInportMovieFolders", "Movie Folder List");

            bool isEnableResouces = ProjectData.CustomInportAudioFolders.Count <= 0 &&
                                    ProjectData.CustomInportSpriteFolders.Count <= 0 &&
                                    ProjectData.CustomInportMovieFolders.Count <= 0;

            EditorGUI.BeginDisabledGroup(isEnableResouces);
            if (GUILayout.Button("ReimportResources", GUILayout.Width(180)))
            {
                ReImportResources();
            }
            EditorGUI.EndDisabledGroup();

            UtageEditorToolKit.EndGroup();

            GUILayout.Space(8f);

            /*********************************************************************/
            UtageEditorToolKit.BeginGroup("Covert Setting");

            EditorGUILayout.BeginHorizontal();
            UtageEditorToolKit.PropertyField(serializedObject, "convertPath", "Output directory");
            if (GUILayout.Button("Select", GUILayout.Width(100)))
            {
                string convertPath = ProjectData.ConvertPath;
                string dir         = string.IsNullOrEmpty(convertPath) ? "" : Path.GetDirectoryName(convertPath);
                string name        = string.IsNullOrEmpty(convertPath) ? "" : Path.GetFileName(convertPath);
                string path        = EditorUtility.SaveFolderPanel("Select folder to output", dir, name);
                Debug.Log(path);
                if (!string.IsNullOrEmpty(path))
                {
                    ProjectData.ConvertPath = path;
                }
            }
            EditorGUILayout.EndHorizontal();

            UtageEditorToolKit.PropertyField(serializedObject, "convertVersion", "Version");

            UtageEditorToolKit.PropertyField(serializedObject, "isAutoUpdateVersionAfterConvert", "Auto Update Version");


            UtageEditorToolKit.EndGroup();
            GUILayout.Space(4f);

            /*********************************************************************/
            EditorGUI.BeginDisabledGroup(!ProjectData.IsEnableConvert);
            UtageEditorToolKit.PropertyField(serializedObject, "isAutoConvertOnImport", "Auto Convert OnImport");
            if (GUILayout.Button("Convert", GUILayout.Width(180)))
            {
                Convert();
            }
            EditorGUI.EndDisabledGroup();
            GUILayout.Space(8f);

            serializedObject.ApplyModifiedProperties();
        }
        void DrawProject()
        {
            SerializedObject serializedObject = new SerializedObject(ProjectData);

            serializedObject.Update();

            /*********************************************************************/
            UtageEditorToolKit.BeginGroup("Import Scenario Files");
            UtageEditorToolKit.PropertyFieldArray(serializedObject, "excelList", "Excel List");

            GUILayout.Space(8f);

            EditorGUI.BeginDisabledGroup(!ProjectData.IsEnableImport);
            if (GUILayout.Button("Import", GUILayout.Width(180)))
            {
                Import();
            }
            EditorGUI.EndDisabledGroup();
            UtageEditorToolKit.EndGroup();

            GUILayout.Space(8f);

            /*********************************************************************/
            UtageEditorToolKit.BeginGroup("Custom Import Folders");
            UtageEditorToolKit.PropertyFieldArray(serializedObject, "customInportSpriteFolders", "Sprite Folder List");
            UtageEditorToolKit.PropertyFieldArray(serializedObject, "customInportAudioFolders", "Audio Folder List");
            UtageEditorToolKit.PropertyFieldArray(serializedObject, "customInportMovieFolders", "Movie Folder List");

            bool isEnableResouces = ProjectData.CustomInportAudioFolders.Count <= 0 &&
                                    ProjectData.CustomInportSpriteFolders.Count <= 0 &&
                                    ProjectData.CustomInportMovieFolders.Count <= 0;

            EditorGUI.BeginDisabledGroup(isEnableResouces);
            if (GUILayout.Button("ReimportResources", GUILayout.Width(180)))
            {
                ReImportResources();
            }
            EditorGUI.EndDisabledGroup();

            UtageEditorToolKit.EndGroup();

            GUILayout.Space(8f);

            /*********************************************************************/
            UtageEditorToolKit.BeginGroup("Covert Setting");

            EditorGUILayout.BeginHorizontal();
            UtageEditorToolKit.PropertyField(serializedObject, "convertPath", "Output directory");
            if (GUILayout.Button("Select", GUILayout.Width(100)))
            {
                string convertPath = ProjectData.ConvertPath;
                string dir         = string.IsNullOrEmpty(convertPath) ? "" : Path.GetDirectoryName(convertPath);
                string name        = string.IsNullOrEmpty(convertPath) ? "" : Path.GetFileName(convertPath);
                string path        = EditorUtility.SaveFolderPanel("Select folder to output", dir, name);
                Debug.Log(path);
                if (!string.IsNullOrEmpty(path))
                {
                    ProjectData.ConvertPath = path;
                }
            }
            EditorGUILayout.EndHorizontal();

            UtageEditorToolKit.PropertyField(serializedObject, "convertVersion", "Version");

            UtageEditorToolKit.PropertyField(serializedObject, "isAutoUpdateVersionAfterConvert", "Auto Update Version");


            UtageEditorToolKit.EndGroup();
            GUILayout.Space(4f);

            /*********************************************************************/
            EditorGUI.BeginDisabledGroup(!ProjectData.IsEnableConvert);
            UtageEditorToolKit.PropertyField(serializedObject, "isAutoConvertOnImport", "Auto Convert OnImport");
            if (GUILayout.Button("Convert", GUILayout.Width(180)))
            {
                Convert();
            }
            EditorGUI.EndDisabledGroup();
            GUILayout.Space(8f);


            /*********************************************************************/

/*
 *                      UtageEditorToolKit.BeginGroup("Output Resources Data Setting");
 *
 *                      UtageEditorToolKit.PropertyField(serializedObject, "resourcesRoot", "Resources Root");
 *                      EditorGUILayout.BeginHorizontal();
 *
 *                      UtageEditorToolKit.PropertyField(serializedObject, "outputResourcesPath", "Output Resources Directory");
 *                      if (GUILayout.Button("Select", GUILayout.Width(100)))
 *                      {
 *                              string path = ProjectData.OutputResourcesPath;
 *                              string dir = string.IsNullOrEmpty(path) ? "" : Path.GetDirectoryName(path);
 *                              string name = string.IsNullOrEmpty(path) ? "" : Path.GetFileName(path);
 *                              path = EditorUtility.SaveFolderPanel("Select folder to output", dir, name);
 *                              Debug.Log(path);
 *                              if (!string.IsNullOrEmpty(path))
 *                              {
 *                                      ProjectData.OutputResourcesPath = path;
 *                              }
 *                      }
 *                      EditorGUILayout.EndHorizontal();
 *
 *                      fileManager = EditorGUILayout.ObjectField(fileManager, typeof(AssetFileManager), true) as AssetFileManager;
 *
 *                      bool isEnableOutputResources =
 *                              !string.IsNullOrEmpty(ProjectData.OutputResourcesPath)
 *                              && (fileManager != null);
 *
 *                      EditorGUI.BeginDisabledGroup(!isEnableOutputResources);
 *                      UtageEditorToolKit.PropertyField(serializedObject, "isResoucesCopyNewerOnly", "Copy new and newer files only");
 *                      if (GUILayout.Button("Output Resources", GUILayout.Width(180)))
 *                      {
 *                              OutputResources();
 *                      }
 *                      EditorGUI.EndDisabledGroup();
 *                      GUILayout.Space(8f);
 *
 *                      UtageEditorToolKit.EndGroup();
 *                      GUILayout.Space(8f);
 */
            serializedObject.ApplyModifiedProperties();
        }