com.guru.unity.sdk/Runtime/Code/SDK/GuruSDK.Threading.cs

29 lines
587 B
C#
Raw Permalink Normal View History

2024-04-09 08:58:08 +00:00
namespace Guru
{
using System;
using UnityEngine;
public partial class GuruSDK
{
private ThreadHandler _threadHandler;
private void InitThreadHandler()
{
_threadHandler = new ThreadHandler();
RegisterUpdater(_threadHandler);
}
private void AddActionToMainThread(Action action)
{
_threadHandler?.AddAction(action);
}
public static void RunOnMainThread(Action action)
{
Instance.AddActionToMainThread(action);
}
}
}