实现i18n 优化部分模块的逻辑以优化性能 修复物品展示框打开时按下ESC唤出暂停菜单但没有暂停的bug Signed-off-by: Eicy <im@crash.work>
37 lines
896 B
C#
37 lines
896 B
C#
using Event;
|
|
using Event.EventArgs;
|
|
using UnityEngine;
|
|
|
|
namespace Items.Abstract
|
|
{
|
|
public abstract class ItemBase : MonoBehaviour
|
|
{
|
|
public int index; // 对话索引
|
|
public string itemNameKey; //物体本地化key
|
|
|
|
#region 相机交互事件订阅
|
|
private void OnEnable()
|
|
{
|
|
EventManager.Instance.CameraInterAct += ReceiveEvent;
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
EventManager.Instance.CameraInterAct -= ReceiveEvent;
|
|
}
|
|
#endregion
|
|
|
|
// 收到相机交互事件
|
|
protected virtual void ReceiveEvent(CameraInterActArgs item)
|
|
{
|
|
if (item.Item != gameObject) return;
|
|
ActivateItem();
|
|
}
|
|
|
|
//物体逻辑
|
|
protected virtual void ActivateItem()
|
|
{
|
|
//Debug.Log("Item is activated");
|
|
}
|
|
}
|
|
} |