Example #1
0
        /*--------------------------------------------------------------------------------------------*/
        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();
 }
Example #3
0
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 protected HoverRaycastLine()
 {
     Controllers = new SettingsControllerMap();
 }
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 protected HoverAlphaFillUpdater()
 {
     Controllers = new SettingsControllerMap();
 }
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 public HoverCursorFollower()
 {
     Controllers = new SettingsControllerMap();
 }
Example #6
0
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 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;
 }
Example #9
0
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 protected HoverLayoutRectGroup()
 {
     Controllers = new SettingsControllerMap();
     vChildItems = new List <HoverLayoutRectGroupChild>();
 }
Example #10
0
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 protected HoverFill()
 {
     Controllers = new SettingsControllerMap();
 }
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 protected HoverRenderer()
 {
     Controllers = new SettingsControllerMap();
 }
Example #12
0
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 protected HoverCanvasDataUpdater()
 {
     Controllers = new SettingsControllerMap();
 }
Example #13
0
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 protected HoverFillSliderUpdater()
 {
     Controllers = new SettingsControllerMap();
 }
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 public HoverAlphaRendererUpdater()
 {
     Controllers = new SettingsControllerMap();
 }
Example #15
0
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 protected HoverIndicatorOverrider()
 {
     Controllers = new SettingsControllerMap();
 }
Example #16
0
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 public HoverIcon()
 {
     Controllers = new SettingsControllerMap();
 }
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 protected HovercastBackCursorTrigger()
 {
     Controllers = new SettingsControllerMap();
 }
Example #18
0
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 public HoverLabel()
 {
     Controllers = new SettingsControllerMap();
 }
Example #19
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        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;
        }