Pedro Gomes d75d51a9c4 Gameplay update
- Added multiple input modes:
   - Point and click (as before)
   - WASD + mouse aiming (fully supported) (need QoL for interactables)
   - Gamepad controls (partial support)

- Sprite indexer to avoid gamebreaking issues when serializing sprites
- Movement speed penalty on casting abilities instead of fully stopping agent
2025-01-17 20:16:02 +00:00

50 lines
1.4 KiB
C#

using Kryz.CharacterStats.Examples;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
[System.Serializable]
public class ItemInstance
{
public string ItemName;
public Sprite Icon;
public int spriteIndex;
public int sellPricePlayer;
public int sellPriceVendor;
public string description;
public int templateIndex;
public ItemInstance()
{
ItemName = "";
Icon = null;
spriteIndex = 0;
sellPricePlayer = 0;
sellPriceVendor = 0;
description = "";
templateIndex = 0;
}
public ItemInstance(Item template)
{
ItemName = template.ItemName;
Icon = template.Icon;
spriteIndex = SpriteIndexer.Instance.Sprites.IndexOf(Icon);
sellPricePlayer = template.sellPricePlayer;
sellPriceVendor = template.sellPriceVendor;
description = template.description;
templateIndex = ItemIndexer.Instance.Items.IndexOf(template);
}
public ItemInstance(Item template, int templateIndex)
{
ItemName = template.ItemName;
Icon = template.Icon;
spriteIndex = SpriteIndexer.Instance.Sprites.IndexOf(Icon);
sellPricePlayer = template.sellPricePlayer;
sellPriceVendor = template.sellPriceVendor;
description = template.description;
this.templateIndex = templateIndex;
}
}