+物品展示
todo 玩家背包
This commit is contained in:
12
Assets/Scripts/Event/EventArgs/ItemDialogArgs.cs
Normal file
12
Assets/Scripts/Event/EventArgs/ItemDialogArgs.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace Event.EventArgs
|
||||
{
|
||||
public class ItemDialogArgs : System.EventArgs
|
||||
{
|
||||
public string ItemName { get;private set; }
|
||||
|
||||
public ItemDialogArgs(string nItemName)
|
||||
{
|
||||
ItemName = nItemName;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Event/EventArgs/ItemDialogArgs.cs.meta
Normal file
3
Assets/Scripts/Event/EventArgs/ItemDialogArgs.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d9296ff0a4da4c7094115457f7278e00
|
||||
timeCreated: 1727505266
|
||||
6
Assets/Scripts/Event/EventHandler/ItemDialogHandler.cs
Normal file
6
Assets/Scripts/Event/EventHandler/ItemDialogHandler.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using Event.EventArgs;
|
||||
|
||||
namespace Event.EventHandler
|
||||
{
|
||||
public delegate void ItemDialogHandler(ItemDialogArgs args);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: beeb3f2691a14bb291fd94c08e811d6d
|
||||
timeCreated: 1727505146
|
||||
@@ -42,8 +42,10 @@ namespace Event
|
||||
public event PlayerWalkStartHandler PlayerWalkStart;
|
||||
public event PlayerWalkStopHandler PlayerWalkStop;
|
||||
public event PlayerWalkingHandler PlayerWalking;
|
||||
|
||||
public event ItemDialogHandler ItemDialog;
|
||||
|
||||
public void DialogEventSwitch(string eventName, string args)
|
||||
public void EventSwitch(string eventName, string args)
|
||||
{
|
||||
switch (eventName)
|
||||
{
|
||||
@@ -85,6 +87,11 @@ namespace Event
|
||||
PlayerRunStart?.Invoke();
|
||||
}
|
||||
|
||||
public void OnItemDialog(string nName)
|
||||
{
|
||||
ItemDialog?.Invoke(new ItemDialogArgs(nName));
|
||||
}
|
||||
|
||||
public void OnPlayerRunning()
|
||||
{
|
||||
PlayerRunning?.Invoke();
|
||||
|
||||
Reference in New Issue
Block a user