Ejemplo n.º 1
0
    private void OnEnable()
    {
        character  = target as CharacterInformation;
        enemy      = target as EnemyInformation;
        NPC        = target as NPCInformation;
        player     = target as PlayerInformation;
        characters = Resources.LoadAll <CharacterInformation>("Configuration");
        _ID        = serializedObject.FindProperty("_ID");
        _name      = serializedObject.FindProperty("_name");
        SMParams   = serializedObject.FindProperty("_SMParams");
        attribute  = serializedObject.FindProperty("attribute");
        attrDrawer = new RoleAttributeGroupDrawer(serializedObject, attribute, lineHeight, lineHeightSpace);

        lineHeight      = EditorGUIUtility.singleLineHeight;
        lineHeightSpace = lineHeight + 2;

        if (enemy)
        {
            EnemyInfoEnable();
        }
        else if (NPC)
        {
            NPCInfoEnable();
        }
        else if (player)
        {
            backpack = serializedObject.FindProperty("backpack");
        }
    }
Ejemplo n.º 2
0
    private void OnEnable()
    {
        items = Resources.LoadAll <ItemBase>("Configuration");

        lineHeight      = EditorGUIUtility.singleLineHeight;
        lineHeightSpace = lineHeight + 2;

        item          = target as ItemBase;
        _ID           = serializedObject.FindProperty("_ID");
        _name         = serializedObject.FindProperty("_name");
        itemType      = serializedObject.FindProperty("itemType");
        quality       = serializedObject.FindProperty("quality");
        weight        = serializedObject.FindProperty("weight");
        sellAble      = serializedObject.FindProperty("sellAble");
        sellPrice     = serializedObject.FindProperty("sellPrice");
        buyPrice      = serializedObject.FindProperty("buyPrice");
        icon          = serializedObject.FindProperty("icon");
        description   = serializedObject.FindProperty("description");
        stackNum      = serializedObject.FindProperty("stackNum");
        discardAble   = serializedObject.FindProperty("discardAble");
        lockAble      = serializedObject.FindProperty("lockAble");
        usable        = serializedObject.FindProperty("usable");
        inexhaustible = serializedObject.FindProperty("inexhaustible");
        maxDurability = serializedObject.FindProperty("maxDurability");
        _DIYAble      = serializedObject.FindProperty("_DIYAble");
        formulation   = serializedObject.FindProperty("formulation");
        makingMethod  = serializedObject.FindProperty("makingMethod");
        minYield      = serializedObject.FindProperty("minYield");
        maxYield      = serializedObject.FindProperty("maxYield");

        box = target as BoxItem;
        if (box)
        {
            BoxItemEnable();
        }

        if (target is EquipmentItem)
        {
            attribute  = serializedObject.FindProperty("attribute");
            attrDrawer = new RoleAttributeGroupDrawer(serializedObject, attribute, lineHeight, lineHeightSpace);
        }

        materialType = serializedObject.FindProperty("materialType");

        FixType();
    }