✨ Miner tile
This commit is contained in:
@@ -4,6 +4,7 @@ using Godot;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using AceFieldNewHorizon.Scripts.Entities;
|
||||
using AceFieldNewHorizon.Scripts.Tiles;
|
||||
|
||||
namespace AceFieldNewHorizon.Scripts.System;
|
||||
|
||||
@@ -376,7 +377,7 @@ public partial class NaturalResourceGenerator : Node2D
|
||||
return false;
|
||||
}
|
||||
|
||||
if (scene.Instantiate() is not Node2D instance)
|
||||
if (scene.Instantiate() is not BaseTile instance)
|
||||
{
|
||||
GD.PrintErr($"{LogPrefix} Failed to instantiate scene for: {tileType}");
|
||||
return false;
|
||||
@@ -387,6 +388,7 @@ public partial class NaturalResourceGenerator : Node2D
|
||||
var offset = GridUtils.GetCenterOffset(rotatedSize, 0f); // 0f for no rotation
|
||||
instance.GlobalPosition = GridUtils.GridToWorld(cell) + offset;
|
||||
instance.ZIndex = (int)building.Layer;
|
||||
instance.Grid = Grid;
|
||||
AddChild(instance);
|
||||
Grid.OccupyArea(cell, instance, building.Size, 0f, building.Layer);
|
||||
// GD.Print($"{LogPrefix} Successfully placed {tileType} at {cell}");
|
||||
|
Reference in New Issue
Block a user