Instantly share code, notes, and snippets.

Embed
What would you like to do?
using Unity.Entities;
using UnityEngine;
public class WorldSwitcher : MonoBehaviour
{
public void GameWorldOnly()
{
// World 0のみ有効化、World 1は停止
ScriptBehaviourUpdateOrder.UpdatePlayerLoop(World.AllWorlds[0]);
}
public void MenuWorldOnly()
{
// World 0は停止、World 1のみ有効化
ScriptBehaviourUpdateOrder.UpdatePlayerLoop(World.AllWorlds[1]);
}
public void BothWorld()
{
// World 0と1が有効化
ScriptBehaviourUpdateOrder.UpdatePlayerLoop(World.AllWorlds[0], World.AllWorlds[1]);
}
public void StopAllWorld()
{
// 全てのWorldのSystemが無効化
ScriptBehaviourUpdateOrder.UpdatePlayerLoop(null);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment