将原在ItemBase的按键判断移至CameraInteract类中
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using Event;
|
||||
using Event.EventArgs;
|
||||
using Keyboard;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Items.Abstract
|
||||
@@ -15,10 +14,10 @@ namespace Items.Abstract
|
||||
protected virtual void ReceiveEvent(CameraInterActArgs item)
|
||||
{
|
||||
if (item.Item != gameObject) return;
|
||||
|
||||
ActivateItem();
|
||||
}
|
||||
|
||||
protected void ActivateItem()
|
||||
protected virtual void ActivateItem()
|
||||
{
|
||||
Debug.Log("Item is activated");
|
||||
}
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
using Event.EventArgs;
|
||||
using Event;
|
||||
using Items.Abstract;
|
||||
using Items.Interface;
|
||||
using Keyboard;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Items
|
||||
{
|
||||
public class TestItem : ItemBase , IItem
|
||||
{
|
||||
protected override void ReceiveEvent(CameraInterActArgs item)
|
||||
protected override void ActivateItem()
|
||||
{
|
||||
if(Input.GetKeyDown(KeySettingManager.Instance.GetKey("InterAct")))
|
||||
ActivateItem();
|
||||
base.ActivateItem();
|
||||
EventManager.Instance.OnDialogPop(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user