split into multiple assemblies
This commit is contained in:
29
Assets/Desert/Runtime/DesertFloor.cs
Normal file
29
Assets/Desert/Runtime/DesertFloor.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using NaughtyAttributes;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace EscapeRoomEngine.Desert.Runtime
|
||||
{
|
||||
public class DesertFloor : MonoBehaviour
|
||||
{
|
||||
[Required] public GameObject floor;
|
||||
[Required] public Transform floorParent;
|
||||
public Vector2 tileSize;
|
||||
public Vector2Int tileCount;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
for (var z = -tileCount.y; z <= tileCount.y; z++)
|
||||
{
|
||||
for (var x = -tileCount.x; x <= tileCount.x; x++)
|
||||
{
|
||||
var f = Instantiate(floor, floorParent);
|
||||
f.transform.localPosition = new Vector3(x * tileSize.x, 0, z * tileSize.y);
|
||||
f.isStatic = true;
|
||||
}
|
||||
}
|
||||
|
||||
SceneVisibilityManager.instance.DisablePicking(floorParent.gameObject, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user