Added hold to place
This commit is contained in:
@@ -2,9 +2,13 @@
|
|||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using UnityEngine.Scripting;
|
using UnityEngine.Scripting;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
#endif // UNITY_EDITOR
|
||||||
|
|
||||||
namespace Fruitomation.Game
|
namespace Fruitomation.Game
|
||||||
{
|
{
|
||||||
@@ -53,6 +57,24 @@ namespace Fruitomation.Game
|
|||||||
|
|
||||||
private bool[,] InhabitedCells { get; } = new bool[96, 49];
|
private bool[,] InhabitedCells { get; } = new bool[96, 49];
|
||||||
private List<Building> Buildings { get; } = new();
|
private List<Building> Buildings { get; } = new();
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
|
||||||
|
private static BuildingManager Instance;
|
||||||
|
private void Awake() => Instance = this;
|
||||||
|
|
||||||
|
[MenuItem("Fruitomation/Clear Buildings")]
|
||||||
|
public static void ClearBuildings()
|
||||||
|
{
|
||||||
|
foreach (Building b in Instance.Buildings)
|
||||||
|
{
|
||||||
|
Destroy(b.gameObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
Instance.Buildings.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // UNITY_EDITOR
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ namespace Fruitomation.UI
|
|||||||
BuildingPreview.rectTransform.anchoredPosition = p4;
|
BuildingPreview.rectTransform.anchoredPosition = p4;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (Input.GetMouseButtonDown(0) && MouseOnGrid)
|
if (Input.GetMouseButton(0) && MouseOnGrid)
|
||||||
{
|
{
|
||||||
BuildingManager.AddBuildingAt(p1, SelectedBuildingToBuild, FlipCurrentBuilding);
|
BuildingManager.AddBuildingAt(p1, SelectedBuildingToBuild, FlipCurrentBuilding);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user