/*--------------------------------------------------------------------------------------------*/ public override float GetPropertyHeight(SerializedProperty pProp, GUIContent pLabel) { DisableWhenControlledAttribute attrib = (DisableWhenControlledAttribute)attribute; string mapName = attrib.ControllerMapName; ISettingsControllerMap map = EditorUtil.GetControllerMap(pProp.serializedObject, mapName); float propHeight = base.GetPropertyHeight(pProp, pLabel); if (pProp.type == Vector3TypeName) { return(propHeight * (vWidth < MinSingleRowVector3Width ? 2 : 1)); } if (map == null || !attrib.DisplaySpecials) { return(propHeight); } float lineH = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; return(lineH * map.GetControlledCount(true) + propHeight); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected HoverpanelActiveDirection() { Controllers = new SettingsControllerMap(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected HoverRaycastLine() { Controllers = new SettingsControllerMap(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected HoverAlphaFillUpdater() { Controllers = new SettingsControllerMap(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public HoverCursorFollower() { Controllers = new SettingsControllerMap(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public HoverCanvas() { Controllers = new SettingsControllerMap(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected HoverOpaqueMeshUpdater() { Controllers = new SettingsControllerMap(); }
/*--------------------------------------------------------------------------------------------*/ private static float GetMessageHeight(ISettingsControllerMap pMap) { float lineCount = pMap.GetControlledCount()+1.5f; return EditorGUIUtility.singleLineHeight*0.7f*lineCount; }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected HoverLayoutRectGroup() { Controllers = new SettingsControllerMap(); vChildItems = new List <HoverLayoutRectGroupChild>(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected HoverFill() { Controllers = new SettingsControllerMap(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected HoverRenderer() { Controllers = new SettingsControllerMap(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected HoverCanvasDataUpdater() { Controllers = new SettingsControllerMap(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected HoverFillSliderUpdater() { Controllers = new SettingsControllerMap(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public HoverAlphaRendererUpdater() { Controllers = new SettingsControllerMap(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected HoverIndicatorOverrider() { Controllers = new SettingsControllerMap(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public HoverIcon() { Controllers = new SettingsControllerMap(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected HovercastBackCursorTrigger() { Controllers = new SettingsControllerMap(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public HoverLabel() { Controllers = new SettingsControllerMap(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public override void OnGUI(Rect pPosition, SerializedProperty pProp, GUIContent pLabel) { DisableWhenControlledAttribute attrib = (DisableWhenControlledAttribute)attribute; string mapName = attrib.ControllerMapName; SerializedObject self = pProp.serializedObject; ISettingsControllerMap map = EditorUtil.GetControllerMap(self, mapName); bool wasEnabled = GUI.enabled; Rect propRect = pPosition; bool hasRangeMin = (attrib.RangeMin != DisableWhenControlledAttribute.NullRangeMin); bool hasRangeMax = (attrib.RangeMax != DisableWhenControlledAttribute.NullRangeMax); bool isControlled = (map != null && map.IsControlled(pProp.name)); string labelText = pLabel.text; if (map != null && attrib.DisplaySpecials) { List <string> specialValueNames = map.GetNewListOfControlledValueNames(true); Rect specialRect = propRect; specialRect.height = EditorGUIUtility.singleLineHeight; foreach (string specialValueName in specialValueNames) { DrawLinkIcon(self.targetObject, map.Get(specialValueName), specialRect); GUI.enabled = false; EditorGUI.LabelField(specialRect, IconTextPrefix + specialValueName.Substring(1)); GUI.enabled = wasEnabled; specialRect.y += specialRect.height + EditorGUIUtility.standardVerticalSpacing; } propRect.y = specialRect.y; propRect.height = specialRect.height; } if (isControlled) { ISettingsController settingsController = map.Get(pProp.name); DrawLinkIcon(self.targetObject, settingsController, propRect); pLabel.text = IconTextPrefix + labelText; } else { pLabel.text = labelText; } GUI.enabled = !isControlled; vWidth = pPosition.width; if (hasRangeMin && hasRangeMax) { EditorGUI.Slider(propRect, pProp, attrib.RangeMin, attrib.RangeMax, pLabel); } else { EditorGUI.PropertyField(propRect, pProp, pLabel, true); if (hasRangeMin) { pProp.floatValue = Mathf.Max(pProp.floatValue, attrib.RangeMin); } else if (hasRangeMax) { pProp.floatValue = Mathf.Min(pProp.floatValue, attrib.RangeMax); } } GUI.enabled = wasEnabled; }