mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
优化属性更新逻辑
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using JNGame.Util;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Plugins.JNGame.Util
|
||||
@@ -107,6 +108,30 @@ namespace Plugins.JNGame.Util
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 主线程分发事件 [禁止帧同步中使用主线分发事件]
|
||||
/// </summary>
|
||||
public void TryMainDispatch<T>(string eventId, T args)
|
||||
{
|
||||
UnityMainThreadDispatcher.Instance.Enqueue(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Dispatch<T>(eventId,args);
|
||||
}catch(Exception e){Debug.LogError(e.Message);}
|
||||
});
|
||||
}
|
||||
public void TryMainDispatch(string eventId)
|
||||
{
|
||||
UnityMainThreadDispatcher.Instance.Enqueue(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Dispatch(eventId);
|
||||
}catch(Exception e){Debug.LogError(e.Message);}
|
||||
});
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
|
Reference in New Issue
Block a user