34 lines
1006 B
C#
34 lines
1006 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Item
|
|
{
|
|
public int Id { get; set; }
|
|
public string ItemName { get; set; }
|
|
public string Descripte;
|
|
public ItemClass type;
|
|
public LotteryType lotteryType;
|
|
public string Path { get; set; }
|
|
public int value;
|
|
|
|
public void UseItem(Item item)
|
|
{
|
|
switch(item.lotteryType)
|
|
{
|
|
case LotteryType.Hp:
|
|
Debug.LogFormat("UseItem:[{0}],AddHp {1}",item.Id,item.value);
|
|
PlayerInfo.Instance.AddHp(item.value);
|
|
break;
|
|
case LotteryType.Attack:
|
|
Debug.LogFormat("UseItem:[{0}],AddAttack {1}", item.Id,value);
|
|
PlayerInfo.Instance.AddAttack(item.value);
|
|
break;
|
|
case LotteryType.Mp:
|
|
Debug.LogFormat("UseItem:[{0}],AddMp {1}", item.Id,item.value);
|
|
PlayerInfo.Instance.AddMp(item.value);
|
|
break;
|
|
}
|
|
}
|
|
}
|