feat: Theatre portal
This commit is contained in:
@@ -18,12 +18,30 @@ public class Portal : MonoBehaviour
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
PortalManager pm = FindFirstObjectByType<PortalManager>();
|
||||
if (pm)
|
||||
pm.RegisterPortal(this);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (PortalManager.Instance)
|
||||
PortalManager.Instance.RegisterPortal(this);
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
PortalManager pm = FindFirstObjectByType<PortalManager>();
|
||||
if (pm)
|
||||
pm.UnregisterPortal(this);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (PortalManager.Instance)
|
||||
PortalManager.Instance.UnregisterPortal(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user