correctly delete old rooms
This commit is contained in:
@@ -44,20 +44,24 @@ namespace EscapeRoomEngine.Portal.Runtime
|
||||
protected void Start()
|
||||
{
|
||||
if (hasClone)
|
||||
{
|
||||
clone = PortalDriverClone.Create(this);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (hasClone && clone.gameObject.activeSelf)
|
||||
{
|
||||
clone.UpdatePosition(transform);
|
||||
}
|
||||
}
|
||||
|
||||
public void EnableClone(Portal at)
|
||||
{
|
||||
if (hasClone)
|
||||
{
|
||||
Logger.Log($"Enabled {clone}", LogType.Portals);
|
||||
Logger.Log($"Enabled {clone} at {at}", LogType.Portals);
|
||||
|
||||
clone.portal = at;
|
||||
clone.gameObject.SetActive(true);
|
||||
@@ -68,7 +72,7 @@ namespace EscapeRoomEngine.Portal.Runtime
|
||||
{
|
||||
if (hasClone && at.Equals(clone.portal)) // don't disable clones that are already at a different portal
|
||||
{
|
||||
Logger.Log($"Disabled {clone}", LogType.Portals);
|
||||
Logger.Log($"Disabled {clone} at {clone.portal}", LogType.Portals);
|
||||
|
||||
clone.portal = null;
|
||||
clone.gameObject.SetActive(false);
|
||||
|
||||
Reference in New Issue
Block a user