37 lines
		
	
	
		
			840 B
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			840 B
		
	
	
	
		
			Plaintext
		
	
	
	
| /*
 | |
| 文件名:Item.nut
 | |
| 路径:User/Asset/Item/Item.nut
 | |
| 创建日期:2024-12-13	12:30
 | |
| 文件用途:项目类
 | |
| */
 | |
| GameItem <- {};
 | |
| class GameItem.Item {
 | |
| 
 | |
|     function _typeof() {
 | |
|         return "Item";
 | |
|     }
 | |
| 
 | |
| 
 | |
|     //获取信息窗口
 | |
|     function GetInfoWindow() {
 | |
|         if (typeof this == "Equipment") {
 | |
|             return GameItem.EquipmentInfo(this);
 | |
|         } else if (typeof this == "Stackable") {
 | |
|             return GameItem.StackableInfo(this);
 | |
|         }
 | |
| 
 | |
|         error("GameItem::Info:: 未知物品类型");
 | |
|     }
 | |
| 
 | |
|     //获取图标精灵
 | |
|     function GetIconSprite() {
 | |
|         if (typeof this == "Equipment") {
 | |
|             return GameItem.EquipmentIcon(this);
 | |
|         } else if (typeof this == "Stackable") {
 | |
|             return GameItem.StackableIcon(this);
 | |
|         }
 | |
|         error("GameItem::Icon:: 未知物品类型");
 | |
|     }
 | |
| 
 | |
| 
 | |
| } |