small fixes in portal clones and Terminal B
This commit is contained in:
@@ -8,36 +8,6 @@ PrefabInstance:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_TransformParent: {fileID: 0}
|
m_TransformParent: {fileID: 0}
|
||||||
m_Modifications:
|
m_Modifications:
|
||||||
- target: {fileID: 862697354921996744, guid: be106bd65f3826b41a6bee8bd820f021,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalScale.x
|
|
||||||
value: 4
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 862697354921996744, guid: be106bd65f3826b41a6bee8bd820f021,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalScale.z
|
|
||||||
value: 4
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 5095331294769565189, guid: be106bd65f3826b41a6bee8bd820f021,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalScale.x
|
|
||||||
value: 4
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 5095331294769565189, guid: be106bd65f3826b41a6bee8bd820f021,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalScale.z
|
|
||||||
value: 4
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 6165579071297624197, guid: be106bd65f3826b41a6bee8bd820f021,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalScale.x
|
|
||||||
value: 4
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 6165579071297624197, guid: be106bd65f3826b41a6bee8bd820f021,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalScale.z
|
|
||||||
value: 4
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 7756295983983028816, guid: be106bd65f3826b41a6bee8bd820f021,
|
- target: {fileID: 7756295983983028816, guid: be106bd65f3826b41a6bee8bd820f021,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_RootOrder
|
propertyPath: m_RootOrder
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ Transform:
|
|||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
|
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children:
|
||||||
|
- {fileID: 7563944636909047309}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
||||||
@@ -132,3 +133,118 @@ MonoBehaviour:
|
|||||||
hasClone: 1
|
hasClone: 1
|
||||||
entrySide: 0
|
entrySide: 0
|
||||||
clone: {fileID: 0}
|
clone: {fileID: 0}
|
||||||
|
--- !u!1 &6828564445046893459
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 7563944636909047309}
|
||||||
|
- component: {fileID: 2185477589741514083}
|
||||||
|
- component: {fileID: 5005297735248417344}
|
||||||
|
m_Layer: 6
|
||||||
|
m_Name: Point Light
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &7563944636909047309
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 6828564445046893459}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 3680365890358827431}
|
||||||
|
m_RootOrder: -1
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!108 &2185477589741514083
|
||||||
|
Light:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 6828564445046893459}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 10
|
||||||
|
m_Type: 2
|
||||||
|
m_Shape: 0
|
||||||
|
m_Color: {r: 1, g: 0.8117647, b: 0, a: 1}
|
||||||
|
m_Intensity: 0.001
|
||||||
|
m_Range: 0.5
|
||||||
|
m_SpotAngle: 30
|
||||||
|
m_InnerSpotAngle: 21.80208
|
||||||
|
m_CookieSize: 10
|
||||||
|
m_Shadows:
|
||||||
|
m_Type: 0
|
||||||
|
m_Resolution: -1
|
||||||
|
m_CustomResolution: -1
|
||||||
|
m_Strength: 1
|
||||||
|
m_Bias: 0.05
|
||||||
|
m_NormalBias: 0.4
|
||||||
|
m_NearPlane: 0.2
|
||||||
|
m_CullingMatrixOverride:
|
||||||
|
e00: 1
|
||||||
|
e01: 0
|
||||||
|
e02: 0
|
||||||
|
e03: 0
|
||||||
|
e10: 0
|
||||||
|
e11: 1
|
||||||
|
e12: 0
|
||||||
|
e13: 0
|
||||||
|
e20: 0
|
||||||
|
e21: 0
|
||||||
|
e22: 1
|
||||||
|
e23: 0
|
||||||
|
e30: 0
|
||||||
|
e31: 0
|
||||||
|
e32: 0
|
||||||
|
e33: 1
|
||||||
|
m_UseCullingMatrixOverride: 0
|
||||||
|
m_Cookie: {fileID: 0}
|
||||||
|
m_DrawHalo: 0
|
||||||
|
m_Flare: {fileID: 0}
|
||||||
|
m_RenderMode: 0
|
||||||
|
m_CullingMask:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_Lightmapping: 4
|
||||||
|
m_LightShadowCasterMode: 0
|
||||||
|
m_AreaSize: {x: 1, y: 1}
|
||||||
|
m_BounceIntensity: 1
|
||||||
|
m_ColorTemperature: 6570
|
||||||
|
m_UseColorTemperature: 0
|
||||||
|
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_UseBoundingSphereOverride: 0
|
||||||
|
m_UseViewFrustumForShadowCasterCull: 1
|
||||||
|
m_ShadowRadius: 0
|
||||||
|
m_ShadowAngle: 0
|
||||||
|
--- !u!114 &5005297735248417344
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 6828564445046893459}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Version: 1
|
||||||
|
m_UsePipelineSettings: 1
|
||||||
|
m_AdditionalLightsShadowResolutionTier: 2
|
||||||
|
m_LightLayerMask: 1
|
||||||
|
m_CustomShadowLayers: 0
|
||||||
|
m_ShadowLayerMask: 1
|
||||||
|
m_LightCookieSize: {x: 1, y: 1}
|
||||||
|
m_LightCookieOffset: {x: 0, y: 0}
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ namespace EscapeRoomEngine.Engine.Runtime.Utilities
|
|||||||
RoomGeneration,
|
RoomGeneration,
|
||||||
RequirementResolution,
|
RequirementResolution,
|
||||||
PuzzleFlow,
|
PuzzleFlow,
|
||||||
PuzzleDetail
|
PuzzleDetail,
|
||||||
|
Portals
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Logger : MonoBehaviour
|
public class Logger : MonoBehaviour
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace EscapeRoomEngine.Portal.Runtime
|
namespace EscapeRoomEngine.Portal.Runtime
|
||||||
{
|
{
|
||||||
[RequireComponent(typeof(Collider))]
|
|
||||||
public class Portal : DoorState
|
public class Portal : DoorState
|
||||||
{
|
{
|
||||||
public static readonly Matrix4x4 HalfRotation = Matrix4x4.Rotate(Quaternion.Euler(0, 180, 0));
|
public static readonly Matrix4x4 HalfRotation = Matrix4x4.Rotate(Quaternion.Euler(0, 180, 0));
|
||||||
@@ -31,9 +30,6 @@ namespace EscapeRoomEngine.Portal.Runtime
|
|||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
// check whether the collider is set up correctly
|
|
||||||
if (!GetComponent<Collider>().isTrigger) throw new Exception("Collider must be a trigger.");
|
|
||||||
|
|
||||||
DoorEvent += (_, type) =>
|
DoorEvent += (_, type) =>
|
||||||
{
|
{
|
||||||
if (type == DoorEventType.Connected)
|
if (type == DoorEventType.Connected)
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using Logger = EscapeRoomEngine.Engine.Runtime.Utilities.Logger;
|
||||||
|
using LogType = EscapeRoomEngine.Engine.Runtime.Utilities.LogType;
|
||||||
|
|
||||||
namespace EscapeRoomEngine.Portal.Runtime
|
namespace EscapeRoomEngine.Portal.Runtime
|
||||||
{
|
{
|
||||||
@@ -57,6 +59,8 @@ namespace EscapeRoomEngine.Portal.Runtime
|
|||||||
{
|
{
|
||||||
if (hasClone)
|
if (hasClone)
|
||||||
{
|
{
|
||||||
|
Logger.Log($"Enabled {clone}", LogType.Portals);
|
||||||
|
|
||||||
clone.portal = at;
|
clone.portal = at;
|
||||||
clone.gameObject.SetActive(true);
|
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
|
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.portal = null;
|
||||||
clone.gameObject.SetActive(false);
|
clone.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
@@ -73,6 +79,8 @@ namespace EscapeRoomEngine.Portal.Runtime
|
|||||||
|
|
||||||
public void Teleport(Portal from, Portal to)
|
public void Teleport(Portal from, Portal to)
|
||||||
{
|
{
|
||||||
|
Logger.Log($"Teleported {this} from {from} to {to}", LogType.Portals);
|
||||||
|
|
||||||
var m = to.portalTransform.localToWorldMatrix * Portal.HalfRotation *
|
var m = to.portalTransform.localToWorldMatrix * Portal.HalfRotation *
|
||||||
from.portalTransform.worldToLocalMatrix * traveller.localToWorldMatrix;
|
from.portalTransform.worldToLocalMatrix * traveller.localToWorldMatrix;
|
||||||
traveller.SetPositionAndRotation(m.GetPosition(), m.rotation);
|
traveller.SetPositionAndRotation(m.GetPosition(), m.rotation);
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ namespace EscapeRoomEngine.Portal.Runtime
|
|||||||
|
|
||||||
public void UpdatePosition(Transform cloning)
|
public void UpdatePosition(Transform cloning)
|
||||||
{
|
{
|
||||||
var m = portal.transform.localToWorldMatrix * Portal.HalfRotation *
|
var m = portal.portalTransform.localToWorldMatrix * Portal.HalfRotation *
|
||||||
portal.linkedPortal.transform.worldToLocalMatrix * cloning.localToWorldMatrix;
|
portal.linkedPortal.portalTransform.worldToLocalMatrix * cloning.localToWorldMatrix;
|
||||||
transform.SetPositionAndRotation(m.GetPosition(), m.rotation);
|
transform.SetPositionAndRotation(m.GetPosition(), m.rotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -806,7 +806,7 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
loggingEnabled: 1
|
loggingEnabled: 1
|
||||||
typeFilter: 000000000400000006000000
|
typeFilter: 0000000008000000
|
||||||
--- !u!1 &1943716334
|
--- !u!1 &1943716334
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: f62c9c65cf3354c93be831c8bc075510, type: 3}
|
m_Script: {fileID: 11500000, guid: f62c9c65cf3354c93be831c8bc075510, type: 3}
|
||||||
m_Name: SSAO
|
m_Name: SSAO
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Active: 1
|
m_Active: 0
|
||||||
m_Shader: {fileID: 4800000, guid: 0849e84e3d62649e8882e9d6f056a017, type: 3}
|
m_Shader: {fileID: 4800000, guid: 0849e84e3d62649e8882e9d6f056a017, type: 3}
|
||||||
m_Settings:
|
m_Settings:
|
||||||
Downsample: 0
|
Downsample: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user