mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
升级拓展GameEvent,支持基于Interface的方法调用抛出事件,以及自动化根据声明的Interface来生成实现代码。
升级拓展GameEvent,支持基于Interface的方法调用抛出事件,以及自动化根据声明的Interface来生成实现代码。
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 610229edeca4417685ffd07f18b2b9f1
|
||||
timeCreated: 1702379817
|
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using TEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
/// <summary>
|
||||
/// 示例货币枚举。
|
||||
/// </summary>
|
||||
public enum CurrencyType
|
||||
{
|
||||
None,
|
||||
Gold,
|
||||
Diamond,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 示意逻辑层事件。
|
||||
/// <remarks> 优化抛出事件,通过接口约束事件参数。</remarks>
|
||||
/// <remarks> example: GameEvent.Get<IActorLogicEvent>().OnMainPlayerCurrencyChange(CurrencyType.Gold,oldVal,newVal); </remarks>
|
||||
/// </summary>
|
||||
[EventInterface(EEventGroup.GroupLogic)]
|
||||
interface IActorLogicEvent
|
||||
{
|
||||
void OnMainPlayerDataChange();
|
||||
|
||||
void OnMainPlayerLevelChange();
|
||||
|
||||
void OnMainPlayerGoldChange(uint oldVal, uint newVal);
|
||||
|
||||
void OnMainPlayerDiamondChange(uint oldVal, uint newVal);
|
||||
|
||||
void OnMainPlayerBindDiamondChange(uint oldVal, uint newVal);
|
||||
|
||||
void OnMainPlayerCurrencyChange(CurrencyType type, uint oldVal, uint newVal);
|
||||
|
||||
void OnMainPlayerExpChange(ulong oldVal, ulong newVal);
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d4558cb74e8462a86f0ee3461f6b7c9
|
||||
timeCreated: 1702383645
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 90e13cc92c5d42f28b4f5fab599f472a
|
||||
timeCreated: 1702379805
|
@@ -0,0 +1,17 @@
|
||||
using TEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
/// <summary>
|
||||
/// 示意UI层事件。
|
||||
/// <remarks> 优化抛出事件,通过接口约束事件参数。</remarks>
|
||||
/// <remarks> example: GameEvent.Get<ILoginUI>().OnRoleLogin(isReconnect); </remarks>
|
||||
/// </summary>
|
||||
[EventInterface(EEventGroup.GroupUI)]
|
||||
public interface ILoginUI
|
||||
{
|
||||
public void OnRoleLogin(bool isReconnect);
|
||||
|
||||
public void OnRoleLoginOut();
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33b45e62bd3447498acfe874017b9a35
|
||||
timeCreated: 1702433755
|
Reference in New Issue
Block a user