small fixes in portal clones and Terminal B
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Logger = EscapeRoomEngine.Engine.Runtime.Utilities.Logger;
|
||||
using LogType = EscapeRoomEngine.Engine.Runtime.Utilities.LogType;
|
||||
|
||||
namespace EscapeRoomEngine.Portal.Runtime
|
||||
{
|
||||
@@ -57,6 +59,8 @@ namespace EscapeRoomEngine.Portal.Runtime
|
||||
{
|
||||
if (hasClone)
|
||||
{
|
||||
Logger.Log($"Enabled {clone}", LogType.Portals);
|
||||
|
||||
clone.portal = at;
|
||||
clone.gameObject.SetActive(true);
|
||||
}
|
||||
@@ -66,6 +70,8 @@ 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);
|
||||
|
||||
clone.portal = null;
|
||||
clone.gameObject.SetActive(false);
|
||||
}
|
||||
@@ -73,6 +79,8 @@ namespace EscapeRoomEngine.Portal.Runtime
|
||||
|
||||
public void Teleport(Portal from, Portal to)
|
||||
{
|
||||
Logger.Log($"Teleported {this} from {from} to {to}", LogType.Portals);
|
||||
|
||||
var m = to.portalTransform.localToWorldMatrix * Portal.HalfRotation *
|
||||
from.portalTransform.worldToLocalMatrix * traveller.localToWorldMatrix;
|
||||
traveller.SetPositionAndRotation(m.GetPosition(), m.rotation);
|
||||
|
||||
Reference in New Issue
Block a user