Exemplo n.º 1
0
        private void _nodeList_DrawElement(Rect area, int index, bool isActive, bool isFocused)
        {
            if (area.width < ARG_BTN_WIDTH)
            {
                return;
            }

            var elementProp = _nodesProp.GetArrayElementAtIndex(index);
            var transformProp = elementProp.FindPropertyRelative(PROP_NODE_TRANSFORM);
            var btnRect = new Rect(area.xMax - ARG_BTN_WIDTH, area.yMin, ARG_BTN_WIDTH, area.height);
            var propRect = new Rect(area.xMin, area.yMin, area.width - ARG_BTN_WIDTH, area.height);

            if(transformProp.objectReferenceValue == null || elementProp.isExpanded)
            {
                EditorGUI.PropertyField(propRect, transformProp, GUIContent.none);
            }
            else
            {
                var t = transformProp.objectReferenceValue as Transform;
                EditorGUI.LabelField(propRect, EditorHelper.TempContent(t.name), EditorHelper.TempContent("{ strength: " + t.localScale.z.ToString("0.00") + " }"));

                if(ReorderableListHelper.IsClickingArea(area))
                {
                    EditorGUIUtility.PingObject(t);
                }
            }

            if(GUI.Button(btnRect, _argBtnLabel))
            {
                elementProp.isExpanded = !elementProp.isExpanded;
            }

            if (GUI.enabled) ReorderableListHelper.DrawDraggableElementDeleteContextMenu(_nodeList, area, index, isActive, isFocused);
        }
Exemplo n.º 2
0
        private void _animList_DrawElement(Rect area, int index, bool isActive, bool isFocused)
        {
            var element = _animList.serializedProperty.GetArrayElementAtIndex(index);

            GUIContent label;

            if (Application.isPlaying && !this.serializedObject.isEditingMultipleObjects)
            {
                var targ = this.target as Animation;
                var clip = element.objectReferenceValue as AnimationClip;
                if (targ.IsPlaying(clip.name))
                {
                    label = EditorHelper.TempContent("Anim " + index.ToString("00") + " : (Playing)");
                }
                else
                {
                    label = EditorHelper.TempContent("Anim " + index.ToString("00"));
                }
            }
            else
            {
                label = EditorHelper.TempContent("Anim " + index.ToString("00"));
            }

            area.height = EditorGUIUtility.singleLineHeight;
            EditorGUI.PropertyField(area, element, label);

            if (GUI.enabled)
            {
                ReorderableListHelper.DrawDraggableElementDeleteContextMenu(_animList, area, index, isActive, isFocused);
            }
        }
        private void _maskList_DrawElement(Rect area, int index, bool isActive, bool isFocused)
        {
            var element = _maskList.serializedProperty.GetArrayElementAtIndex(index);

            if (element == null)
            {
                return;
            }

            const float RECURS_WIDTH       = 80f;
            const float RECURS_LABEL_WIDTH = 60f;

            //DRAW TRANSFORM
            var transProp = element.FindPropertyRelative("Transform");
            var transRect = new Rect(area.xMin, area.yMin, area.width - RECURS_WIDTH, EditorGUIUtility.singleLineHeight);

            EditorGUI.PropertyField(transRect, transProp, GUIContent.none);

            //DRAW RECURSIVE TOGGLE
            var recursProp       = element.FindPropertyRelative("Recursive");
            var recursTotalRect  = new Rect(transRect.xMax + 2f, area.yMin, RECURS_WIDTH - 2f, EditorGUIUtility.singleLineHeight);
            var recursLabelRect  = new Rect(recursTotalRect.xMin, recursTotalRect.yMin, RECURS_LABEL_WIDTH, recursTotalRect.height);
            var recursToggleRect = new Rect(recursLabelRect.xMax, recursTotalRect.yMin, recursTotalRect.xMax - recursLabelRect.xMax, recursTotalRect.height);
            var recursLabel      = new GUIContent("Recurses");

            EditorGUI.BeginProperty(recursTotalRect, recursLabel, recursProp);
            EditorGUI.LabelField(recursLabelRect, recursLabel);
            recursProp.boolValue = EditorGUI.Toggle(recursToggleRect, GUIContent.none, recursProp.boolValue);
            EditorGUI.EndProperty();

            if (GUI.enabled)
            {
                ReorderableListHelper.DrawDraggableElementDeleteContextMenu(_maskList, area, index, isActive, isFocused);
            }
        }
Exemplo n.º 4
0
        private void _targetList_DrawElement(Rect area, int index, bool isActive, bool isFocused)
        {
            var element = _targetList.serializedProperty.GetArrayElementAtIndex(index);

            var targProp = element.FindPropertyRelative(EventTriggerTargetPropertyDrawer.PROP_TRIGGERABLETARG);

            const float MARGIN             = 1.0f;
            const float WEIGHT_FIELD_WIDTH = 60f;
            const float PERC_FIELD_WIDTH   = 45f;
            const float FULLWEIGHT_WIDTH   = WEIGHT_FIELD_WIDTH + PERC_FIELD_WIDTH;

            EditorGUI.BeginProperty(area, GUIContent.none, targProp);

            Rect       trigRect;
            var        actInfo      = EventTriggerTargetPropertyDrawer.GetTriggerActivationInfo(element);
            GUIContent labelContent = EditorHelper.TempContent(index.ToString("00: ") + actInfo.ActivationTypeDisplayName);

            if (this.CustomizeEntryLabel != null)
            {
                this.CustomizeEntryLabel(labelContent, index);
            }
            if (_drawWeight && area.width > FULLWEIGHT_WIDTH)
            {
                var top        = area.yMin + MARGIN;
                var labelRect  = new Rect(area.xMin, top, EditorGUIUtility.labelWidth - FULLWEIGHT_WIDTH, EditorGUIUtility.singleLineHeight);
                var weightRect = new Rect(area.xMin + EditorGUIUtility.labelWidth - FULLWEIGHT_WIDTH, top, WEIGHT_FIELD_WIDTH, EditorGUIUtility.singleLineHeight);
                var percRect   = new Rect(area.xMin + EditorGUIUtility.labelWidth - PERC_FIELD_WIDTH, top, PERC_FIELD_WIDTH, EditorGUIUtility.singleLineHeight);
                trigRect = new Rect(area.xMin + EditorGUIUtility.labelWidth, top, area.width - EditorGUIUtility.labelWidth, EditorGUIUtility.singleLineHeight);

                var   weightProp = element.FindPropertyRelative(PROP_WEIGHT);
                float weight     = weightProp.floatValue;

                EditorGUI.LabelField(labelRect, labelContent);
                weightProp.floatValue = EditorGUI.FloatField(weightRect, weight);
                float p = (_totalWeight > 0f) ? (100f * weight / _totalWeight) : ((index == 0) ? 100f : 0f);
                EditorGUI.LabelField(percRect, string.Format("{0:0.#}%", p));
            }
            else
            {
                //Draw Triggerable - this is the simple case to make a clean designer set up for newbs
                var top       = area.yMin + MARGIN;
                var labelRect = new Rect(area.xMin, top, area.width, EditorGUIUtility.singleLineHeight);

                trigRect = EditorGUI.PrefixLabel(labelRect, labelContent);
            }

            //Draw Triggerable - this is the simple case to make a clean designer set up for newbs
            EditorGUI.BeginChangeCheck();
            var targObj = EventTriggerTargetPropertyDrawer.TargetObjectField(trigRect, GUIContent.none, targProp.objectReferenceValue);

            if (EditorGUI.EndChangeCheck())
            {
                targProp.objectReferenceValue = EventTriggerTargetPropertyDrawer.IsValidTriggerTarget(targObj, actInfo.ActivationType) ? targObj : null;
            }
            EditorGUI.EndProperty();

            ReorderableListHelper.DrawDraggableElementDeleteContextMenu(_targetList, area, index, isActive, isFocused);
        }
        private void _maskList_DrawElement(Rect area, int index, bool isActive, bool isFocused)
        {
            var element = _lst.serializedProperty.GetArrayElementAtIndex(index);

            if (element == null)
            {
                return;
            }

            //EditorGUI.PropertyField(area, element, GUIContent.none, false);
            var        attrib = this.attribute as ReorderableArrayAttribute;
            GUIContent label  = GUIContent.none;

            if (attrib != null)
            {
                if (attrib.ElementLabelFormatString != null)
                {
                    label = EditorHelper.TempContent(string.Format(attrib.ElementLabelFormatString, index));
                }
                if (attrib.ElementPadding > 0f)
                {
                    area = new Rect(area.xMin + attrib.ElementPadding, area.yMin, Mathf.Max(0f, area.width - attrib.ElementPadding), area.height);
                }
            }

            if (_drawElementAtBottom)
            {
                var lbl = TempElementLabel(element, index);
                SerializedProperty prop = string.IsNullOrEmpty(_childPropertyAsEntry) ? null : element.FindPropertyRelative(_childPropertyAsEntry);

                if (prop != null)
                {
                    SPEditorGUI.PropertyField(area, prop, lbl);
                }
                else
                {
                    EditorGUI.LabelField(area, lbl);
                }
            }
            else
            {
                if (_internalDrawer != null)
                {
                    _internalDrawer.OnGUI(area, element, label);
                }
                else
                {
                    SPEditorGUI.DefaultPropertyField(area, element, label, false);
                }
            }

            if (GUI.enabled)
            {
                ReorderableListHelper.DrawDraggableElementDeleteContextMenu(_lst, area, index, isActive, isFocused);
            }
        }
        private void _animList_DrawElement(Rect area, int index, bool isActive, bool isFocused)
        {
            var element = _animList.serializedProperty.GetArrayElementAtIndex(index);

            _clipDrawer.DrawClip(area, element, EditorHelper.TempContent(index.ToString()), Mathf.Min(area.width * 0.08f, 30f), _nameLabelGUIStyle, _isStaticColl);

            if (GUI.enabled)
            {
                ReorderableListHelper.DrawDraggableElementDeleteContextMenu(_animList, area, index, isActive, isFocused);
            }
        }
Exemplo n.º 7
0
        private void _prefabList_DrawElement(Rect area, int index, bool isActive, bool isFocused)
        {
            var element = _lst.serializedProperty.GetArrayElementAtIndex(index);

            //EditorGUI.PropertyField(area, element, false);
            element.objectReferenceValue = EditorGUI.ObjectField(area, element.objectReferenceValue, typeof(GameObject), false);

            if (GUI.enabled)
            {
                ReorderableListHelper.DrawDraggableElementDeleteContextMenu(_lst, area, index, isActive, isFocused);
            }
        }
Exemplo n.º 8
0
        private void _timeLayers_DrawElement(Rect area, int index, bool isActive, bool isFocused)
        {
            string layerName = _timeLayersHelper.Layers[index] as string;

            EditorGUI.BeginChangeCheck();
            layerName = EditorGUI.TextField(area, layerName);
            if (EditorGUI.EndChangeCheck())
            {
                _timeLayersHelper.Layers[index] = layerName;
            }

            if (GUI.enabled)
            {
                ReorderableListHelper.DrawDraggableElementDeleteContextMenu(_timeLayersListDrawer, area, index, isActive, isFocused);
            }
        }
        protected virtual void _maskList_DrawElement(Rect area, int index, bool isActive, bool isFocused)
        {
            var element = _lst.serializedProperty.GetArrayElementAtIndex(index);

            if (element == null)
            {
                return;
            }

            //EditorGUI.PropertyField(area, element, GUIContent.none, false);
            GUIContent label = null;

            if (_hideElementLabel)
            {
                label = GUIContent.none;
            }
            else
            {
                if (this.FormatElementLabel != null)
                {
                    string slbl = this.FormatElementLabel(element, index, isActive, isFocused);
                    if (slbl != null)
                    {
                        label = EditorHelper.TempContent(slbl);
                    }
                }
                else if (!string.IsNullOrEmpty(_elementLabelFormatString))
                {
                    label = EditorHelper.TempContent(string.Format(_elementLabelFormatString, index));
                }
                else
                {
                    label = TempElementLabel(element, index);
                }
                if (_elementPadding > 0f)
                {
                    area = new Rect(area.xMin + _elementPadding, area.yMin, Mathf.Max(0f, area.width - _elementPadding), area.height);
                }
            }

            this.DrawElement(area, element, label, index);

            if (GUI.enabled)
            {
                ReorderableListHelper.DrawDraggableElementDeleteContextMenu(_lst, area, index, isActive, isFocused);
            }
        }
Exemplo n.º 10
0
        protected virtual void _maskList_DrawElement(Rect area, int index, bool isActive, bool isFocused)
        {
            var element = _lst.serializedProperty.GetArrayElementAtIndex(index);

            if (element == null)
            {
                return;
            }

            var label = this.GetFormattedElementLabel(area, index, isActive, isFocused);

            this.DrawElement(area, element, label, index);

            if (GUI.enabled)
            {
                ReorderableListHelper.DrawDraggableElementDeleteContextMenu(_lst, area, index, isActive, isFocused);
            }
        }
        private void _maskList_DrawElement(Rect area, int index, bool isActive, bool isFocused)
        {
            var element = _lst.serializedProperty.GetArrayElementAtIndex(index);

            if (element == null)
            {
                return;
            }

            //EditorGUI.PropertyField(area, element, GUIContent.none, false);
            var        attrib = this.attribute as ReorderableArrayAttribute;
            GUIContent label  = null;

            if (this.FormatElementLabel != null)
            {
                string slbl = this.FormatElementLabel(element, index, isActive, isFocused);
                if (slbl != null)
                {
                    label = EditorHelper.TempContent(slbl);
                }
            }
            else if (attrib != null)
            {
                if (attrib.ElementLabelFormatString != null)
                {
                    label = EditorHelper.TempContent(string.Format(attrib.ElementLabelFormatString, index));
                }
                if (attrib.ElementPadding > 0f)
                {
                    area = new Rect(area.xMin + attrib.ElementPadding, area.yMin, Mathf.Max(0f, area.width - attrib.ElementPadding), area.height);
                }
            }
            if (label == null)
            {
                label = (_hideElementLabel) ? GUIContent.none : TempElementLabel(element, index);
            }

            this.DrawElement(area, element, label, index);

            if (GUI.enabled)
            {
                ReorderableListHelper.DrawDraggableElementDeleteContextMenu(_lst, area, index, isActive, isFocused);
            }
        }
        private void _targetList_DrawElement(Rect area, int index, bool isActive, bool isFocused)
        {
            var element = _targetList.serializedProperty.GetArrayElementAtIndex(index);

            var trigProp = element.FindPropertyRelative(TriggerTargetPropertyDrawer.PROP_TRIGGERABLETARG);
            var actProp  = element.FindPropertyRelative(TriggerTargetPropertyDrawer.PROP_ACTIVATIONTYPE);
            //var act = (TriggerActivationType)actProp.enumValueIndex;
            var act = actProp.GetEnumValue <TriggerActivationType>();

            const float MARGIN = 1.0f;

            if (act == TriggerActivationType.TriggerAllOnTarget)
            {
                //Draw Triggerable - this is the simple case to make a clean designer set up for newbs
                var trigRect  = new Rect(area.xMin, area.yMin + MARGIN, area.width, EditorGUIUtility.singleLineHeight);
                var trigLabel = new GUIContent("Target");
                EditorGUI.BeginProperty(trigRect, trigLabel, trigProp);
                trigProp.objectReferenceValue = SPEditorGUI.ComponentField(trigRect,
                                                                           trigLabel,
                                                                           ValidateTriggerableTargAsMechanism(trigProp.objectReferenceValue) as Component,
                                                                           typeof(ITriggerableMechanism),
                                                                           true);
                EditorGUI.EndProperty();
            }
            else
            {
                //Draw Triggerable - this forces the user to use the advanced settings, not for newbs
                var trigRect  = new Rect(area.xMin, area.yMin + MARGIN, area.width, EditorGUIUtility.singleLineHeight);
                var trigLabel = new GUIContent("Advanced Target", "A target is not set, see advanced settings section to set a target.");

                if (trigProp.objectReferenceValue != null)
                {
                    var        obj      = trigProp.objectReferenceValue;
                    var        trigType = trigProp.objectReferenceValue.GetType();
                    GUIContent extraLabel;
                    switch (act)
                    {
                    case TriggerActivationType.SendMessage:
                        extraLabel = new GUIContent("(SendMessage) " + obj.name);
                        break;

                    case TriggerActivationType.TriggerSelectedTarget:
                        extraLabel = new GUIContent("(TriggerSelectedTarget) " + obj.name + " -> " + trigType.Name);
                        break;

                    case TriggerActivationType.CallMethodOnSelectedTarget:
                        extraLabel = new GUIContent("(CallMethodOnSelectedTarget) " + obj.name + " -> " + trigType.Name + "." + element.FindPropertyRelative(TriggerTargetPropertyDrawer.PROP_METHODNAME).stringValue);
                        break;

                    default:
                        extraLabel = GUIContent.none;
                        break;
                    }
                    EditorGUI.LabelField(trigRect, trigLabel, extraLabel);
                }
                else
                {
                    EditorGUI.LabelField(trigRect, trigLabel, new GUIContent("No Target"), new GUIStyle("Label")
                    {
                        alignment = TextAnchor.MiddleCenter
                    });
                }
            }

            ReorderableListHelper.DrawDraggableElementDeleteContextMenu(_targetList, area, index, isActive, isFocused);
        }
        private void _targetList_DrawElement(Rect area, int index, bool isActive, bool isFocused)
        {
            var element = _targetList.serializedProperty.GetArrayElementAtIndex(index);

            var targProp = element.FindPropertyRelative(TriggerTargetPropertyDrawer.PROP_TRIGGERABLETARG);
            var actProp  = element.FindPropertyRelative(TriggerTargetPropertyDrawer.PROP_ACTIVATIONTYPE);
            //var act = (TriggerActivationType)actProp.enumValueIndex;
            var act = actProp.GetEnumValue <TriggerActivationType>();

            const float MARGIN             = 1.0f;
            const float WEIGHT_FIELD_WIDTH = 60f;
            const float PERC_FIELD_WIDTH   = 45f;
            const float FULLWEIGHT_WIDTH   = WEIGHT_FIELD_WIDTH + PERC_FIELD_WIDTH;

            EditorGUI.BeginProperty(area, GUIContent.none, targProp);

            Rect       trigRect;
            GUIContent labelContent = EditorHelper.TempContent(index.ToString("00: ") + act.ToString()); //(act == TriggerActivationType.TriggerAllOnTarget) ? EditorHelper.TempContent("Target") : EditorHelper.TempContent(string.Format("Target ({0})", act));

            if (_drawWeight && area.width > FULLWEIGHT_WIDTH)
            {
                var top        = area.yMin + MARGIN;
                var labelRect  = new Rect(area.xMin, top, EditorGUIUtility.labelWidth - FULLWEIGHT_WIDTH, EditorGUIUtility.singleLineHeight);
                var weightRect = new Rect(area.xMin + EditorGUIUtility.labelWidth - FULLWEIGHT_WIDTH, top, WEIGHT_FIELD_WIDTH, EditorGUIUtility.singleLineHeight);
                var percRect   = new Rect(area.xMin + EditorGUIUtility.labelWidth - PERC_FIELD_WIDTH, top, PERC_FIELD_WIDTH, EditorGUIUtility.singleLineHeight);
                trigRect = new Rect(area.xMin + EditorGUIUtility.labelWidth, top, area.width - EditorGUIUtility.labelWidth, EditorGUIUtility.singleLineHeight);

                var   weightProp = element.FindPropertyRelative(PROP_WEIGHT);
                float weight     = weightProp.floatValue;

                EditorGUI.LabelField(labelRect, labelContent);
                weightProp.floatValue = EditorGUI.FloatField(weightRect, weight);
                float p = (_totalWeight > 0f) ? (100f * weight / _totalWeight) : ((index == 0) ? 100f : 0f);
                EditorGUI.LabelField(percRect, string.Format("{0:0.#}%", p));
            }
            else
            {
                //Draw Triggerable - this is the simple case to make a clean designer set up for newbs
                var top       = area.yMin + MARGIN;
                var labelRect = new Rect(area.xMin, top, area.width, EditorGUIUtility.singleLineHeight);

                trigRect = EditorGUI.PrefixLabel(labelRect, labelContent);
            }

            //Draw Triggerable - this is the simple case to make a clean designer set up for newbs

            /*
             * var targGo = GameObjectUtil.GetGameObjectFromSource(targProp.objectReferenceValue);
             * var newTargGo = EditorGUI.ObjectField(trigRect, GUIContent.none, targGo, typeof(GameObject), true) as GameObject;
             * if (newTargGo != targGo)
             * {
             *  targGo = newTargGo;
             *  targProp.objectReferenceValue = (targGo != null) ? targGo.transform : null;
             * }
             */
            EditorGUI.BeginChangeCheck();
            var targObj = TriggerTargetPropertyDrawer.TargetObjectField(trigRect, GUIContent.none, targProp.objectReferenceValue);

            if (EditorGUI.EndChangeCheck())
            {
                targProp.objectReferenceValue = TriggerTargetPropertyDrawer.IsValidTriggerTarget(targObj, act) ? targObj : null;
            }
            EditorGUI.EndProperty();

            ReorderableListHelper.DrawDraggableElementDeleteContextMenu(_targetList, area, index, isActive, isFocused);
        }
Exemplo n.º 14
0
        private void _maskList_DrawElement(Rect area, int index, bool isActive, bool isFocused)
        {
            var element = _lst.serializedProperty.GetArrayElementAtIndex(index);

            if (element == null)
            {
                return;
            }

            //EditorGUI.PropertyField(area, element, GUIContent.none, false);
            var        attrib = this.attribute as ReorderableArrayAttribute;
            GUIContent label  = GUIContent.none;

            if (attrib != null)
            {
                if (attrib.ElementLabelFormatString != null)
                {
                    label = EditorHelper.TempContent(string.Format(attrib.ElementLabelFormatString, index));
                }
                if (attrib.ElementPadding > 0f)
                {
                    area = new Rect(area.xMin + attrib.ElementPadding, area.yMin, Mathf.Max(0f, area.width - attrib.ElementPadding), area.height);
                }
            }

            if (_drawElementAtBottom)
            {
                var lbl = TempElementLabel(element, index);
                SerializedProperty prop = string.IsNullOrEmpty(_childPropertyAsEntry) ? null : element.FindPropertyRelative(_childPropertyAsEntry);

                if (prop != null)
                {
                    SPEditorGUI.PropertyField(area, prop, lbl);
                }
                else
                {
                    EditorGUI.LabelField(area, lbl);
                }
            }
            else
            {
                if (_internalDrawer != null)
                {
                    _internalDrawer.OnGUI(area, element, label);
                }
                else if (element.hasChildren && element.objectReferenceValue is MonoBehaviour)
                {
                    //we don't draw this way if it's a built-in type from Unity
                    var labelArea = new Rect(area.xMin, area.yMin, area.width, EditorGUIUtility.singleLineHeight);
                    EditorGUI.LabelField(labelArea, label);
                    var childArea = new Rect(area.xMin, area.yMin + EditorGUIUtility.singleLineHeight + 1f, area.width, area.height - EditorGUIUtility.singleLineHeight);
                    SPEditorGUI.FlatChildPropertyField(childArea, element);
                }
                else
                {
                    SPEditorGUI.DefaultPropertyField(area, element, label, false);
                }
            }

            if (GUI.enabled)
            {
                ReorderableListHelper.DrawDraggableElementDeleteContextMenu(_lst, area, index, isActive, isFocused);
            }
        }
        private void _targetList_DrawElement(Rect area, int index, bool isActive, bool isFocused)
        {
            var element = _targetList.serializedProperty.GetArrayElementAtIndex(index);

            var trigProp = element.FindPropertyRelative(TriggerTargetProps.PROP_TRIGGERABLETARG);
            var actProp  = element.FindPropertyRelative(TriggerTargetProps.PROP_ACTIVATIONTYPE);
            //var act = (TriggerActivationType)actProp.enumValueIndex;
            var act = actProp.GetEnumValue <TriggerActivationType>();

            const float MARGIN             = 1.0f;
            const float SMALL_LABEL_WIDTH  = 120f;
            const float WEIGHT_FIELD_WIDTH = 60f;
            const float PERC_FIELD_WIDTH   = 45f;

            Rect       trigRect;
            GUIContent labelContent = (act == TriggerActivationType.TriggerAllOnTarget) ? EditorHelper.TempContent("Target") : EditorHelper.TempContent("Advanced Target", "A target is not set, see advanced settings section to set a target.");

            if (_drawWeight && area.width > SMALL_LABEL_WIDTH)
            {
                var totalwidth = area.width - SMALL_LABEL_WIDTH;
                var top        = area.yMin + MARGIN;
                var labelRect  = new Rect(area.xMin, top, SMALL_LABEL_WIDTH, EditorGUIUtility.singleLineHeight);
                var weightRect = new Rect(labelRect.xMax, top, Mathf.Min(totalwidth, WEIGHT_FIELD_WIDTH), EditorGUIUtility.singleLineHeight);
                var percRect   = new Rect(weightRect.xMax, top, Mathf.Min(totalwidth - weightRect.width, PERC_FIELD_WIDTH), EditorGUIUtility.singleLineHeight);
                trigRect = new Rect(percRect.xMax, top, Mathf.Max(0f, totalwidth - weightRect.width - percRect.width), EditorGUIUtility.singleLineHeight);

                var   weightProp = element.FindPropertyRelative(PROP_WEIGHT);
                float weight     = weightProp.floatValue;

                EditorGUI.LabelField(labelRect, labelContent);
                weightProp.floatValue = EditorGUI.FloatField(weightRect, weight);
                float p = (_totalWeight > 0f) ? (100f * weight / _totalWeight) : ((index == 0) ? 100f : 0f);
                EditorGUI.LabelField(percRect, string.Format("{0:0.#}%", p));
            }
            else
            {
                //Draw Triggerable - this is the simple case to make a clean designer set up for newbs
                var top       = area.yMin + MARGIN;
                var labelRect = new Rect(area.xMin, top, Mathf.Min(area.width, EditorGUIUtility.labelWidth), EditorGUIUtility.singleLineHeight);
                trigRect = new Rect(labelRect.xMax, top, Mathf.Max(0f, area.width - labelRect.width), EditorGUIUtility.singleLineHeight);

                EditorGUI.LabelField(labelRect, labelContent);
            }

            if (act == TriggerActivationType.TriggerAllOnTarget)
            {
                //Draw Triggerable - this is the simple case to make a clean designer set up for newbs
                EditorGUI.BeginProperty(trigRect, GUIContent.none, trigProp);
                var targGo    = GameObjectUtil.GetGameObjectFromSource(trigProp.objectReferenceValue);
                var newTargGo = EditorGUI.ObjectField(trigRect, GUIContent.none, targGo, typeof(GameObject), true) as GameObject;
                if (newTargGo != targGo)
                {
                    targGo = newTargGo;
                    trigProp.objectReferenceValue = (targGo != null) ? targGo.transform : null;
                }
                EditorGUI.EndProperty();
            }
            else
            {
                //Draw Triggerable - this forces the user to use the advanced settings, not for newbs
                if (trigProp.objectReferenceValue != null)
                {
                    var        go       = GameObjectUtil.GetGameObjectFromSource(trigProp.objectReferenceValue);
                    var        trigType = trigProp.objectReferenceValue.GetType();
                    GUIContent extraLabel;
                    switch (act)
                    {
                    case TriggerActivationType.SendMessage:
                        extraLabel = new GUIContent("(SendMessage) " + go.name);
                        break;

                    case TriggerActivationType.TriggerSelectedTarget:
                        extraLabel = new GUIContent("(TriggerSelectedTarget) " + go.name + " -> " + trigType.Name);
                        break;

                    case TriggerActivationType.CallMethodOnSelectedTarget:
                        extraLabel = new GUIContent("(CallMethodOnSelectedTarget) " + go.name + " -> " + trigType.Name + "." + element.FindPropertyRelative(TriggerTargetProps.PROP_METHODNAME).stringValue);
                        break;

                    default:
                        extraLabel = GUIContent.none;
                        break;
                    }
                    EditorGUI.LabelField(trigRect, extraLabel);
                }
                else
                {
                    EditorGUI.LabelField(trigRect, EditorHelper.TempContent("No Target"), new GUIStyle("Label")
                    {
                        alignment = TextAnchor.MiddleCenter
                    });
                }
            }

            ReorderableListHelper.DrawDraggableElementDeleteContextMenu(_targetList, area, index, isActive, isFocused);
        }