mirror of
https://github.com/DerTyp7/harvestdale-unity.git
synced 2025-10-30 13:07:10 +01:00
asd
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Building : MonoBehaviour
|
||||
public abstract class Building : MonoBehaviour
|
||||
{
|
||||
public bool isPlaced = false;
|
||||
public PlaceableObject placeableObject;
|
||||
|
||||
public abstract void OnPlace();
|
||||
public void Place()
|
||||
{
|
||||
isPlaced = true;
|
||||
BuildingManager.buildings.Add(this);
|
||||
OnPlace();
|
||||
}
|
||||
|
||||
public void Demolish()
|
||||
@@ -20,6 +22,6 @@ public class Building : MonoBehaviour
|
||||
|
||||
public Vector3Int GetGridPosition()
|
||||
{
|
||||
return new Vector3Int(Mathf.RoundToInt(transform.position.x), Mathf.RoundToInt(transform.position.y), 0);
|
||||
return new Vector3Int(Mathf.FloorToInt(transform.position.x), Mathf.RoundToInt(transform.position.y), 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user