fix portal placement

This commit is contained in:
2023-04-06 09:12:15 +02:00
parent 31e96aa10a
commit 0dc7eef753
8 changed files with 128 additions and 15 deletions

View File

@@ -0,0 +1,14 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5aece1c1f67b46afaf249c4520a0478f, type: 3}
m_Name: Place On Bottom Row
m_EditorClassIdentifier:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 49248c593c97bff4f8889e5c4da6c1bb
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,24 @@
using System.Collections.Generic;
using EscapeRoomEngine.Engine.Runtime.Modules;
using UnityEngine;
namespace EscapeRoomEngine.Engine.Runtime.Requirements.Placement
{
/// <summary>
/// This requirement guarantees that the back side of the module is placed on the bottom row of the space.
/// </summary>
[CreateAssetMenu(menuName = "Requirements/Place On Bottom Row")]
public class PlaceOnBottomRow : PlacementRequirement
{
protected override List<Utilities.Placement> FilterCandidates(List<Utilities.Placement> candidates, Module module, Space space)
{
candidates.RemoveAll(candidate =>
{
var (left, right) = candidate.BackCorners;
return !(left.z == 0 && right.z == 0);
});
return candidates;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5aece1c1f67b46afaf249c4520a0478f
timeCreated: 1683644196