修改框架

This commit is contained in:
MuHua-123
2025-09-25 17:50:28 +08:00
parent d940a18e13
commit 18c6b4387d
79 changed files with 1017 additions and 392 deletions
@@ -0,0 +1,35 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MuHua;
/// <summary>
/// 物品 - 管理器
/// </summary>
public class ManagerItem : ModuleSingle<ManagerItem> {
/// <summary> 材料列表 </summary>
public List<ConstMaterial> materials;
/// <summary> 装备列表 </summary>
public List<ConstEquipment> equipments;
protected override void Awake() => NoReplace(false);
}
/// <summary>
/// 物品奖励
/// </summary>
public class ItemReward {
/// <summary> 物品列表 </summary>
public List<InventoryItem> items;
public void Settings<T>(List<T> list) where T : ConstInventoryItem {
items = new List<InventoryItem>();
list.ForEach(obj => items.Add(obj.To()));
}
public (InventoryItem, int) Get(int max = 1) {
int count = Random.Range(1, max + 1);
int index = Random.Range(0, items.Count);
return (items[index], count);
}
}