新增数值系统
This commit is contained in:
@@ -29,8 +29,9 @@ public class SingleManager : ModuleSingle<SingleManager> {
|
||||
shortcutMenu.Add("背包", () => { ModuleUI.Settings(Page.Backpack); });
|
||||
shortcutMenu.Add("奖励/材料", RewardMaterial);
|
||||
shortcutMenu.Add("奖励/装备", RewardEquipment);
|
||||
}
|
||||
|
||||
ValueSystem.I.Initial();
|
||||
}
|
||||
|
||||
private void RewardMaterial() {
|
||||
(InventoryItem item, int count) = materialReward.Get(10);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using MuHua;
|
||||
|
||||
/// <summary>
|
||||
/// 数值系统
|
||||
/// </summary>
|
||||
public class ValueSystem : Module<ValueSystem> {
|
||||
/// <summary> 对战数值 </summary>
|
||||
public ValueContainer battle;
|
||||
|
||||
/// <summary> 初始化 </summary>
|
||||
public void Initial() {
|
||||
battle = new ValueContainer();
|
||||
battle.AddInstance(ValueType.Integer, "生命");
|
||||
battle.AddInstance(ValueType.Integer, "金币");
|
||||
battle.AddInstance(ValueType.Integer, "水晶");
|
||||
|
||||
Debug.Log(battle["生命"].value);
|
||||
|
||||
ValueModifier modifier = new ValueModifier { Fixed = 100 };
|
||||
battle["生命"].AddModifier(modifier, true);
|
||||
|
||||
Debug.Log(battle["生命"].value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b9b82c2b1930d5f4b8b002d671c4e28c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user