Beispiel #1
0
        private void OnEnable()
        {
            var writers = serializedObject.FindProperty("writers");

            writersList     = ((WritersSetting)target).Writers;
            reorderableList = ReorderableListUtility.CreateAutoLayout(writers);
        }
    public override void OnInspectorGUI()
    {
        //    base.OnInspectorGUI();
        var prefabLevelManager = (PrefabLevelManager)target;

        serializedObject.Update();

        //Debug level
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("Debug Level", HeaderStyle(), GUILayout.ExpandWidth(true));
        debugLevel = serializedObject.FindProperty("DebugLevel");
        EditorGUILayout.ObjectField(debugLevel);
        _isUseDebugLevel = EditorGUILayout.Toggle("Is Enabled", prefabLevelManager.IsUseDebugLevel);
        prefabLevelManager.IsUseDebugLevel = _isUseDebugLevel;

        //Prefab levels
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
        EditorGUILayout.LabelField("PrefabLevels", HeaderStyle(), GUILayout.ExpandWidth(true));
        ReorderableListUtility.DoLayoutListWithFoldout(list1);

        //Loop levels
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
        EditorGUILayout.LabelField("Loop Levels (Read Only)", HeaderStyle(), GUILayout.ExpandWidth(true));
        var loopLevels = serializedObject.FindProperty("LoopPrefabLevels");

        EditorGUILayout.PropertyField(loopLevels, new GUIContent("Loop Levels"), true);
        serializedObject.ApplyModifiedProperties();
    }
Beispiel #3
0
        protected override void Initialize()
        {
            rebuildBoneProfilesMethod = ReflectionUtility.GetMethod(target, "BuildOverridenBoneProfiles");

            positionMatchingOverridesList = ReorderableListUtility.Create(serializedObject.FindProperty("positionMatchingOverrides"),
                                                                          true, false, true, true, "Position Matching Overrides"
                                                                          );
            positionMatchingOverridesList.AddDefaultValueSetter((SerializedProperty newEntry) =>
            {
                newEntry.FindPropertyRelative("alpha").floatValue        = serializedObject.FindProperty("globalPositionAlpha").floatValue;
                newEntry.FindPropertyRelative("dampingRatio").floatValue = serializedObject.FindProperty("globalPositionDampingRatio").floatValue;
            });

            rotationMatchingOverridesList = ReorderableListUtility.Create(serializedObject.FindProperty("rotationMatchingOverrides"),
                                                                          true, false, true, true, "Rotation Matching Overrides"
                                                                          );
            rotationMatchingOverridesList.AddDefaultValueSetter((SerializedProperty newEntry) =>
            {
                newEntry.FindPropertyRelative("alpha").floatValue        = serializedObject.FindProperty("globalRotationAlpha").floatValue;
                newEntry.FindPropertyRelative("dampingRatio").floatValue = serializedObject.FindProperty("globalRotationDampingRatio").floatValue;
            });

            bonesWithNonZeroPositionMatchingOverride = new HashSet <string>();
            bonesWithOverride = new HashSet <string>();
        }
Beispiel #4
0
    public override void OnInspectorGUI()
    {
        this.serializedObject.Update();

        ReorderableListUtility.DoLayoutListWithFoldout(this.emotions);

        this.serializedObject.ApplyModifiedProperties();
    }
Beispiel #5
0
    private void OnEnable()
    {
        var property = this.serializedObject.FindProperty("levels");

        this.list1 = ReorderableListUtility.CreateAutoLayout(
            property);
        //,new string[] { "Element", "Level Name"},
        //new float?[] { 100, 70 });
    }
    private void OnEnable()
    {
        var property = this.serializedObject.FindProperty("deviceSettings");

        this.list2 = ReorderableListUtility.CreateAutoLayout(
            property,
            new string[] { "Raw Path Name", "Display Name", "Display Color" }
            );
    }
Beispiel #7
0
        void OnEnable()
        {
            boneList = ReorderableListUtility.Create(serializedObject.FindProperty("bones"), false, true, true, true, "Bones");
            boneList.elementHeightCallback = GetElementHeight;
            boneList.drawElementCallback   = DrawListElement;
            boneList.drawHeaderCallback   += DrawListHeader;
            boneList.AddDefaultValueSetter(OnBoneAdded);

            rootNameProperty = serializedObject.FindProperty("_root").FindPropertyRelative("name");
        }
Beispiel #8
0
    private void OnEnable()
    {
        var property = this.serializedObject.FindProperty("Drinks");

        this.list1 = ReorderableListUtility.CreateAutoLayout(property);
        this.list2 = ReorderableListUtility.CreateAutoLayout(
            property,
            new string[] { "Drink Name", "Cost", "Key Color" },
            new float?[] { 100, 70 });
    }
Beispiel #9
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        this.serializedObject.Update();

        EditorGUILayout.Space();
        EditorGUILayout.LabelField("Available Tetrimini", EditorStyles.boldLabel);
        ReorderableListUtility.DoLayoutListWithFoldout(this.m_availableTetriminiList);

        this.serializedObject.ApplyModifiedProperties();
    }
        protected override void Initialize()
        {
            bonePairsList = ReorderableListUtility.Create(serializedObject.FindProperty("bonePairs"),
                                                          draggable: true, displayHeader: true, displayAddButton: true, displayRemoveButton: true, "Ignored Collision Pairs");
            bonePairsList.drawElementCallback   = DrawIgnoredPairElement;
            bonePairsList.elementHeightCallback = GetIgnoredPairsElementHeight;

            disabledList = ReorderableListUtility.Create(serializedObject.FindProperty("disabled"),
                                                         draggable: true, displayHeader: true, displayAddButton: true, displayRemoveButton: true, "Disabled Collision Bones");
            disabledList.drawElementCallback   = DrawDisabledBonesElement;
            disabledList.elementHeightCallback = GetDisabledBonesElementHeight;

            duplicatePairValidationSet          = new HashSet <RagdollCollisionProfile.BonePair>();
            duplicateDisabledBonesValidationSet = new HashSet <string>();
        }
Beispiel #11
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        this.serializedObject.Update();

        EditorGUILayout.Space();
        EditorGUILayout.LabelField("Example1", EditorStyles.boldLabel);
        ReorderableListUtility.DoLayoutListWithFoldout(this.list1);

        EditorGUILayout.Space();
        EditorGUILayout.LabelField("Example2", EditorStyles.boldLabel);
        ReorderableListUtility.DoLayoutListWithFoldout(this.list2);

        this.serializedObject.ApplyModifiedProperties();
    }
Beispiel #12
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        var levels = serializedObject.FindProperty("levels");

        if (list == null)
        {
            list = ReorderableListUtility.CreateAutoLayout(levels);
        }
        list.drawElementCallback = (rect, index, active, focused) => {
            EditorGUI.PropertyField(rect, levels.GetArrayElementAtIndex(index), GUIContent.none);
        };
        list.onAddCallback = (x) => levels.InsertArrayElementAtIndex(levels.arraySize);
        ReorderableListUtility.DoLayoutListWithFoldout(list);

        serializedObject.ApplyModifiedProperties();
    }
    private void OnEnable()
    {
        var property = serializedObject.FindProperty("PrefabLevels");

        list1 = ReorderableListUtility.CreateAutoLayout(
            property,
            new[] { "Order", "Level", "In Loop" },
            new float?[] { 50, 150, 70 });

        if (_isUseDebugLevel && debugLevel == null)
        {
            _isUseDebugLevel = false;
        }

        /*this.list2 = ReorderableListUtility.CreateAutoLayout(
         *  property,
         *  new string[] { "Drink Name", "Cost", "Key Color" },
         *  new float?[] { 100, 70 });
         * }*/
    }
Beispiel #14
0
        void OnEnable()
        {
            m_Loaders           = serializedObject.FindProperty("m_Loaders");
            m_PreloadedCatalogs = serializedObject.FindProperty("m_PreloadedCatalogs");
            m_AutoSaveTiming    = serializedObject.FindProperty("m_AutoSaveTiming");

            m_LoadersList = ReorderableListUtility.CreateDefaultList(m_Loaders);
            m_LoadersList.onCanRemoveCallback = list => (list.count > 1);
            m_LoadersList.drawElementCallback = (rect, index, isActive, isFocused) => {
                var element = m_LoadersList.serializedProperty.GetArrayElementAtIndex(index);

                var label = new GUIContent($"Loader {index}");
                if (index == (m_Loaders.arraySize - 1))
                {
                    label.text += " / Saver";
                }
                EditorGUI.PropertyField(rect, element, label);
            };

            m_PreloadedCatalogsList = ReorderableListUtility.CreateDefaultList(m_PreloadedCatalogs);
        }
Beispiel #15
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();
            this.serializedObject.Update();

            ReloadOptions();
            if (options != null && options.Length > 0)
            {
                EditorGUILayout.LabelField("От имени пользователя:");
                ((WritersSetting)target).ChosenWriter =
                    EditorGUILayout.Popup(((WritersSetting)target).ChosenWriter, options);
            }
            else
            {
                EditorGUILayout.HelpBox("Список участников пуст!!!", MessageType.Error);
            }

            EditorGUILayout.Space();
            ReorderableListUtility.DoLayoutListWithFoldout(reorderableList);

            this.serializedObject.ApplyModifiedProperties();
        }
Beispiel #16
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        var levelDisplay = serializedObject.FindProperty("levelDisplay");

        EditorGUILayout.PropertyField(levelDisplay);

        var corps = serializedObject.FindProperty("corps");

        if (list == null)
        {
            list = ReorderableListUtility.CreateAutoLayout(corps, true, false, true, true);
        }
        list.drawElementCallback = (rect, index, active, focused) =>
        {
            EditorGUI.PropertyField(rect, corps.GetArrayElementAtIndex(index), GUIContent.none);
        };
        list.drawHeaderCallback = (x) => { EditorGUI.LabelField(x, "Corps"); };

        list.DoLayoutList();
//        ReorderableListUtility.DoLayoutListWithFoldout(list);
        serializedObject.ApplyModifiedProperties();
    }
Beispiel #17
0
    private void OnEnable()
    {
        var property = this.serializedObject.FindProperty("emotions");

        this.emotions = ReorderableListUtility.CreateAutoLayout(property);
    }
Beispiel #18
0
    public override void OnGUI(Rect p_position, SerializedProperty p_property, GUIContent p_label)
    {
        string _path = p_property.propertyPath;

        if (!_path.EndsWith("]"))
        {
            EditorGUI.LabelField(p_position, p_label.text, "[ReorderableList] Only for Array Or Collection");
            return;
        }

        ReorderableListAttribute _reorderableList = attribute as ReorderableListAttribute;
        bool _isFirst = _path.EndsWith(".data[0]");

        if (_reorderableList.list != null)
        {
            if (_isFirst)
            {
                Rect _butRect = new Rect(p_position);
                int  _indent  = EditorGUI.indentLevel * 15;
                _butRect.height = 16;
                if (useOrder)
                {
                    _butRect.x     += _indent + 70;
                    _butRect.width -= _indent + 70 + 160;
                    if (GUI.Button(_butRect, "Finish Reorder"))
                    {
                        useOrder = false;
                    }
                }
                else
                {
                    _butRect.x     += _indent;
                    _butRect.width -= _indent + 160;
                    if (GUI.Button(_butRect, "Start Reorder"))
                    {
                        useOrder = true;
                    }
                }

                _butRect.x    += _butRect.width;
                _butRect.width = 160;
                SerializedProperty _parentProperty = SerializedPropertyValue.GetParent(p_property);
                SerializedPropertyValue.DrawCopyPasteArray(_butRect, _parentProperty);
            }
        }

        SerializedObject _serializedObject = p_property.serializedObject;

        if (_isFirst)
        {
            if (_reorderableList.list == null)
            {
                SerializedProperty _parentProperty = SerializedPropertyValue.GetParent(p_property);
                _reorderableList.list = ReorderableListUtility.CreateAutoLayout(_parentProperty, 4, SerializedPropertyValue.DrawCopyPasteBehind);
            }
        }

        if (useOrder)
        {
            if (_isFirst)
            {
                p_position.width -= 120;
                ReorderableListUtility.DoListWithFoldout(_reorderableList.list, p_position);
            }
        }
        else
        {
            p_position.y += 16;

            Rect _copyPasteRect = new Rect(p_position);
            _copyPasteRect.x     += p_position.width - 120;
            _copyPasteRect.width  = 120;
            _copyPasteRect.height = 18;
            string _click = SerializedPropertyValue.DrawCopyPasteButton(_copyPasteRect, p_property);
            if (_click != "")
            {
            }
            else if ((p_property.propertyType == SerializedPropertyType.Generic) || (p_property.isArray && (p_property.propertyType != SerializedPropertyType.String)))
            {
                EditorGUI.PropertyField(p_position, p_property, p_label, true);
            }
            else
            {
                p_position.width -= 120;
                p_position.height = SerializedPropertyValue.GetPropertyHeight(p_property, p_label);
                EditorGUI.PropertyField(p_position, p_property);
            }
        }
    }
Beispiel #19
0
    private void OnEnable()
    {
        var propertyAvailableTetrimini = this.serializedObject.FindProperty("m_availableTetrimini");

        this.m_availableTetriminiList = ReorderableListUtility.CreateAutoLayout(propertyAvailableTetrimini, new string[] { "Name", "Geometry", "Color" });
    }