Пример #1
0
    public void LoadModel()
    {
        ItemModelPath = GameUtility.CleanItemResourcePath(ItemModelPath, "Assets/Resources/");
        ItemModelPath = GameUtility.CleanItemResourcePath(ItemModelPath, ".png");

        ItemModel = (GameObject)Resources.Load(ItemModelPath);
    }
Пример #2
0
    public void LoadIcon()
    {
        FactionIconPath = GameUtility.CleanItemResourcePath(FactionIconPath, "Assets/Resources/");
        FactionIconPath = GameUtility.CleanItemResourcePath(FactionIconPath, ".png");

        FactionIcon = (Texture2D)Resources.Load(FactionIconPath);
    }
Пример #3
0
    void SaveExistingSpell()
    {
        // Check that the given ID isn't already in the database.
        if (!RequirementsMet(spellID, selectedSpell))
        {
            Debug.LogError("A spell with that ID (" + spellID + ") already exists.");
            return;
        }

        selectedSpell.SpellName     = spellName;
        selectedSpell.SpellID       = spellID;
        selectedSpell.SpellDesc     = spellDesc;
        selectedSpell.SpellCastTime = spellCastTime;
        selectedSpell.SpellCooldown = spellCooldown;
        selectedSpell.TargetAuras   = targetAuras;
        selectedSpell.CasterAuras   = casterAuras;

        // Set icon
        selectedSpell.SetIcon(spellIcon);

        // Find icon path
        spellIconPath = AssetDatabase.GetAssetPath(spellIcon);
        spellIconPath = GameUtility.CleanItemResourcePath(spellIconPath, "Assets/Resources/");
        spellIconPath = GameUtility.CleanItemResourcePath(spellIconPath, ".png");
        selectedSpell.SpellIconPath = spellIconPath;
    }
Пример #4
0
    public void LoadIcon()
    {
        PerkIconpath = GameUtility.CleanItemResourcePath(PerkIconpath, "Assets/Resources/");
        PerkIconpath = GameUtility.CleanItemResourcePath(PerkIconpath, ".png");

        PerkIcon = (Texture2D)Resources.Load(PerkIconpath);
    }
Пример #5
0
    void SaveNewPerk()
    {
        Perk newPerk = new Perk();

        /*
         * Check to ensure that the condition has a unique id.
         */

        newPerk.PerkName  = perkName;
        newPerk.PerkID    = perkID;
        newPerk.PerkDesc  = perkDesc;
        newPerk.PerkAuras = perkAuras;

        // Set icon
        newPerk.SetIcon(perkIcon);

        // Find icon path
        perkIconPath         = AssetDatabase.GetAssetPath(perkIcon);
        perkIconPath         = GameUtility.CleanItemResourcePath(perkIconPath, "Assets/Resources/");
        perkIconPath         = GameUtility.CleanItemResourcePath(perkIconPath, ".png");
        newPerk.PerkIconpath = perkIconPath;

        // Check that the given ID isn't already in the database.
        if (RequirementsMet(perkID))
        {
            perkDatabase.AddPerk(newPerk);
        }
        else
        {
            Debug.LogError("An item with that ID (" + newPerk.PerkID + ") already exists.");
        }
    }
Пример #6
0
    void SaveNewSpell()
    {
        Spell newSpell = new Spell();

        newSpell.SpellName     = spellName;
        newSpell.SpellID       = spellID;
        newSpell.SpellDesc     = spellDesc;
        newSpell.SpellCastTime = spellCastTime;
        newSpell.SpellCooldown = spellCooldown;
        newSpell.TargetAuras   = targetAuras;
        newSpell.CasterAuras   = casterAuras;

        // Set icon
        newSpell.SetIcon(spellIcon);

        // Find icon path
        spellIconPath          = AssetDatabase.GetAssetPath(spellIcon);
        spellIconPath          = GameUtility.CleanItemResourcePath(spellIconPath, "Assets/Resources/");
        spellIconPath          = GameUtility.CleanItemResourcePath(spellIconPath, ".png");
        newSpell.SpellIconPath = spellIconPath;

        // Check that the given ID isn't already in the database.
        if (RequirementsMet(spellID))
        {
            spellDatabase.AddSpell(newSpell);
        }
        else
        {
            Debug.LogError("A spell with that ID (" + newSpell.SpellID + ") already exists.");
        }
    }
Пример #7
0
    public void LoadIcon()
    {
        SpellIconPath = GameUtility.CleanItemResourcePath(SpellIconPath, "Assets/Resources/");
        SpellIconPath = GameUtility.CleanItemResourcePath(SpellIconPath, ".png");

        SpellIcon = (Texture2D)Resources.Load(SpellIconPath);
    }
Пример #8
0
    void SaveExistingSkill()
    {
        // Check that the given ID isn't already in the database.
        if (!RequirementsMet(skillID, selectedSkill))
        {
            Debug.LogError("A skill with that ID (" + skillID + ") already exists.");
            return;
        }

        selectedSkill.SkillName      = skillName;
        selectedSkill.SkillID        = skillID;
        selectedSkill.SkillShortDesc = skillShortDesc;
        selectedSkill.SkillLongDesc  = skillLongDesc;

        // Set the model and icon
        selectedSkill.SetIcon(skillIcon);

        // Find model path
        skillIconPath = AssetDatabase.GetAssetPath(skillIcon);
        skillIconPath = GameUtility.CleanItemResourcePath(skillIconPath, "Assets/Resources/");
        skillIconPath = GameUtility.CleanItemResourcePath(skillIconPath, ".png");
        selectedSkill.SkillIconPath = skillIconPath;

        selectedSkill.perkIDs = skillPerkIDs;
    }
Пример #9
0
    void SaveNewSkill()
    {
        Skill newSkill = new Skill();

        newSkill.SkillName      = skillName;
        newSkill.SkillID        = skillID;
        newSkill.SkillShortDesc = skillShortDesc;
        newSkill.SkillLongDesc  = skillLongDesc;

        // Set the model and icon
        newSkill.SetIcon(skillIcon);

        // Find model path
        skillIconPath          = AssetDatabase.GetAssetPath(skillIcon);
        skillIconPath          = GameUtility.CleanItemResourcePath(skillIconPath, "Assets/Resources/");
        skillIconPath          = GameUtility.CleanItemResourcePath(skillIconPath, ".png");
        newSkill.SkillIconPath = skillIconPath;

        newSkill.perkIDs = skillPerkIDs;

        // Check that the given ID isn't already in the database.
        if (RequirementsMet(skillID))
        {
            skillDatabase.AddSkill(newSkill);
        }
        else
        {
            Debug.LogError("A skill with that ID (" + newSkill.SkillID + ") already exists.");
        }
    }
Пример #10
0
    void SaveExistingPerk()
    {
        // Check that the given ID isn't already in the database.
        if (!RequirementsMet(perkID, selectedPerk))
        {
            Debug.LogError("An item with that ID (" + perkID + ") already exists.");
            return;
        }

        selectedPerk.PerkName  = perkName;
        selectedPerk.PerkID    = perkID;
        selectedPerk.PerkDesc  = perkDesc;
        selectedPerk.PerkAuras = perkAuras;

        // Set icon
        selectedPerk.SetIcon(perkIcon);

        // Find icon path
        perkIconPath = AssetDatabase.GetAssetPath(perkIcon);
        perkIconPath = GameUtility.CleanItemResourcePath(perkIconPath, "Assets/Resources/");
        perkIconPath = GameUtility.CleanItemResourcePath(perkIconPath, ".png");
        selectedPerk.PerkIconpath = perkIconPath;
    }
Пример #11
0
    void SaveExistingItem(ItemType type)
    {
        //Item newItem = new Item();

        if (!RequiremetsMet(itemID, selectedItem))
        {
            Debug.LogError("An item with that ID (" + itemID + ") already exists.");
            return;
        }


        // Using the empty constructor so that more variables can be added easily.
        selectedItem.ItemName       = itemName;
        selectedItem.ItemID         = itemID;
        selectedItem.ItemShortDesc  = itemShortDesc;
        selectedItem.ItemLongDesc   = itemLongDesc;
        selectedItem.ItemWeight     = itemWeight;
        selectedItem.ItemCost       = itemCost;
        selectedItem.ItemQuality    = itemQuality;
        selectedItem.ItemType       = itemType;
        selectedItem.ItemPerkReqIDs = itemReqPerkIDs;

        // Set the model and icon
        selectedItem.SetIcon(itemIcon);
        selectedItem.SetModel(itemModel);

        // Find model path
        itemModelPath = AssetDatabase.GetAssetPath(itemModel);
        itemModelPath = GameUtility.CleanItemResourcePath(itemModelPath, "Assets/Resources/");
        itemModelPath = GameUtility.CleanItemResourcePath(itemModelPath, ".prefab");
        selectedItem.ItemModelPath = itemModelPath;

        // Find icon path
        itemIconPath = AssetDatabase.GetAssetPath(itemIcon);
        itemIconPath = GameUtility.CleanItemResourcePath(itemIconPath, "Assets/Resources/");
        itemIconPath = GameUtility.CleanItemResourcePath(itemIconPath, ".png");
        selectedItem.ItemIconPath = itemIconPath;

        switch (type)
        {
        case (ItemType.Weapon):
            WeaponStats wstats = selectedItem.WStats;
            wstats.AttackSpeed  = attackSpeed;
            wstats.BaseDamage   = baseDamage;
            wstats.BluntDamage  = bluntDamage;
            wstats.PierceDamage = pierceDamage;
            wstats.SlashDamage  = slashDamage;
            wstats.Auras        = conditions;

            selectedItem.WStats = wstats;
            break;

        case (ItemType.Armour):
            ArmourStats astats = selectedItem.AStats;
            astats.ArmourMaterial = armourMaterial;
            astats.ArmourType     = armourType;
            astats.BaseDefence    = baseDefence;
            astats.BluntDefence   = bluntDefence;
            astats.PierceDefence  = pierceDefence;
            astats.SlashDefence   = slashDefence;
            astats.NatureDefence  = natureDefence;
            astats.ThermalDefence = thermalDefence;
            astats.Auras          = conditions;

            selectedItem.AStats = astats;
            break;

        case (ItemType.Consumable):
            ConsumableStats constats = selectedItem.ConStats;
            constats.ConsumableType = consumableType;
            constats.Auras          = conditions;
            constats.Charges        = consumableCharges;

            selectedItem.ConStats = constats;
            break;

        case (ItemType.Container):
            ContainerStats ctnstats = selectedItem.CtnStats;
            ctnstats.ContentItems      = contentItems;
            ctnstats.ContentQuantities = contentQuantities;

            selectedItem.CtnStats = ctnstats;
            break;

        case (ItemType.Ingredient):
            IngredientStats ingstats = selectedItem.IngStats;
            ingstats.IsStackable = isStackable;

            selectedItem.IngStats = ingstats;
            break;

        case (ItemType.Misc):
            MiscStats miscstats = selectedItem.MiscStats;
            miscstats.IsStackable = isStackable;

            selectedItem.MiscStats = miscstats;
            break;
        }

        EditorUtility.SetDirty(itemDatabase);
        AssetDatabase.SaveAssets();
    }