public override void SetProperties()
    {
        base.SetProperties();

        if (loadInventory.enumValueIndex == 1)//override items
        {
            quickMenuButtons.arraySize = itemsToAdd.arraySize;
        }

        quickMenuButtons.ArrayFieldCustom(false, true, "Select Item");

        EditorGUILayout.PropertyField(enableToggleSwitch);
        if (enableToggleSwitch.boolValue)
        {
            EditorGUI.indentLevel++;
            EditorGUILayout.PropertyField(toggleForwardsButton);
            EditorGUILayout.PropertyField(toggleBackwardsButton);
            EditorGUI.indentLevel--;
        }


        EditorGUILayout.PropertyField(interactButton);
        if (!autoEquipItems.boolValue)
        {
            EditorGUILayout.PropertyField(equipButton);
        }
        EditorGUILayout.PropertyField(dropButton);
    }
Exemple #2
0
    protected virtual void DisplayItemDatasProperties()
    {
        EditorGUILayout.PropertyField(itemManager);
        EditorGUILayout.DelayedIntField(maxItems);
        var manager = itemManager.GetRootValue <ItemDataManager>();

        if (manager)
        {
            for (int i = 0; i < itemsToAdd.arraySize; i++)
            {
                var element = itemsToAdd.GetArrayElementAtIndex(i);
                var item    = element.GetRootValue <ItemProperty>();
                item.itemNames = manager.GetItemNames();
            }
            itemsToAdd.ArrayFieldCustom(false, true, "Item");
            itemsToAdd.arraySize = maxItems.intValue;
        }
        else
        {
            EditorExtensions.LabelFieldCustom("You need an inventory manager to add items!", FontStyle.Bold, Color.red);
        }
    }