Last active
September 22, 2018 18:05
-
-
Save tsubaki/19faf499d16ecb97415e53ec26b23b7a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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