1
This commit is contained in:
33
unity/Assets/Script/Item.cs
Normal file
33
unity/Assets/Script/Item.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user