private void OnEnable() { _inputEvents = serializedObject.FindProperty("_inputEvents"); _plusButtonContent = new GUIContent(EditorGUIUtility.Load("ol plus.png") as Texture, "Insert a new event after this one."); _minusButtonContent = new GUIContent(EditorGUIUtility.Load("ol minus.png") as Texture, "Delete this event."); _eventManager = (InputEventManager)target; }
static bool HorizontalScope_HorizontalScope5(JSVCall vc, int argc) { int _this = JSApi.getObject((int)JSApi.GetType.Arg); JSApi.attachFinalizerObject(_this); --argc; int len = argc; if (len == 3) { UnityEngine.GUIContent arg0 = (UnityEngine.GUIContent)JSMgr.datax.getObject((int)JSApi.GetType.Arg); UnityEngine.GUIStyle arg1 = (UnityEngine.GUIStyle)JSMgr.datax.getObject((int)JSApi.GetType.Arg); UnityEngine.GUILayoutOption[] arg2 = JSDataExchangeMgr.GetJSArg <UnityEngine.GUILayoutOption[]>(() => { int jsObjID = JSApi.getObject((int)JSApi.GetType.Arg); int length = JSApi.getArrayLength(jsObjID); var ret = new UnityEngine.GUILayoutOption[length]; for (var i = 0; i < length; i++) { JSApi.getElement(jsObjID, i); ret[i] = (UnityEngine.GUILayoutOption)JSMgr.datax.getObject((int)JSApi.GetType.SaveAndRemove); } return(ret); }); JSMgr.addJSCSRel(_this, new UnityEngine.GUILayout.HorizontalScope(arg0, arg1, arg2)); } return(true); }
public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) { float value = 0f; if (property.propertyType == SerializedPropertyType.Float) { value = property.floatValue; isNumericValue = true; } else if (property.propertyType == SerializedPropertyType.Integer) { value = (float)property.intValue; isNumericValue = true; } else { isNumericValue = false; } if (isNumericValue) { ProgressBarAttribute barAttribute = (ProgressBarAttribute)attribute; EditorGUI.BeginProperty(position, label, property); EditorGUI.ProgressBar(position, (value / barAttribute.max), label.text); EditorGUI.EndProperty(); } else { EditorGUI.BeginProperty(position, label, property); EditorGUI.PropertyField(position, property); EditorGUI.EndProperty(); } }
public override void OnGUI (Rect pos, SerializedProperty prop, GUIContent label) { SerializedProperty selection = prop.FindPropertyRelative("selection"); SerializedProperty gameObject = prop.FindPropertyRelative("gameObject"); CacheOwnerGameObject(prop.serializedObject); // draw the enum popup Field int oldEnumIndex = selection.enumValueIndex; EditorGUI.PropertyField( GetRectforRow(pos,0), selection,new GUIContent("Target"),true); if (oldEnumIndex !=selection.enumValueIndex) { if (selection.enumValueIndex==1) { gameObject.objectReferenceValue = ownerGameObject; } } if (selection.enumValueIndex==1) { EditorGUI.indentLevel++; EditorGUI.PropertyField( GetRectforRow(pos,1), gameObject,new GUIContent("Game Object"),true); } }
static bool GUILayoutUtility_GetRect__GUIContent__GUIStyle__GUILayoutOption_Array(JSVCall vc, int argc) { int len = argc; if (len == 3) { UnityEngine.GUIContent arg0 = (UnityEngine.GUIContent)JSMgr.datax.getObject((int)JSApi.GetType.Arg); UnityEngine.GUIStyle arg1 = (UnityEngine.GUIStyle)JSMgr.datax.getObject((int)JSApi.GetType.Arg); UnityEngine.GUILayoutOption[] arg2 = JSDataExchangeMgr.GetJSArg <UnityEngine.GUILayoutOption[]>(() => { int jsObjID = JSApi.getObject((int)JSApi.GetType.Arg); int length = JSApi.getArrayLength(jsObjID); var ret = new UnityEngine.GUILayoutOption[length]; for (var i = 0; i < length; i++) { JSApi.getElement(jsObjID, i); ret[i] = (UnityEngine.GUILayoutOption)JSMgr.datax.getObject((int)JSApi.GetType.SaveAndRemove); } return(ret); }); JSMgr.datax.setObject((int)JSApi.SetType.Rval, UnityEngine.GUILayoutUtility.GetRect(arg0, arg1, arg2)); } return(true); }
public override float GetPropertyHeight(SerializedProperty _property, GUIContent _label) { if (_property.isArray) return EditorGUI.GetPropertyHeight(_property); return EditorGUI.GetPropertyHeight(_property) + kButtonHeight + kOffset; }
/// <summary> /// Override this method to make your own GUI for the property /// </summary> /// <param name="position">Position</param> /// <param name="prop">Property</param> /// <param name="label">Label</param> public override void OnGUI(Rect position, SerializedProperty prop, GUIContent label) { label = EditorGUI.BeginProperty(position, label, prop); position.height = EditorGUIUtility.singleLineHeight; Rect contents = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); FindProperties(prop); // Draw the preview texture Rect textureRect = new Rect(contents); textureRect.x += textureRect.width - PREVIEW_TEXTURE_SIZE; textureRect.width = PREVIEW_TEXTURE_SIZE; textureRect.height = PREVIEW_TEXTURE_SIZE; EditorGUI.BeginChangeCheck(); HydraEditorUtils.DrawUnindented( () => HydraEditorUtils.TextureField(textureRect, GUIContent.none, m_TextureProp, true)); // Draw the fields Rect contentRect = new Rect(contents); contentRect.width -= textureRect.width + HydraEditorUtils.STANDARD_HORIZONTAL_SPACING * 2.0f; HydraEditorUtils.DrawUnindented( () => HydraEditorUtils.EnumPopupField<Texture2DAttribute.Wrap>(contentRect, GUIContent.none, m_WrapProp, HydraEditorGUIStyles.enumStyle)); // Clear the cache if the texture changes if (EditorGUI.EndChangeCheck()) m_WrappedTextureProp.objectReferenceValue = null; EditorGUI.EndProperty(); }
internal float GetPropertyHeightSafe(SerializedProperty property, GUIContent label) { ScriptAttributeUtility.s_DrawerStack.Push(this); float propertyHeight = this.GetPropertyHeight(property, label); ScriptAttributeUtility.s_DrawerStack.Pop(); return propertyHeight; }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { var valueProp = property.FindPropertyRelative("_value"); var value = EditorGUI.FloatField(position, label, valueProp.floatValue); //if the value increased ever so much, ceil the value, good for the mouse scroll valueProp.floatValue = NormalizeValue(valueProp.floatValue, value); }
public MenuItem(GUIContent _content, bool _separator, bool _on, GenericMenu.MenuFunction _func) { this.content = _content; this.separator = _separator; this.on = _on; this.func = _func; }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { var left = position; left.xMax -= 40; var right = position; right.xMin = left.xMax + 2; EditorGUI.PropertyField(left, property); if (GUI.Button(right, "List") == true) { var menu = new GenericMenu(); if (LeanLocalization.Instance != null) { for (var j = 0; j < LeanLocalization.Instance.Languages.Count; j++) { var language = LeanLocalization.Instance.Languages[j]; menu.AddItem(new GUIContent(language), property.stringValue == language, () => { property.stringValue = language; property.serializedObject.ApplyModifiedProperties(); }); } } if (menu.GetItemCount() > 0) { menu.DropDown(right); } else { Debug.LogWarning("Your scene doesn't contain any languages, so the language name list couldn't be created."); } } }
public void SplitArea(GUIContent content, GUIStyle style) { GUIStyle borderStyle = new GUIStyle(); GUILayout.EndArea(); if(_horizontal) { borderStyle.normal.background = EditorGUIUtility.LoadRequired("AreaHBorder.png") as Texture2D; _auxRect.Set(_used, 0f, 4f, Screen.height); GUILayout.BeginArea(_auxRect, borderStyle); _auxRect.x = 0f; EditorGUIUtility.AddCursorRect(_auxRect, MouseCursor.SplitResizeLeftRight); } else { borderStyle.normal.background = EditorGUIUtility.LoadRequired("AreaVBorder.png") as Texture2D; _auxRect.Set(0f, _used, Screen.width, 4f); GUILayout.BeginArea(_auxRect, borderStyle); _auxRect.y = 0f; EditorGUIUtility.AddCursorRect(_auxRect, MouseCursor.SplitResizeUpDown); } _used += 4f; ProcessInputMouse(); GUILayout.EndArea(); GUILayout.BeginArea(NextRect, content, style); }
public override void OnGUI(Rect position, SerializedProperty prop, GUIContent label) { EditorGUI.BeginProperty(position, label, prop); int indent = EditorGUI.indentLevel; EditorGUI.indentLevel = 0; position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), new GUIContent(label.text, (attribute as SingleLineAttribute).Tooltip)); const float labelWidth = 32.0f; float widthAvailable = position.width - (labelWidth * 2.0f); float textFieldWidth = widthAvailable * 0.5f; switch (prop.type) { case "RangeOfIntegers": DrawRangeField(position, labelWidth, textFieldWidth, prop, false); break; case "RangeOfFloats": DrawRangeField(position, labelWidth, textFieldWidth, prop, true); break; default: EditorGUI.HelpBox(position, "[Compact] doesn't work with type '" + prop.type + "'", MessageType.Error); break; } EditorGUI.indentLevel = indent; EditorGUI.EndProperty(); }
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { float height = base.GetPropertyHeight(property, label); CheckRequiredComponents(property.GetValue<EntityBehaviour>()); return height; }
public int BunnyMask(GUIContent content, Enum enumValue) { var enumType = enumValue.GetType(); var enumNames = Enum.GetNames(enumType); var enumValues = Enum.GetValues(enumType) as int[]; return BunnyMask(content, Convert.ToInt32(enumValue), enumValues, enumNames); }
protected override void OnRender() { //GUI.skin.label.onNormal. var options = GetOptions().ToArray(); var content = new GUIContent(Text, Image, Toolip); var oldFontStyle = GUI.skin.label.fontStyle; if (Style != (FontStyle)(-1)) { GUI.skin.label.fontStyle = Style; } var oldAlign = GUI.skin.label.alignment; GUI.skin.label.alignment = Align; var oldColor = GUI.skin.label.normal.textColor; if (TextColor.a > 1e-4) { GUI.skin.label.normal.textColor = TextColor; } GUILayout.Label(content, options); if (TextColor.a > 1e-4) { GUI.skin.label.normal.textColor = oldColor; } GUI.skin.label.alignment = oldAlign; if (Style != (FontStyle)(-1)) { GUI.skin.label.fontStyle = oldFontStyle; } }
public override void OnGUI(Rect _position, SerializedProperty _property, GUIContent _label) { string valueStr; switch (_property.propertyType) { case SerializedPropertyType.Integer: valueStr = _property.intValue.ToString(); break; case SerializedPropertyType.Boolean: valueStr = _property.boolValue.ToString(); break; case SerializedPropertyType.Float: valueStr = _property.floatValue.ToString("0.00000"); break; case SerializedPropertyType.String: valueStr = _property.stringValue; break; case SerializedPropertyType.Enum: valueStr = _property.enumDisplayNames[_property.enumValueIndex]; break; case SerializedPropertyType.Vector2: valueStr = _property.vector2Value.ToString(); break; case SerializedPropertyType.Vector3: valueStr = _property.vector3Value.ToString(); break; default: valueStr = "(not supported)"; break; } EditorGUI.LabelField(_position, _label.text + ":", valueStr); }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { var spaceAttribute = attribute as SpaceAttribute; position.y += spaceAttribute.space; position.height -= spaceAttribute.space; EditorGUI.PropertyField(position, property, label); }
public override void OnGUI(Rect rect, SerializedProperty prop, GUIContent label) { Rect position = rect; position.height = EditorGUIUtility.singleLineHeight; SerializedProperty property = prop.FindPropertyRelative("m_NormalTrigger"); SerializedProperty property2 = prop.FindPropertyRelative("m_HighlightedTrigger"); SerializedProperty property3 = prop.FindPropertyRelative("m_PressedTrigger"); SerializedProperty property4 = prop.FindPropertyRelative("m_ActiveTrigger"); SerializedProperty property5 = prop.FindPropertyRelative("m_ActiveHighlightedTrigger"); SerializedProperty property6 = prop.FindPropertyRelative("m_ActivePressedTrigger"); SerializedProperty property7 = prop.FindPropertyRelative("m_DisabledTrigger"); EditorGUI.PropertyField(position, property); position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; EditorGUI.PropertyField(position, property2); position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; EditorGUI.PropertyField(position, property3); position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; EditorGUI.PropertyField(position, property4); position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; EditorGUI.PropertyField(position, property5); position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; EditorGUI.PropertyField(position, property6); position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; EditorGUI.PropertyField(position, property7); }
/** Draws an integer field */ public int IntField (GUIContent label, int value, int offset, int adjust, out Rect r) { GUIStyle intStyle = EditorStyles.numberField; EditorGUILayoutx.BeginIndent (); Rect r1 = GUILayoutUtility.GetRect (label,intStyle); Rect r2 = GUILayoutUtility.GetRect (new GUIContent (value.ToString ()),intStyle); EditorGUILayoutx.EndIndent(); r2.width += (r2.x-r1.x); r2.x = r1.x+offset; r2.width -= offset+offset+adjust; r = new Rect (); r.x = r2.x+r2.width; r.y = r1.y; r.width = offset; r.height = r1.height; GUI.SetNextControlName ("IntField_"+label.text); value = EditorGUI.IntField (r2,"",value); bool on = GUI.GetNameOfFocusedControl () == "IntField_"+label.text; if (Event.current.type == EventType.Repaint) { intStyle.Draw (r1,label,false,false,false,on); } return value; }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { EditorGUI.BeginProperty(position, label, property); { if (EditorGUI.PropertyField(position, property)) { EditorGUILayout.PropertyField(property.FindPropertyRelative("type")); switch (property.FindPropertyRelative("type").enumValueIndex) { case 0: // None break; case 1: // Sphere EditorGUILayout.PropertyField(property.FindPropertyRelative("center")); EditorGUILayout.PropertyField(property.FindPropertyRelative("radius")); EditorGUILayout.PropertyField(property.FindPropertyRelative("physicsMaterial")); break; case 2: // Box EditorGUILayout.PropertyField(property.FindPropertyRelative("center")); EditorGUILayout.PropertyField(property.FindPropertyRelative("size")); EditorGUILayout.PropertyField(property.FindPropertyRelative("physicsMaterial")); break; case 3: // Capsule EditorGUILayout.PropertyField(property.FindPropertyRelative("center")); EditorGUILayout.PropertyField(property.FindPropertyRelative("direction")); EditorGUILayout.PropertyField(property.FindPropertyRelative("radius")); EditorGUILayout.PropertyField(property.FindPropertyRelative("height")); EditorGUILayout.PropertyField(property.FindPropertyRelative("physicsMaterial")); break; } } } EditorGUI.EndProperty(); }
public override UnityObject Object(GUIContent content, UnityObject value, System.Type type, bool allowSceneObjects, Layout option) { // If we pass an empty content, ObjectField will still reserve space for an empty label ~__~ return string.IsNullOrEmpty(content.text) ? EditorGUILayout.ObjectField(value, type, allowSceneObjects, option) : EditorGUILayout.ObjectField(content, value, type, allowSceneObjects, option); }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { rtpc = property.GetValue<AudioRTPC>(); Begin(position, property, label); string rtpcName = string.Format("{4}{0} | {1} [{2}, {3}]", rtpc.Name, rtpc.Type, rtpc.MinValue, rtpc.MaxValue, rtpc.Scope == AudioRTPC.RTPCScope.Global ? "*" : ""); PropertyField(property, rtpcName.ToGUIContent(), false); if (property.isExpanded) { EditorGUI.indentLevel++; PropertyField(property.FindPropertyRelative("Scope"), GUIContent.none); PropertyField(property.FindPropertyRelative("Name")); PropertyField(property.FindPropertyRelative("Type")); PropertyField(property.FindPropertyRelative("MinValue")); PropertyField(property.FindPropertyRelative("MaxValue")); PropertyField(property.FindPropertyRelative("Curve")); EditorGUI.indentLevel--; } End(); }
public static bool Foldout(bool open, GUIContent header, Action content) { if (foldoutStyle == null) { foldoutStyle = new GUIStyle(GUI.skin.FindStyle("ShurikenModuleBg")); foldoutStyle.padding = new RectOffset(10, 10, 10, 10); headerStyle = new GUIStyle(GUI.skin.FindStyle("ShurikenModuleTitle")); headerStyle.contentOffset = new Vector2(3, -2); } GUILayout.BeginVertical("ShurikenEffectBg", GUILayout.MinHeight(1f)); open = GUI.Toggle(GUILayoutUtility.GetRect(0, 16), open, header, headerStyle); if (open) { GUILayout.BeginVertical(foldoutStyle); content(); GUILayout.EndVertical(); } GUILayout.EndVertical(); return open; }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { EditorGUI.PropertyField(position, property, label, includeChildren: true); var attribute = PropertyExtensions.GetAttribute<BeginGroupAttribute>(this); var otherProp = PropertyExtensions.GetRelativeProperty(property, property.propertyPath, attribute.otherFieldName); var isNull = false; if (property.propertyType == SerializedPropertyType.ObjectReference) { isNull = (property.objectReferenceValue == null); } if (isNull == true && otherProp != null) { if (otherProp.propertyType == SerializedPropertyType.ObjectReference) { isNull = (otherProp.objectReferenceValue == null); } } ++EditorGUI.indentLevel; EditorGUI.BeginDisabledGroup(isNull); CustomGUI.Splitter(); }
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { float height = 0f; // since no stylesheet title (yet) /** * NOTE: This is weird (the following 3 lines * I commented out these on 20131129 because eDrivenGuiStyleSheet didn't render properly * (measured height of each declaration was zero) * It's weird because it worked fine with eDrivenStyleSheet and they both have the same base class * */ /*if (!property.isExpanded) { return height; }*/ SerializedProperty declarations = property.FindPropertyRelative("Declarations"); int size = declarations.arraySize; if (size == 0) { return height; // +16f; } for (int i = 0; i < size; i++) { height += EditorGUI.GetPropertyHeight(declarations.GetArrayElementAtIndex(i)); } // gaps if (size > 0) height += VerticalGap*(size - 1); return height; }
/// <summary> /// Gets the total height of this editor. /// </summary> /// <param name="property">Property to get the total height of the editor for.</param> /// <param name="label">The parameter is not used.</param> /// <returns>Total height of this editor.</returns> public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { SerializedProperty sourceProperty = this.GetSourceProperty(property); SerializedProperty memberProperty = this.GetMemberProperty(property); return EditorGUI.GetPropertyHeight(sourceProperty) + EditorGUI.GetPropertyHeight(memberProperty); }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { drawPrefixLabel = false; Begin(position, property, label); float min = ((SliderAttribute)attribute).min; float max = ((SliderAttribute)attribute).max; EditorGUI.BeginChangeCheck(); currentPosition.height = 16; object value = property.GetValue(); if (value is int) { property.SetValue(EditorGUI.IntSlider(currentPosition, label, (int)value, (int)min, (int)max)); } else if (value is float) { property.SetValue(EditorGUI.Slider(currentPosition, label, (float)value, min, max)); } else if (value is double) { property.SetValue(EditorGUI.Slider(currentPosition, label, (float)(double)value, min, max)); } else { EditorGUI.HelpBox(currentPosition, "The type of the field must be numerical.", MessageType.Error); } if (EditorGUI.EndChangeCheck()) { property.Clamp(min, max); } End(); }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { if (list == null) initList(property, label); list.serializedProperty = property.FindPropertyRelative("tagList"); list.DoList(position); }
private static eProp DoPropSwitchDraw(Rect pos, SerProp prop, GUICon cont, bool includeChildren, eProp data) { switch (prop.propertyType) { case SerializedPropertyType.Quaternion: case SerializedPropertyType.Vector4: Vector4PropEditor.Draw(pos, prop, cont); return(data); case SerializedPropertyType.Vector3: Vector3PropEditor.Draw(pos, prop, cont); return(data); case SerializedPropertyType.Vector2: Vector2PropEditor.Draw(pos, prop, cont); return(data); default: EditorGUI.PropertyField(pos, prop, cont, includeChildren); return(data); } }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { if (IsEnabled) { var propertyType = fieldInfo.FieldType; var target = fiSerializedPropertyUtility.GetTarget(property); var metadata = fiSerializedPropertyUtility.GetMetadata(property); var editor = PropertyEditor.Get(propertyType, fieldInfo).FirstEditor; if (property.prefabOverride) fiUnityInternalReflection.SetBoldDefaultFont(true); var savedHierarchyMode = EditorGUIUtility.hierarchyMode; EditorGUIUtility.hierarchyMode = true; EditorGUI.BeginChangeCheck(); target = editor.Edit(position, label, target, metadata); if (EditorGUI.EndChangeCheck()) { fiSerializedPropertyUtility.WriteTarget(property, target); EditorUtility.SetDirty(property.serializedObject.targetObject); } EditorGUIUtility.hierarchyMode = savedHierarchyMode; if (property.prefabOverride) fiUnityInternalReflection.SetBoldDefaultFont(false); fiSerializedPropertyUtility.RevertPrefabContextMenu(position, property); return; } EditorGUI.PropertyField(position, property, label); }
private void DrawExtraFeatures() { if (icon == null) { string iconFilename = EditorGUIUtility.isProSkin ? DarkSkinIconFilename : LightSkinIconFilename; icon = AssetDatabase.LoadAssetAtPath(iconFilename, typeof(Texture2D)) as Texture2D; } if (dialogueSystemController == null || icon == null) return; if (iconButtonStyle == null) { iconButtonStyle = new GUIStyle(EditorStyles.label); iconButtonStyle.normal.background = icon; iconButtonStyle.active.background = icon; } if (iconButtonContent == null) { iconButtonContent = new GUIContent(string.Empty, "Click to open Dialogue Editor."); } GUILayout.BeginHorizontal(); if (GUILayout.Button(iconButtonContent, iconButtonStyle, GUILayout.Width(icon.width), GUILayout.Height(icon.height))) { Selection.activeObject = dialogueSystemController.initialDatabase; PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.OpenDialogueEditorWindow(); } GUILayout.FlexibleSpace(); if (GUILayout.Button("Wizard...", GUILayout.Width(64))) { DialogueManagerWizard.Init(); } GUILayout.EndHorizontal(); EditorWindowTools.DrawHorizontalLine(); }
public override void Initialize(SerializedProperty property, GUIContent label) { base.Initialize(property, label); if (groupData == null) InitializeGroups(); }
public static bool ButtonWithDropdownList(UnityEngine.GUIContent content, string[] buttonNames, UnityEditor.GenericMenu.MenuFunction2 callback, params UnityEngine.GUILayoutOption[] options) { if (__ButtonWithDropdownList_1_4 == null) { __ButtonWithDropdownList_1_4 = (Func <UnityEngine.GUIContent, string[], UnityEditor.GenericMenu.MenuFunction2, UnityEngine.GUILayoutOption[], bool>)Delegate.CreateDelegate(typeof(Func <UnityEngine.GUIContent, string[], UnityEditor.GenericMenu.MenuFunction2, UnityEngine.GUILayoutOption[], bool>), null, UnityTypes.UnityEditor_EditorGUI.GetMethod("ButtonWithDropdownList", R.StaticMembers, null, new Type[] { typeof(UnityEngine.GUIContent), typeof(string[]), typeof(UnityEditor.GenericMenu.MenuFunction2), typeof(UnityEngine.GUILayoutOption[]) }, null)); } return(__ButtonWithDropdownList_1_4(content, buttonNames, callback, options)); }
public virtual bool OnGUILayout(UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, bool includeChildren, UnityEngine.GUILayoutOption[] options) { if (_imp_OnGUILayout == null) { _imp_OnGUILayout = _internalPropertyHandler.GetMethod("OnGUILayout", typeof(System.Func <SerializedProperty, GUIContent, bool, GUILayoutOption[], bool>)) as System.Func <SerializedProperty, GUIContent, bool, GUILayoutOption[], bool>; } return(_imp_OnGUILayout(property, label, includeChildren, options)); }
public static float CalcPrefixLabelWidth(UnityEngine.GUIContent label, UnityEngine.GUIStyle style = null) { if (__CalcPrefixLabelWidth_0_2 == null) { __CalcPrefixLabelWidth_0_2 = (Func <UnityEngine.GUIContent, UnityEngine.GUIStyle, float>)Delegate.CreateDelegate(typeof(Func <UnityEngine.GUIContent, UnityEngine.GUIStyle, float>), null, UnityTypes.UnityEditor_EditorGUI.GetMethod("CalcPrefixLabelWidth", R.StaticMembers, null, new Type[] { typeof(UnityEngine.GUIContent), typeof(UnityEngine.GUIStyle) }, null)); } return(__CalcPrefixLabelWidth_0_2(label, style)); }
public virtual float GetHeight(UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, bool includeChildren) { if (_imp_GetHeight == null) { _imp_GetHeight = _internalPropertyHandler.GetMethod("GetHeight", typeof(System.Func <SerializedProperty, GUIContent, bool, float>)) as System.Func <SerializedProperty, GUIContent, bool, float>; } return(_imp_GetHeight(property, label, includeChildren)); }
public static int Popup(UnityEngine.Rect position, UnityEngine.GUIContent label, int selectedIndex, UnityEngine.GUIContent[] displayedOptions, UnityEngine.GUIStyle style) { if (__Popup_11_5 == null) { __Popup_11_5 = (Func <UnityEngine.Rect, UnityEngine.GUIContent, int, UnityEngine.GUIContent[], UnityEngine.GUIStyle, int>)Delegate.CreateDelegate(typeof(Func <UnityEngine.Rect, UnityEngine.GUIContent, int, UnityEngine.GUIContent[], UnityEngine.GUIStyle, int>), null, UnityTypes.UnityEditor_EditorGUI.GetMethod("Popup", R.StaticMembers, null, new Type[] { typeof(UnityEngine.Rect), typeof(UnityEngine.GUIContent), typeof(int), typeof(UnityEngine.GUIContent[]), typeof(UnityEngine.GUIStyle) }, null)); } return(__Popup_11_5(position, label, selectedIndex, displayedOptions, style)); }
public static System.Enum EnumFlagsField(UnityEngine.Rect position, UnityEngine.GUIContent label, System.Enum enumValue, System.Type enumType, bool includeObsolete, ref int changedFlags, ref bool changedToValue, UnityEngine.GUIStyle style) { if (__EnumFlagsField_8_8 == null) { __EnumFlagsField_8_8 = (Method_EnumFlagsField_8_8)Delegate.CreateDelegate(typeof(Method_EnumFlagsField_8_8), null, UnityTypes.UnityEditor_EditorGUI.GetMethod("EnumFlagsField", R.StaticMembers, null, new Type[] { typeof(UnityEngine.Rect), typeof(UnityEngine.GUIContent), typeof(System.Enum), typeof(System.Type), typeof(bool), typeof(int).MakeByRefType(), typeof(bool).MakeByRefType(), typeof(UnityEngine.GUIStyle) }, null)); } return(__EnumFlagsField_8_8(position, label, enumValue, enumType, includeObsolete, ref changedFlags, ref changedToValue, style)); }
public static int EnumFlagsField(UnityEngine.Rect position, UnityEngine.GUIContent label, int enumValue, System.Type enumType, bool includeObsolete, UnityEngine.GUIStyle style) { if (__EnumFlagsField_9_6 == null) { __EnumFlagsField_9_6 = (Func <UnityEngine.Rect, UnityEngine.GUIContent, int, System.Type, bool, UnityEngine.GUIStyle, int>)Delegate.CreateDelegate(typeof(Func <UnityEngine.Rect, UnityEngine.GUIContent, int, System.Type, bool, UnityEngine.GUIStyle, int>), null, UnityTypes.UnityEditor_EditorGUI.GetMethod("EnumFlagsField", R.StaticMembers, null, new Type[] { typeof(UnityEngine.Rect), typeof(UnityEngine.GUIContent), typeof(int), typeof(System.Type), typeof(bool), typeof(UnityEngine.GUIStyle) }, null)); } return(__EnumFlagsField_9_6(position, label, enumValue, enumType, includeObsolete, style)); }
public static bool FoldoutTitlebar(UnityEngine.Rect position, UnityEngine.GUIContent label, bool foldout, bool skipIconSpacing, UnityEngine.GUIStyle baseStyle, UnityEngine.GUIStyle textStyle) { if (__FoldoutTitlebar_1_6 == null) { __FoldoutTitlebar_1_6 = (Func <UnityEngine.Rect, UnityEngine.GUIContent, bool, bool, UnityEngine.GUIStyle, UnityEngine.GUIStyle, bool>)Delegate.CreateDelegate(typeof(Func <UnityEngine.Rect, UnityEngine.GUIContent, bool, bool, UnityEngine.GUIStyle, UnityEngine.GUIStyle, bool>), null, UnityTypes.UnityEditor_EditorGUI.GetMethod("FoldoutTitlebar", R.StaticMembers, null, new Type[] { typeof(UnityEngine.Rect), typeof(UnityEngine.GUIContent), typeof(bool), typeof(bool), typeof(UnityEngine.GUIStyle), typeof(UnityEngine.GUIStyle) }, null)); } return(__FoldoutTitlebar_1_6(position, label, foldout, skipIconSpacing, baseStyle, textStyle)); }
/// <summary> /// Not yet documented. /// </summary> protected override void DrawPropertyLayout(UnityEngine.GUIContent label) { var entry = this.ValueEntry; var attribute = this.Attribute; this.CallNextDrawer(label); entry.SmartValue = (float)MathUtilities.Wrap(entry.SmartValue, attribute.Min, attribute.Max); }
public static System.Enum EnumFlagsField(UnityEngine.Rect position, UnityEngine.GUIContent label, System.Enum enumValue, UnityEngine.GUIStyle style) { if (__EnumFlagsField_5_4 == null) { __EnumFlagsField_5_4 = (Func <UnityEngine.Rect, UnityEngine.GUIContent, System.Enum, UnityEngine.GUIStyle, System.Enum>)Delegate.CreateDelegate(typeof(Func <UnityEngine.Rect, UnityEngine.GUIContent, System.Enum, UnityEngine.GUIStyle, System.Enum>), null, UnityTypes.UnityEditor_EditorGUI.GetMethod("EnumFlagsField", R.StaticMembers, null, new Type[] { typeof(UnityEngine.Rect), typeof(UnityEngine.GUIContent), typeof(System.Enum), typeof(UnityEngine.GUIStyle) }, null)); } return(__EnumFlagsField_5_4(position, label, enumValue, style)); }
public override float GetPropertyHeight(SerializedProperty property, UnityEngine.GUIContent label) { if (list == null) { list = getList(property.FindPropertyRelative("List")); } return(list.GetHeight()); }
private static float DoPropSwitchHeight(SerProp prop, GUICon cont, bool includeChildren) { switch (prop.propertyType) { case SerializedPropertyType.Quaternion: return(FoCsPropertyDrawer.PropertyHeight(prop, cont)); default: return(EditorGUI.GetPropertyHeight(prop, cont, includeChildren)); } }
public TitleDrawingScope(UnityEngine.Rect rect, UnityEngine.GUIContent label, SerializedFrameSettings serialized) { EditorGUI.BeginProperty(rect, label, serialized.m_RootData); hasOverride = serialized.m_BitOverrides != null; if (hasOverride) { EditorGUI.BeginProperty(rect, label, serialized.m_RootOverrides); } }
private static eProp PropFieldMaster(Rect pos, SerProp prop, GUICon cont, bool includeChildren, AttributeCheck ignoreCheck, bool autoLabelField = false) { if (!autoLabelField) { return(PropDraw(pos, prop, cont, includeChildren, ignoreCheck)); } using (Disposables.LabelFieldSetWidth(pos.width * 0.4f)) return(PropDraw(pos, prop, cont, includeChildren, ignoreCheck)); }
private static GUIEvent LabelMaster(Rect rect, GUICon guiCon, GUIStyle style) { var data = new GUIEvent { Event = new Event(Event.current), Rect = rect }; EditorGUI.LabelField(rect, guiCon, style); return(data); }
public bool GetPosition(ref UnityEngine.Vector2 position, UnityEngine.GUIContent content, UnityEngine.Vector2 size) { _textPosition += Time.deltaTime * _speed; if (_textPosition > 1) { return(false); } position = new Vector2(Screen.width / 2f - size.x / 2f, Mathf.Lerp(Screen.height / 2f + size.y, 0, _textPosition)); return(true); }
static public int get_tooltip(IntPtr l) { try { UnityEngine.GUIContent self = (UnityEngine.GUIContent)checkSelf(l); pushValue(l, true); pushValue(l, self.tooltip); return(2); } catch (Exception e) { return(error(l, e)); } }
static bool GUIStyle_CalcSize__GUIContent(JSVCall vc, int argc) { int len = argc; if (len == 1) { UnityEngine.GUIContent arg0 = (UnityEngine.GUIContent)JSMgr.datax.getObject((int)JSApi.GetType.Arg); JSApi.setVector2S((int)JSApi.SetType.Rval, ((UnityEngine.GUIStyle)vc.csObj).CalcSize(arg0)); } return(true); }
static bool GUILayoutUtility_GetRect__GUIContent__GUIStyle(JSVCall vc, int argc) { int len = argc; if (len == 2) { UnityEngine.GUIContent arg0 = (UnityEngine.GUIContent)JSMgr.datax.getObject((int)JSApi.GetType.Arg); UnityEngine.GUIStyle arg1 = (UnityEngine.GUIStyle)JSMgr.datax.getObject((int)JSApi.GetType.Arg); JSMgr.datax.setObject((int)JSApi.SetType.Rval, UnityEngine.GUILayoutUtility.GetRect(arg0, arg1)); } return(true); }
static int set_none(IntPtr L) { try { UnityEngine.GUIContent arg0 = (UnityEngine.GUIContent)ToLua.CheckObject(L, 2, typeof(UnityEngine.GUIContent)); UnityEngine.GUIContent.none = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static bool GUIUtility_GetControlID__GUIContent__FocusType(JSVCall vc, int argc) { int len = argc; if (len == 2) { UnityEngine.GUIContent arg0 = (UnityEngine.GUIContent)JSMgr.datax.getObject((int)JSApi.GetType.Arg); UnityEngine.FocusType arg1 = (UnityEngine.FocusType)JSApi.getEnum((int)JSApi.GetType.Arg); JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(UnityEngine.GUIUtility.GetControlID(arg0, arg1))); } return(true); }
// fields static void GUIContent_none(JSVCall vc) { if (vc.bGet) { var result = UnityEngine.GUIContent.none; JSMgr.datax.setObject((int)JSApi.SetType.Rval, result); } else { UnityEngine.GUIContent arg0 = (UnityEngine.GUIContent)JSMgr.datax.getObject((int)JSApi.GetType.Arg); UnityEngine.GUIContent.none = arg0; } }
// methods static bool GUIStyle_CalcHeight__GUIContent__Single(JSVCall vc, int argc) { int len = argc; if (len == 2) { UnityEngine.GUIContent arg0 = (UnityEngine.GUIContent)JSMgr.datax.getObject((int)JSApi.GetType.Arg); System.Single arg1 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg); JSApi.setSingle((int)JSApi.SetType.Rval, (System.Single)(((UnityEngine.GUIStyle)vc.csObj).CalcHeight(arg0, arg1))); } return(true); }
//------------------------------------------------------------------------- public static UnityEngine.Object ObjectFieldGuiElement(UnityEngine.GUIContent label, UnityEngine.Object inputValue, System.Type type, bool allowSceneObjects, ref bool hasChanged) { UnityEngine.Object newValue = EditorGUILayout.ObjectField(label, inputValue, type, allowSceneObjects); if (newValue != inputValue) { hasChanged = true; } else { hasChanged = false; } return(newValue); }
static bool GUIStyle_GetCursorStringIndex__Rect__GUIContent__Vector2(JSVCall vc, int argc) { int len = argc; if (len == 3) { UnityEngine.Rect arg0 = (UnityEngine.Rect)JSMgr.datax.getObject((int)JSApi.GetType.Arg); UnityEngine.GUIContent arg1 = (UnityEngine.GUIContent)JSMgr.datax.getObject((int)JSApi.GetType.Arg); UnityEngine.Vector2 arg2 = (UnityEngine.Vector2)JSApi.getVector2S((int)JSApi.GetType.Arg); JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(((UnityEngine.GUIStyle)vc.csObj).GetCursorStringIndex(arg0, arg1, arg2))); } return(true); }
//------------------------------------------------------------------------- public static bool ToggleGuiElement(UnityEngine.GUIContent label, bool inputValue, ref bool hasChanged) { bool newValue = EditorGUILayout.Toggle(label, inputValue); if (newValue != inputValue) { hasChanged = true; } else { hasChanged = false; } return(newValue); }
//------------------------------------------------------------------------- public static float FloatSliderGuiElement(UnityEngine.GUIContent label, float inputValue, float min, float max, ref bool hasChanged) { float newValue = EditorGUILayout.Slider(label, inputValue, min, max); if (newValue != inputValue) { hasChanged = true; } else { hasChanged = false; } return(newValue); }