protected void DrawInjectionListElement(Rect rect, int index, bool isActive, bool isFocused) { rect.y += 1; rect = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_InjectionList, index); SerializedProperty pair = injectionList.serializedProperty.GetArrayElementAtIndex(index); SerializedProperty key = pair.FindPropertyRelative("key"); SerializedProperty value = pair.FindPropertyRelative("value"); SerializedProperty typeName = pair.FindPropertyRelative("typeName"); if (string.IsNullOrEmpty(typeName.stringValue)) { typeName.stringValue = "UnityEngine.Object"; } Type type = GetType(typeName.stringValue); float width = rect.width / 3; if (GUI.Button(new Rect(rect.x, rect.y, width - space, lineHeight), type.Name)) { DrawTypeMenu(delegate(object name) { typeName.stringValue = (string)name; serializedObject.ApplyModifiedProperties(); }); } rect.x += width; EditorGUI.PropertyField(new Rect(rect.x, rect.y, width - space, lineHeight), key, GUIContent.none); rect.x += width; value.objectReferenceValue = EditorGUI.ObjectField(new Rect(rect.x, rect.y, width - space, lineHeight), value.objectReferenceValue, type, true); }
public override void OnInspectorGUI() { serializedObject.Update(); EZEditorGUIUtility.ScriptableObjectTitle(target as ScriptableObject, !serializedObject.isEditingMultipleObjects); if (!serializedObject.isEditingMultipleObjects) { EditorGUILayout.LabelField("Build", EditorStyles.boldLabel); EditorGUILayout.PropertyField(m_ConfigButDontBuild); EditorGUILayout.PropertyField(m_BuildTarget); if (GUILayout.Button("Build")) { playerBuilder.Execute((BuildTarget)m_BuildTarget.intValue); GUIUtility.ExitGUI(); } EditorGUILayout.Space(); } EditorGUILayout.LabelField("Build Options", EditorStyles.boldLabel); m_BuildOptions.intValue = (int)(BuildOptions)EditorGUILayout.EnumFlagsField("Build Options", (BuildOptions)m_BuildOptions.intValue); { EditorGUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(m_LocationPathName, Styles.Label_LocationPathName); if (GUILayout.Button("...", EditorStyles.miniButton, new GUILayoutOption[] { GUILayout.Width(30) })) { string path = EditorUtility.SaveFolderPanel("Choose Output Folder", "", ""); if (!string.IsNullOrEmpty(path)) { m_LocationPathName.stringValue = path; } } EditorGUILayout.EndHorizontal(); EditorGUILayout.PropertyField(m_ExeFileName, Styles.Label_ExeFileName); } EditorGUILayout.PropertyField(m_BundleBuilder); EditorGUILayout.PropertyField(m_Scenes, true); EditorGUILayout.Space(); EditorGUILayout.LabelField("Player Settings", EditorStyles.boldLabel); EditorGUILayout.PropertyField(m_CompanyName); EditorGUILayout.PropertyField(m_ProductName); EditorGUILayout.PropertyField(m_BundleIdentifier); EditorGUILayout.PropertyField(m_BundleVersion); { EditorGUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(m_BuildNumber); if (GUILayout.Button("+", EditorStyles.miniButton, new GUILayoutOption[] { GUILayout.Width(30) })) { m_BuildNumber.intValue++; } EditorGUILayout.EndHorizontal(); } EditorGUILayout.PropertyField(m_BuildNumberIncrement, Styles.Label_BuildNumberIncrement); EditorGUILayout.PropertyField(m_Icon); EditorGUILayout.Space(); EditorGUILayout.PropertyField(m_CopyList); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); EZEditorGUIUtility.ScriptTitle(target); injectionList.DoLayoutList(); serializedObject.ApplyModifiedProperties(); }
protected void DrawItemListElement(Rect rect, int index, bool isActive, bool isFocused) { SerializedProperty key = m_Keys.GetArrayElementAtIndex(index); while (m_Values.arraySize < m_Keys.arraySize) { m_Values.InsertArrayElementAtIndex(m_Values.arraySize); } SerializedProperty value = m_Values.GetArrayElementAtIndex(index); rect = EZEditorGUIUtility.DrawReorderableListIndex(rect, index, serializedObject, m_Keys, m_Values); Rect keyRect, valueRect; SplitRect(rect, out keyRect, out valueRect); Color originalBackgroundColor = GUI.backgroundColor; if (mapAsset.IsKeyDuplicate(index)) { GUI.backgroundColor = Color.red; } DrawKeyProperty(keyRect, key); GUI.backgroundColor = originalBackgroundColor; DrawValueProperty(valueRect, value); }
private void OnGUI() { EZEditorGUIUtility.WindowTitle(this); modifier = (EZTextureChannelModifier)EditorGUILayout.ObjectField("Channel Modifier", modifier, typeof(EZTextureChannelModifier), false); if (modifier == null) { return; } EditorGUILayout.Space(); GUI.enabled = false; { EditorGUILayout.BeginHorizontal(); EditorGUILayout.EnumPopup("Channel R", modifier.channelR); EditorGUILayout.CurveField(modifier.curveR); EditorGUILayout.EndHorizontal(); } { EditorGUILayout.BeginHorizontal(); EditorGUILayout.EnumPopup("Channel G", modifier.channelG); EditorGUILayout.CurveField(modifier.curveG); EditorGUILayout.EndHorizontal(); } { EditorGUILayout.BeginHorizontal(); EditorGUILayout.EnumPopup("Channel B", modifier.channelB); EditorGUILayout.CurveField(modifier.curveB); EditorGUILayout.EndHorizontal(); } { EditorGUILayout.BeginHorizontal(); EditorGUILayout.EnumPopup("Channel A", modifier.channelA); EditorGUILayout.CurveField(modifier.curveA); EditorGUILayout.EndHorizontal(); } GUI.enabled = true; EditorGUILayout.Space(); if (selectedTextures == null || selectedTextures.Length == 0) { EditorGUILayout.HelpBox("No Editable Texture Selected", MessageType.Info); } else { if (GUILayout.Button("Apply Modifier To Textures")) { for (int i = 0; i < selectedTextures.Length; i++) { OverrideTexture(selectedTextures[i]); } AssetDatabase.Refresh(); } for (int i = 0; i < selectedTextures.Length; i++) { EditorGUILayout.ObjectField(selectedTextures[i], typeof(Texture2D), false); } } }
protected void DrawElementListElement(Rect rect, int index, bool isActive, bool isFocused) { SerializedProperty key = m_Elements.GetArrayElementAtIndex(index); rect = EZEditorGUIUtility.DrawReorderableListIndex(rect, index, serializedObject, m_Elements); rect.height = EditorGUIUtility.singleLineHeight; EditorGUI.PropertyField(rect, key, GUIContent.none); }
private void DrawLuaBundleListElement(Rect rect, int index, bool isActive, bool isFocused) { rect = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_LuaBundles, index); SerializedProperty bundle = m_LuaBundles.GetArrayElementAtIndex(index); rect.y += 1; EditorGUI.PropertyField(new Rect(rect.x, rect.y, rect.width, height), bundle, GUIContent.none); }
public override void OnInspectorGUI() { EZEditorGUIUtility.ScriptTitle(target); serializedObject.Update(); EditorGUILayout.PropertyField(m_ModuleName); elementList.DoLayoutList(); serializedObject.ApplyModifiedProperties(); }
protected void DrawInjectionListElement(Rect rect, int index, bool isActive, bool isFocused) { rect.y += 1; rect = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_InjectionList, index); SerializedProperty pair = injectionList.serializedProperty.GetArrayElementAtIndex(index); EditorGUI.PropertyField(rect, pair); }
public override void OnInspectorGUI() { serializedObject.Update(); EZEditorGUIUtility.ScriptTitle(target); EditorGUILayout.PropertyField(m_Loop); EditorGUILayout.PropertyField(m_RestartOnEnable); phaseList.DoLayoutList(); serializedObject.ApplyModifiedProperties(); }
protected void OnGUI() { EZEditorGUIUtility.WindowTitle(this); showAssets = (AssetsViewOption)EditorGUILayout.EnumPopup("Show Assets", showAssets); showDependencies = (BundleDependenciesViewOption)EditorGUILayout.EnumPopup("Show Dependencies", showDependencies); scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition); DrawAssetBundleManager(showAssets, showDependencies); EditorGUILayout.EndScrollView(); }
private void DrawCopyListHeader(Rect rect) { rect = EZEditorGUIUtility.DrawReorderableListCount(rect, copyList); rect.y += 1; float width = rect.width / 2; float margin = 5; EditorGUI.LabelField(new Rect(rect.x, rect.y, width - margin, rect.height), "Destination"); rect.x += width; EditorGUI.LabelField(new Rect(rect.x, rect.y, width - margin, rect.height), "Source"); }
protected void DrawItemListHeader(Rect rect) { rect = EZEditorGUIUtility.DrawReorderableListCount(rect, itemList); Rect keyRect, valueRect; SplitRect(rect, out keyRect, out valueRect); DrawKeyLabel(keyRect); DrawValueLabel(valueRect); }
public override void OnInspectorGUI() { serializedObject.Update(); EZEditorGUIUtility.ScriptTitle(target); DrawController(); EditorGUILayout.PropertyField(m_Loop); EditorGUILayout.PropertyField(m_RestartOnEnable); EditorGUILayout.PropertyField(m_UpdateMode); DrawSegmentList(); serializedObject.ApplyModifiedProperties(); }
protected static void DrawPropertyListHeader(Rect rect, ReorderableList list) { rect = EZEditorGUIUtility.CalcReorderableListHeaderRect(rect, list); float margin = 2; float width = (rect.width - margin) / 2; rect.width = width; EditorGUI.LabelField(rect, "PropertyName"); rect.x += width + margin; EditorGUI.LabelField(rect, "Value"); }
public override void OnInspectorGUI() { EZEditorGUIUtility.ScriptableObjectTitle(target as ScriptableObject); serializedObject.Update(); scrollPosition = GUILayout.BeginScrollView(scrollPosition); itemList.DoLayoutList(); GUILayout.EndScrollView(); serializedObject.ApplyModifiedProperties(); }
private void DrawPropertyListHeader(Rect rect, ReorderableList list) { rect = EZEditorGUIUtility.CalcReorderableListHeaderRect(rect, list); float margin = 2; float width = (rect.width - margin * 2) / 3; rect.width = width; EditorGUI.LabelField(rect, "PropertyName"); rect.x += width + margin; EditorGUI.LabelField(rect, "StartValue"); rect.x += width + margin; EditorGUI.LabelField(rect, "EndValue"); }
public override void OnInspectorGUI() { serializedObject.Update(); EZEditorGUIUtility.ScriptableObjectTitle(target as ScriptableObject, !serializedObject.isEditingMultipleObjects); if (!serializedObject.isEditingMultipleObjects) { EditorGUILayout.LabelField("Build", EditorStyles.boldLabel); EditorGUILayout.PropertyField(m_BuildTarget); if (GUILayout.Button("Build")) { EditorApplication.delayCall += delegate() { bundleBuilder.Execute((BuildTarget)m_BuildTarget.intValue); }; } EditorGUILayout.Space(); DrawQuickBuildButtons(); EditorGUILayout.Space(); } EditorGUILayout.LabelField("Build Options", EditorStyles.boldLabel); DrawBaseProperties(); 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(); }
public override void OnInspectorGUI() { serializedObject.Update(); EZEditorGUIUtility.ScriptableObjectTitle(target as ScriptableObject, false); EditorGUILayout.Space(); EditorGUILayout.LabelField("Float Properties", EditorStyles.boldLabel); floatPropertyList.DoLayoutList(); EditorGUILayout.LabelField("Color Properties", EditorStyles.boldLabel); colorPropertyList.DoLayoutList(); EditorGUILayout.LabelField("Vector Properties", EditorStyles.boldLabel); vectorPropertyList.DoLayoutList(); serializedObject.ApplyModifiedProperties(); }
private void DrawCopyListElement(Rect rect, int index, bool isActive, bool isFocused) { rect = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_CopyList, index); rect.y += 1; rect.height = EditorGUIUtility.singleLineHeight; SerializedProperty m_CopyInfo = m_CopyList.GetArrayElementAtIndex(index); SerializedProperty m_DestDirPath = m_CopyInfo.FindPropertyRelative("dstPath"); SerializedProperty m_SrcDirPath = m_CopyInfo.FindPropertyRelative("srcPath"); float width = rect.width / 2; float margin = 5; EditorGUI.PropertyField(new Rect(rect.x, rect.y, width - margin, rect.height), m_DestDirPath, GUIContent.none); rect.x += width; EditorGUI.PropertyField(new Rect(rect.x, rect.y, width - margin, rect.height), m_SrcDirPath, GUIContent.none); }
private void DrawBundleListHeader(Rect rect) { rect = EZEditorGUIUtility.DrawReorderableListCount(rect, bundleList); rect.y += 1; float width = Mathf.Min(100, rect.width / 4); float residue = (rect.width - width * 4) / 10; float margin = 5; EditorGUI.LabelField(new Rect(rect.x, rect.y, width + residue - margin, rect.height), "Bundle Name"); rect.x += width + residue; EditorGUI.LabelField(new Rect(rect.x, rect.y, width + residue - margin, rect.height), "File Pattern"); rect.x += width + residue; EditorGUI.LabelField(new Rect(rect.x, rect.y, width + residue - margin, rect.height), "Search Option"); rect.x += width + residue; EditorGUI.LabelField(new Rect(rect.x, rect.y, width + residue * 7 - margin, rect.height), "Source"); }
protected static void DrawPropertyListElement(Rect rect, int index, ReorderableList list) { SerializedProperty element = list.serializedProperty.GetArrayElementAtIndex(index); SerializedProperty propertyName = element.FindPropertyRelative("propertyName"); SerializedProperty value = element.FindPropertyRelative("value"); rect = EZEditorGUIUtility.DrawReorderableListIndex(rect, index, list); float margin = 2; float width = (rect.width - margin) / 2; rect.width = width; rect.height = EditorGUIUtility.singleLineHeight; EditorGUI.PropertyField(rect, propertyName, GUIContent.none); rect.x += width + margin; EditorGUI.PropertyField(rect, value, GUIContent.none); }
public override void OnGUI(Rect position, MaterialProperty prop, string label, MaterialEditor editor) { if (!IsPropertyTypeSuitable(prop)) { EditorGUI.HelpBox(position, "EZMinMaxSlider used on a non-vector property: " + prop.name, MessageType.Warning); return; } float oldLabelWidth = EditorGUIUtility.labelWidth; EditorGUIUtility.labelWidth = 0; position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), new GUIContent(label)); EditorGUIUtility.labelWidth = oldLabelWidth; if (!fixedLimit) { showAsVectorValue = EditorGUI.Foldout(new Rect(position) { width = 0 }, showAsVectorValue, GUIContent.none, false); } if (showAsVectorValue) { editor.VectorProperty(position, prop, ""); } else { Vector4 value = prop.vectorValue; if (!fixedLimit) { limitMin = value.z; limitMax = value.w; } EditorGUI.showMixedValue = prop.hasMixedValue; EditorGUI.BeginChangeCheck(); value = EZEditorGUIUtility.MinMaxSliderV4(position, value, limitMin, limitMax); if (EditorGUI.EndChangeCheck()) { prop.vectorValue = value; } EditorGUI.showMixedValue = false; } }
private void DrawPropertyListElement(Rect rect, SerializedProperty listProperty, int index, bool isActive, bool isFocused) { SerializedProperty element = listProperty.GetArrayElementAtIndex(index); SerializedProperty propertyName = element.FindPropertyRelative("propertyName"); SerializedProperty startValue = element.FindPropertyRelative("startValue"); SerializedProperty endValue = element.FindPropertyRelative("endValue"); rect = EZEditorGUIUtility.DrawReorderableListIndex(rect, listProperty, index); float margin = 2; float width = (rect.width - margin * 2) / 3; rect.width = width; rect.height = EditorGUIUtility.singleLineHeight; EditorGUI.PropertyField(rect, propertyName, GUIContent.none); rect.x += width + margin; EditorGUI.PropertyField(rect, startValue, GUIContent.none); rect.x += width + margin; EditorGUI.PropertyField(rect, endValue, GUIContent.none); }
private void DrawBundleListElement(Rect rect, int index, bool isActive, bool isFocused) { rect = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_BundleList, index); rect.y += 1; rect.height = EditorGUIUtility.singleLineHeight; 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; float margin = 5; EditorGUI.PropertyField(new Rect(rect.x, rect.y, width + residue - margin, rect.height), m_BundleName, GUIContent.none); rect.x += width + residue; EditorGUI.PropertyField(new Rect(rect.x, rect.y, width + residue - margin, rect.height), m_FilePattern, GUIContent.none); rect.x += width + residue; EditorGUI.PropertyField(new Rect(rect.x, rect.y, width + residue - margin, rect.height), m_SearchOption, GUIContent.none); rect.x += width + residue; EditorGUI.PropertyField(new Rect(rect.x, rect.y, width + residue * 7 - margin, rect.height), m_SrcDirPath, GUIContent.none); }
public override void OnInspectorGUI() { serializedObject.Update(); EZEditorGUIUtility.ScriptableObjectTitle(target as ScriptableObject, !serializedObject.isEditingMultipleObjects); EditorGUILayout.Space(); EditorGUILayout.LabelField("File Settings", EditorStyles.boldLabel); DrawFileSettings(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Texture Settings", EditorStyles.boldLabel); DrawTextureSettings(); EditorGUILayout.Space(); DrawGenerateButton(); serializedObject.ApplyModifiedProperties(); if (GUI.changed) { RefreshPreview(); } }
public override void OnInspectorGUI() { EZEditorGUIUtility.MonoBehaviourTitle(effect); effect.camera.depthTextureMode = (DepthTextureMode)EditorGUILayout.EnumFlagsField("Camera Depth Texture Mode", effect.camera.depthTextureMode); materialEditor.PropertiesGUI(); }
protected void DrawElementListHeader(Rect rect) { rect = EZEditorGUIUtility.DrawReorderableListCount(rect, elementList); EditorGUI.LabelField(rect, "Elements"); }