public static void DrawDefaultListElementLabel(Rect area, SerializedProperty property, int index)
        {
            var r0 = new Rect(area.xMin, area.yMin, Mathf.Min(25f, area.width), EditorGUIUtility.singleLineHeight);
            var r1 = new Rect(r0.xMax, area.yMin, Mathf.Max(0f, area.width - r0.width), EditorGUIUtility.singleLineHeight);

            EditorGUI.LabelField(r0, index.ToString("00:"));
            EventTriggerTargetPropertyDrawer.DrawTriggerActivationTypeDropdown(r1, property, false);
        }
Пример #2
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            EditorGUI.BeginProperty(position, label, property);

            //Draw ActivationType Popup
            var r0  = new Rect(position.xMin, position.yMin, position.width, EditorGUIUtility.singleLineHeight);
            var act = EventTriggerTargetPropertyDrawer.DrawTriggerActivationTypeDropdown(r0, property, true);

            //Draw Advanced
            var area = new Rect(position.xMin, r0.yMax, position.width, position.height - r0.height);

            switch (act)
            {
            case TriggerActivationType.TriggerAllOnTarget:
                this.DrawAdvanced_TriggerAll(area, property);
                break;

            case TriggerActivationType.TriggerSelectedTarget:
                this.DrawAdvanced_TriggerSelected(area, property);
                break;

            case TriggerActivationType.SendMessage:
                this.DrawAdvanced_SendMessage(area, property);
                break;

            case TriggerActivationType.CallMethodOnSelectedTarget:
                this.DrawAdvanced_CallMethodOnSelected(area, property);
                break;

            case TriggerActivationType.EnableTarget:
                this.DrawAdvanced_EnableTarget(area, property);
                break;

            case TriggerActivationType.DestroyTarget:
                this.DrawAdvanced_DestroyTarget(area, property);
                break;
            }

            EditorGUI.EndProperty();
        }