コード例 #1
0
ファイル: EZEditorWindow.cs プロジェクト: zjytra/EZUnity
 protected virtual void OnGUI()
 {
     EditorGUILayout.Space();
     EditorGUILayout.LabelField(titleContent.text, EditorStyles.centeredGreyMiniLabel);
     EZEditorGUIUtility.ScriptTitle(this);
     EditorGUILayout.Space();
 }
コード例 #2
0
 public override void OnInspectorGUI()
 {
     EZEditorGUIUtility.ScriptTitle(target);
     serializedObject.Update();
     elementList.DoLayoutList();
     serializedObject.ApplyModifiedProperties();
 }
コード例 #3
0
ファイル: EZScreenshotEditor.cs プロジェクト: zjytra/EZUnity
 public override void OnInspectorGUI()
 {
     EZEditorGUIUtility.ScriptTitle(target);
     serializedObject.Update();
     EditorGUILayout.PropertyField(m_Resolution);
     EditorGUILayout.PropertyField(m_Format);
     EditorGUILayout.PropertyField(m_CapturePath);
     if (GUILayout.Button("Camera Capture"))
     {
         if (!string.IsNullOrEmpty(m_CapturePath.stringValue))
         {
             Directory.CreateDirectory(m_CapturePath.stringValue);
         }
         CameraCapture();
     }
     if (GUILayout.Button("Screen Capture"))
     {
         if (!string.IsNullOrEmpty(m_CapturePath.stringValue))
         {
             Directory.CreateDirectory(m_CapturePath.stringValue);
         }
         ScreenCapture();
     }
     if (GUILayout.Button("Open Folder"))
     {
         if (!string.IsNullOrEmpty(m_CapturePath.stringValue))
         {
             Directory.CreateDirectory(m_CapturePath.stringValue);
         }
         string projectPath = Application.dataPath.Substring(0, Application.dataPath.Length - 7);
         Application.OpenURL(string.Format("file://{0}/{1}", projectPath, m_CapturePath.stringValue));
     }
     serializedObject.ApplyModifiedProperties();
 }
コード例 #4
0
        protected void DrawExtensionListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            rect        = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_ExtensionList, index);
            rect.height = EditorGUIUtility.singleLineHeight;
            SerializedProperty extension = extensionList.serializedProperty.GetArrayElementAtIndex(index);

            EditorGUI.PropertyField(rect, extension, GUIContent.none);
        }
コード例 #5
0
        protected virtual void DrawPrefabListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            rect.y += 1;
            rect    = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_Options, index);
            SerializedProperty prefab = optionList.serializedProperty.GetArrayElementAtIndex(index);

            rect.height = EditorGUIUtility.singleLineHeight;
            EditorGUI.PropertyField(rect, prefab, GUIContent.none);
        }
コード例 #6
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            EZEditorGUIUtility.MonoBehaviourTitle(target as MonoBehaviour);

            elementList.DoLayoutList();

            serializedObject.ApplyModifiedProperties();
        }
コード例 #7
0
 protected void OnGUI()
 {
     EZEditorGUIUtility.WindowTitle(this);
     DrawConfig();
     EditorGUILayout.Space();
     DrawButton();
     EditorGUILayout.Space();
     DrawPreview();
 }
コード例 #8
0
ファイル: EZStringAssetEditor.cs プロジェクト: zjytra/EZUnity
 public override void OnInspectorGUI()
 {
     EZEditorGUIUtility.ScriptTitle(target);
     serializedObject.Update();
     scrollPosition = GUILayout.BeginScrollView(scrollPosition);
     itemList.DoLayoutList();
     GUILayout.EndScrollView();
     serializedObject.ApplyModifiedProperties();
 }
コード例 #9
0
        private void DrawAlwaysIncludedShaderListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            SerializedProperty shaderProperty = m_AlwaysIncludedShaders.GetArrayElementAtIndex(index);

            rect        = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_AlwaysIncludedShaders, index);
            rect.y     += 1;
            rect.height = EditorGUIUtility.singleLineHeight;
            EditorGUI.PropertyField(rect, shaderProperty, GUIContent.none);
        }
コード例 #10
0
        protected void DrawPatternListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            rect = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_PatternList, index);
            SerializedProperty pattern = patternList.serializedProperty.GetArrayElementAtIndex(index);
            float width = rect.width / 2; float margin = 5;

            EditorGUI.PropertyField(new Rect(rect.x, rect.y, width - margin, EditorGUIUtility.singleLineHeight), pattern.FindPropertyRelative("Key"), GUIContent.none);
            rect.x += width;
            EditorGUI.PropertyField(new Rect(rect.x, rect.y, width - margin, EditorGUIUtility.singleLineHeight), pattern.FindPropertyRelative("Value"), GUIContent.none);
        }
コード例 #11
0
        private void DrawCopyListHeader(Rect rect)
        {
            rect.y += 1;
            rect    = EZEditorGUIUtility.DrawReorderableListHeaderIndex(rect);
            float width = rect.width / 2;

            EditorGUI.LabelField(new Rect(rect.x, rect.y, width - space, lineHeight), "Destination");
            rect.x += width;
            EditorGUI.LabelField(new Rect(rect.x, rect.y, width - space, lineHeight), "Source");
        }
コード例 #12
0
 public override void OnInspectorGUI()
 {
     EZEditorGUIUtility.ScriptTitle(target);
     serializedObject.Update();
     DrawOtherProperties();
     EditorGUILayout.Space();
     EditorGUILayout.PropertyField(m_AllowSwitchOff);
     EditorGUILayout.PropertyField(m_SwitchOnStart);
     EditorGUILayout.PropertyField(m_Next);
     optionList.DoLayoutList();
     serializedObject.ApplyModifiedProperties();
 }
コード例 #13
0
 protected void OnGUI()
 {
     EZEditorGUIUtility.WindowTitle(this);
     if (GUILayout.Button("Refresh"))
     {
         RefreshGuid();
     }
     EditorGUILayout.PrefixLabel("System Guid");
     EditorGUILayout.TextArea(systemGuid.ToString());
     EditorGUILayout.PrefixLabel("Unity Guid");
     EditorGUILayout.TextArea(unityGuid.ToString());
 }
コード例 #14
0
        private void DrawBundleListHeader(Rect rect)
        {
            rect.y += 1;
            rect    = EZEditorGUIUtility.DrawReorderableListHeaderIndex(rect);
            float width = Mathf.Min(100, rect.width / 4); float residue = (rect.width - width * 4) / 10;

            EditorGUI.LabelField(new Rect(rect.x, rect.y, width + residue - space, lineHeight), "Bundle Name");
            rect.x += width + residue;
            EditorGUI.LabelField(new Rect(rect.x, rect.y, width + residue - space, lineHeight), "File Pattern");
            rect.x += width + residue;
            EditorGUI.LabelField(new Rect(rect.x, rect.y, width + residue - space, lineHeight), "Search Option");
            rect.x += width + residue;
            EditorGUI.LabelField(new Rect(rect.x, rect.y, width + residue * 7 - space, lineHeight), "Source");
        }
コード例 #15
0
        public void DrawCopyListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            SerializedProperty m_PathPair = m_CopyList.GetArrayElementAtIndex(index);
            SerializedProperty m_SrcPath  = m_PathPair.FindPropertyRelative("m_SrcPath");
            SerializedProperty m_DstPath  = m_PathPair.FindPropertyRelative("m_DstPath");

            rect    = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_CopyList, index);
            rect.y += 1; rect.height = EditorGUIUtility.singleLineHeight;
            float width = rect.width / 2; float margin = 5; rect.width = width - margin;

            EditorGUI.PropertyField(rect, m_SrcPath, GUIContent.none);
            rect.x += width;
            EditorGUI.PropertyField(rect, m_DstPath, GUIContent.none);
        }
コード例 #16
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            EZEditorGUIUtility.ScriptableObjectTitle(target as ScriptableObject, !serializedObject.isEditingMultipleObjects);

            EditorGUILayout.PropertyField(m_FilePath);
            if (GUILayout.Button("Open Folder"))
            {
                if (!string.IsNullOrEmpty(m_FilePath.stringValue))
                {
                    Directory.CreateDirectory(m_FilePath.stringValue);
                }
                string projectPath = Application.dataPath.Substring(0, Application.dataPath.Length - 7);
                Application.OpenURL(string.Format("file://{0}/{1}", projectPath, m_FilePath.stringValue));
            }

            EditorGUILayout.Space();
            EditorGUILayout.HelpBox("Game View Capture is only available when playing", MessageType.Info);
            GUI.enabled = EditorApplication.isPlaying;
            if (GUILayout.Button("Game View Capture"))
            {
                if (!string.IsNullOrEmpty(m_FilePath.stringValue))
                {
                    Directory.CreateDirectory(m_FilePath.stringValue);
                }
                capturer.ScreenCapture(GetPath());
            }
            GUI.enabled = true;

            EditorGUILayout.Space();
            camera = (Camera)EditorGUILayout.ObjectField("Target Camera", camera, typeof(Camera), true);
            EditorGUILayout.PropertyField(m_Resolution);
            EditorGUILayout.PropertyField(m_TextureFormat);
            if (camera == null)
            {
                GUI.enabled = false;
            }
            if (GUILayout.Button("Camera Capture"))
            {
                if (!string.IsNullOrEmpty(m_FilePath.stringValue))
                {
                    Directory.CreateDirectory(m_FilePath.stringValue);
                }
                capturer.CameraCapture(camera, GetPath());
            }
            GUI.enabled = true;

            serializedObject.ApplyModifiedProperties();
        }
コード例 #17
0
        private void DrawCopyListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            rect.y += 1;
            rect    = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_CopyList, index);

            SerializedProperty m_CopyInfo    = m_CopyList.GetArrayElementAtIndex(index);
            SerializedProperty m_DestDirPath = m_CopyInfo.FindPropertyRelative("destDirPath");
            SerializedProperty m_SrcDirPath  = m_CopyInfo.FindPropertyRelative("sourDirPath");

            float width = rect.width / 2;

            EditorGUI.PropertyField(new Rect(rect.x, rect.y, width - space, lineHeight), m_DestDirPath, GUIContent.none);
            rect.x += width;
            EditorGUI.PropertyField(new Rect(rect.x, rect.y, width - space, lineHeight), m_SrcDirPath, GUIContent.none);
        }
コード例 #18
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            EZEditorGUIUtility.MonoBehaviourTitle(target as MonoBehaviour);

            EditorGUILayout.PropertyField(m_TransitionType);
            EditorGUI.indentLevel++;
            switch (m_TransitionType.enumValueIndex)
            {
            case (int)EZTransition.TransitionType.None:
                break;

            case (int)EZTransition.TransitionType.Scale:
                EditorGUILayout.PropertyField(m_RectTransform);
                EditorGUILayout.PropertyField(m_ScaleState.FindPropertyRelative("m_NormalScale"));
                EditorGUILayout.PropertyField(m_ScaleState.FindPropertyRelative("m_HighlightedScale"));
                EditorGUILayout.PropertyField(m_ScaleState.FindPropertyRelative("m_PressedScale"));
                EditorGUILayout.PropertyField(m_ScaleState.FindPropertyRelative("m_DisabledScale"));
                break;

            case (int)EZTransition.TransitionType.Size:
                EditorGUILayout.PropertyField(m_RectTransform);
                EditorGUILayout.PropertyField(m_SizeState.FindPropertyRelative("m_NormalSize"));
                EditorGUILayout.PropertyField(m_SizeState.FindPropertyRelative("m_HighlightedSize"));
                EditorGUILayout.PropertyField(m_SizeState.FindPropertyRelative("m_PressedSize"));
                EditorGUILayout.PropertyField(m_SizeState.FindPropertyRelative("m_DisabledSize"));
                break;

            case (int)EZTransition.TransitionType.OutlineDistance:
                EditorGUILayout.PropertyField(m_Outline);
                EditorGUILayout.PropertyField(m_OutlineDistanceState.FindPropertyRelative("m_NormalDistance"));
                EditorGUILayout.PropertyField(m_OutlineDistanceState.FindPropertyRelative("m_HighlightedDistance"));
                EditorGUILayout.PropertyField(m_OutlineDistanceState.FindPropertyRelative("m_PressedDistance"));
                EditorGUILayout.PropertyField(m_OutlineDistanceState.FindPropertyRelative("m_DisabledDistance"));
                break;

            case (int)EZTransition.TransitionType.OutlineColor:
                EditorGUILayout.PropertyField(m_Outline);
                EditorGUILayout.PropertyField(m_OutlineColorState.FindPropertyRelative("m_NormalColor"));
                EditorGUILayout.PropertyField(m_OutlineColorState.FindPropertyRelative("m_HighlightedColor"));
                EditorGUILayout.PropertyField(m_OutlineColorState.FindPropertyRelative("m_PressedColor"));
                EditorGUILayout.PropertyField(m_OutlineColorState.FindPropertyRelative("m_DisabledColor"));
                break;
            }
            EditorGUI.indentLevel--;

            serializedObject.ApplyModifiedProperties();
        }
コード例 #19
0
 protected void OnGUI()
 {
     EZEditorGUIUtility.WindowTitle(this);
     scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
     for (int i = 0; i < texts.Length; i++)
     {
         Text text = texts[i];
         EditorGUILayout.BeginHorizontal();
         GUI.enabled = false;
         EditorGUILayout.ObjectField(text.gameObject, typeof(GameObject), true);
         GUI.enabled = true;
         text.font   = (Font)EditorGUILayout.ObjectField(text.font, typeof(Font), true);
         EditorGUILayout.EndHorizontal();
     }
     EditorGUILayout.EndScrollView();
 }
コード例 #20
0
 public void DrawCopyListHeader(Rect rect)
 {
     rect = EZEditorGUIUtility.CalcReorderableListHeaderRect(rect, true);
     if (copyList.count == 0)
     {
         EditorGUI.LabelField(rect, "Copy List");
     }
     else
     {
         float width = rect.width / 2; float margin = 5;
         rect.y += 1; rect.width = width - margin;
         EditorGUI.LabelField(rect, "Src");
         rect.x += width;
         EditorGUI.LabelField(rect, "Dst");
     }
 }
コード例 #21
0
ファイル: EZRegexTester.cs プロジェクト: szc040133/EZUnity
        protected void OnGUI()
        {
            EZEditorGUIUtility.WindowTitle(this);

            EditorGUILayout.LabelField("Input", EditorStyles.boldLabel);
            inputString = EditorGUILayout.TextArea(inputString, GUILayout.MinHeight(height));

            EditorGUILayout.LabelField("Regex", EditorStyles.boldLabel);
            regexString = EditorGUILayout.TextArea(regexString, GUILayout.MinHeight(height));

            EditorGUILayout.LabelField("Matches", EditorStyles.boldLabel);
            try
            {
                if (string.IsNullOrEmpty(regexString))
                {
                    return;
                }
                foreach (Match match in Regex.Matches(inputString, regexString))
                {
#if UNITY_2018_1_OR_NEWER
                    EditorGUILayout.LabelField(string.Format("Match:\tIndex: {0}\tName: {1}\tValue: {2}", match.Index, match.Name, match.Value));
#else
                    EditorGUILayout.LabelField(string.Format("Match:\tIndex: {0}\tValue: {1}", match.Index, match.Value));
#endif
                    EditorGUI.indentLevel++;
                    foreach (Group group in match.Groups)
                    {
#if UNITY_2018_1_OR_NEWER
                        EditorGUILayout.LabelField(string.Format("Group:\tIndex: {0}\tName: {1}\tValue: {2}", group.Index, group.Name, group.Value));
#else
                        EditorGUILayout.LabelField(string.Format("Group:\tIndex: {0}\tValue: {1}", group.Index, group.Value));
#endif
                        EditorGUI.indentLevel++;
                        foreach (Capture capture in group.Captures)
                        {
                            EditorGUILayout.LabelField(string.Format("Capture:\tIndex: {0}\tValue: {1}", capture.Index, capture.Value));
                        }
                        EditorGUI.indentLevel--;
                    }
                    EditorGUI.indentLevel--;
                }
            }
            catch
            {
            }
        }
コード例 #22
0
        public override void OnInspectorGUI()
        {
            EZEditorGUIUtility.ScriptableObjectTitle(target as ScriptableObject);
            serializedObject.Update();

            if (GUILayout.Button("Execute"))
            {
                renamer.Execute();
            }

            EditorGUILayout.PropertyField(m_IndexStep);
            EditorGUILayout.PropertyField(m_IndexOffset);
            EditorGUILayout.PropertyField(m_IndexFormat);
            EditorGUILayout.PropertyField(m_CaptureRegex);
            objectList.DoLayoutList();

            serializedObject.ApplyModifiedProperties();
        }
コード例 #23
0
        public override void OnInspectorGUI()
        {
            EZEditorGUIUtility.ScriptTitle(target);
            GUI.enabled = false;
            EditorGUILayout.ObjectField("Target Object", target, typeof(EZScriptStatisticsObject), true);
            GUI.enabled = true;
            serializedObject.Update();
            EditorGUILayout.BeginHorizontal();
            if (targetObject.result.Count != 0)
            {
                EditorGUILayout.LabelField("Result Time: " + targetObject.resultTime);
            }
            if (GUILayout.Button("Refresh"))
            {
                RefreshResult();
            }
            EditorGUILayout.EndHorizontal();

            scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
            EditorGUILayout.LabelField("File Association", EditorStyles.boldLabel);
            EditorGUI.indentLevel++;
            EditorGUILayout.PropertyField(m_FilePatterns, true);
            EditorGUILayout.PropertyField(m_IncludePaths, true);
            EditorGUILayout.PropertyField(m_ExcludePaths, true);
            EditorGUI.indentLevel--;
            EditorGUILayout.LabelField("Analysis", EditorStyles.boldLabel);
            EditorGUI.indentLevel++;
            EditorGUILayout.PropertyField(m_InfoLineCount);
            EditorGUILayout.PropertyField(m_AuthorRegex);
            EditorGUILayout.PropertyField(m_CreateTimeRegex);
            EditorGUILayout.PropertyField(m_ValidLineRegex);
            EditorGUILayout.HelpBox(new StringBuilder()
                                    .AppendLine(@"'^\W*(\w+)[\S\s]*$': line contains word characters")
                                    .AppendLine(@"'^\W*(\S+)[\S\s]*$': line contains non-white-space characters")
                                    .ToString(), MessageType.Info);
            EditorGUI.indentLevel--;
            EditorGUILayout.LabelField("Result", EditorStyles.boldLabel);
            EditorGUI.indentLevel++;
            DrawResult(targetObject);
            EditorGUI.indentLevel--;
            EditorGUILayout.EndScrollView();
            serializedObject.ApplyModifiedProperties();
        }
コード例 #24
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            EZEditorGUIUtility.ScriptTitle(target);
            GUI.enabled = false;
            EditorGUILayout.ObjectField("Target", target, typeof(EZBundleObject), false);
            GUI.enabled = true;

            DrawFunctionButtons();
            DrawBaseProperties();

            EditorGUILayout.Space();
            if (m_CopyListFoldout.boolValue = EditorGUILayout.Foldout(m_CopyListFoldout.boolValue, string.Format("Copy List ({0})", copyList.count)))
            {
                copyList.DoLayoutList();
            }

            if (m_ManagerMode.boolValue)
            {
                EditorGUILayout.BeginHorizontal();
                string label = string.Format("Bundle List ({0})", AssetDatabase.GetAllAssetBundleNames().Length);
                m_BundleListFoldout.boolValue = EditorGUILayout.Foldout(m_BundleListFoldout.boolValue, label);
                EditorGUILayout.EndHorizontal();
                if (m_BundleListFoldout.boolValue)
                {
                    DrawAssetBundleManager();
                }
            }
            else
            {
                EditorGUILayout.BeginHorizontal();
                string label = string.Format("Bundle List ({0})", bundleList.count);
                m_BundleListFoldout.boolValue = EditorGUILayout.Foldout(m_BundleListFoldout.boolValue, label);
                EditorGUILayout.EndHorizontal();
                if (m_BundleListFoldout.boolValue)
                {
                    bundleList.DoLayoutList();
                }
            }

            serializedObject.ApplyModifiedProperties();
        }
コード例 #25
0
        private void OnGUI()
        {
            EZEditorGUIUtility.WindowTitle(this as EditorWindow);

            EditorGUILayout.LabelField("Factors", EditorStyles.boldLabel);
            useHDR = EditorGUILayout.Toggle("Use HDR", useHDR);
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Source Color");
                EditorGUILayout.LabelField("Destination Color");
                EditorGUILayout.EndHorizontal();
            }
            {
                EditorGUILayout.BeginHorizontal();
                srcColor = EditorGUILayout.ColorField(GUIContent.none, srcColor);
                dstColor = EditorGUILayout.ColorField(GUIContent.none, dstColor);
                EditorGUILayout.EndHorizontal();
            }

            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.EndHorizontal();
            }

            float width = Mathf.Max(50, EditorGUIUtility.currentViewWidth / 4 - 5);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Results", EditorStyles.boldLabel);

            DrawResultsSingleLine(width, "Add", "Minus", "Multiply", "Divide");
            DrawResultsSingleLine(width, "Opacity", "Darken", "Lighten", "Screen");
            DrawResultsSingleLine(width, "ColorBurn", "ColorDodge", "LinearBurn", "LinearDodge");
            DrawResultsSingleLine(width, "Overlay", "HardLight", "SoftLight", "VividLight");
            DrawResultsSingleLine(width, "LinearLight", "PinLight", "HardMix", "Difference");
            DrawResultsSingleLine(width, "Exclusion");
            DrawResultsSingleLine(width, "HSVBlend_H", "HSVBlend_S", "HSVBlend_V", "HSVBlend_HS");

            if (GUI.changed)
            {
                CalculateAll();
            }
        }
コード例 #26
0
        protected void DrawElementListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            rect.y += 1;
            rect    = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_Elements, index);
            SerializedProperty element = m_Elements.GetArrayElementAtIndex(index);

            if (m_IsList.boolValue)
            {
                float width = rect.width / 2, space = 5;
                rect.width  = width - space;
                rect.height = EditorGUIUtility.singleLineHeight;
                EZPropertyDrawer.DrawTypeOption(rect, element);
                rect.x += width;
                EZPropertyDrawer.DrawValueContent(rect, element);
            }
            else
            {
                EditorGUI.PropertyField(rect, element);
            }
        }
コード例 #27
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            EZEditorGUIUtility.ScriptableObjectTitle(target as ScriptableObject, !serializedObject.isEditingMultipleObjects);
            scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);

            EditorGUILayout.LabelField("File Association", EditorStyles.boldLabel);
            EditorGUI.indentLevel++;
            EditorGUILayout.PropertyField(m_FilePatterns, true);
            EditorGUILayout.PropertyField(m_IncludePaths, true);
            EditorGUILayout.PropertyField(m_ExcludePaths, true);
            EditorGUI.indentLevel--;

            EditorGUILayout.LabelField("Analysis", EditorStyles.boldLabel);
            EditorGUI.indentLevel++;
            EditorGUILayout.PropertyField(m_InfoLineCount);
            EditorGUILayout.PropertyField(m_AuthorRegex);
            EditorGUILayout.PropertyField(m_CreateTimeRegex);
            EditorGUILayout.PropertyField(m_ValidLineRegex);
            EditorGUILayout.HelpBox(new StringBuilder()
                                    .AppendLine(@"'^\W*(\w+)[\S\s]*$': line contains word characters")
                                    .AppendLine(@"'^\W*(\S+)[\S\s]*$': line contains non-white-space characters")
                                    .ToString(), MessageType.Info);
            EditorGUI.indentLevel--;

            if (GUILayout.Button("Refresh"))
            {
                RefreshResult();
            }

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Result: " + targetObject.resultTime, EditorStyles.boldLabel);
            showAsAsset = EditorGUILayout.Toggle("Show Script As TextAsset", showAsAsset);
            EditorGUILayout.EndHorizontal();
            EditorGUI.indentLevel++;
            DrawResult(targetObject);
            EditorGUI.indentLevel--;

            EditorGUILayout.EndScrollView();
            serializedObject.ApplyModifiedProperties();
        }
コード例 #28
0
        private void DrawBundleListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            rect.y += 1;
            rect    = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_BundleList, index);

            SerializedProperty m_BundleInfo   = m_BundleList.GetArrayElementAtIndex(index);
            SerializedProperty m_BundleName   = m_BundleInfo.FindPropertyRelative("bundleName");
            SerializedProperty m_FilePattern  = m_BundleInfo.FindPropertyRelative("filePattern");
            SerializedProperty m_SearchOption = m_BundleInfo.FindPropertyRelative("searchOption");
            SerializedProperty m_SrcDirPath   = m_BundleInfo.FindPropertyRelative("dirPath");

            float width = Mathf.Min(100, rect.width / 4); float residue = (rect.width - width * 4) / 10;

            EditorGUI.PropertyField(new Rect(rect.x, rect.y, width + residue - space, lineHeight), m_BundleName, GUIContent.none);
            rect.x += width + residue;
            EditorGUI.PropertyField(new Rect(rect.x, rect.y, width + residue - space, lineHeight), m_FilePattern, GUIContent.none);
            rect.x += width + residue;
            EditorGUI.PropertyField(new Rect(rect.x, rect.y, width + residue - space, lineHeight), m_SearchOption, GUIContent.none);
            rect.x += width + residue;
            EditorGUI.PropertyField(new Rect(rect.x, rect.y, width + residue * 7 - space, lineHeight), m_SrcDirPath, GUIContent.none);
        }
コード例 #29
0
        protected void OnGUI()
        {
            EZEditorGUIUtility.WindowTitle(this);
            EditorGUILayout.ObjectField("Target", target, typeof(Object), true);

            EditorGUILayout.BeginHorizontal();
            if (dependenciesRecursive != EditorGUILayout.Toggle("Show Recursive Dependencies", dependenciesRecursive))
            {
                dependenciesRecursive = !dependenciesRecursive;
                Refresh();
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();

            scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
            if (dependenciesFoldout = EditorGUILayout.Foldout(dependenciesFoldout, "Asset Dependencies"))
            {
                EditorGUI.indentLevel++;
                for (int i = 0; i < dependencies.Count; i++)
                {
                    if (dependencies[i] == target)
                    {
                        continue;                            // dependencies contains target itself
                    }
                    EditorGUILayout.ObjectField(dependencies[i], typeof(Object), true);
                }
                EditorGUI.indentLevel--;
            }
            if (referencesFoldout = EditorGUILayout.Foldout(referencesFoldout, "Scene References"))
            {
                EditorGUI.indentLevel++;
                foreach (Object obj in sceneReferences)
                {
                    EditorGUILayout.ObjectField(obj, typeof(Object), true);
                }
                EditorGUI.indentLevel--;
            }
            EditorGUILayout.EndScrollView();
        }
コード例 #30
0
        private void OnGUI()
        {
            EZEditorGUIUtility.WindowTitle(this);
            EditorGUILayout.ObjectField("Target", target, typeof(Object), false);

            EditorGUILayout.EnumPopup("Prefab Asset Type", prefabAssetType);
            EditorGUILayout.ObjectField("Original Object", originalObject, typeof(Object), false);
            correspondingObjectsFoldout = EditorGUILayout.Foldout(correspondingObjectsFoldout, "Corresponding Objects");
            if (correspondingObjectsFoldout)
            {
                EditorGUI.indentLevel++;
                for (int i = 0; i < correspondingObjects.Count; i++)
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.ObjectField(i.ToString("00"), correspondingObjects[i], typeof(Object), false);
                    float width = (EditorGUIUtility.currentViewWidth - EditorGUIUtility.labelWidth) / 2;
                    EditorGUILayout.ObjectField(correspondingAssets[i], typeof(Object), false, GUILayout.Width(width));
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUI.indentLevel--;
            }
        }