using UnityEngine; /// /// Placement handler for brand-new blocks dragged from the menu. /// public class NewBlockPlacementHandler : IPlacementHandler { private readonly CommandHandler _commandHandler; public NewBlockPlacementHandler(CommandHandler commandHandler) { _commandHandler = commandHandler; Debug.Log("initialize the NewBlockPlacement"); } public void Commit(BlockEditContext ctx) { if (ctx.Block == null) return; _commandHandler.createBlock( ctx.Block.getBlockData()?.blockName, ctx.GhostTransform.position, ctx.GhostTransform.rotation); } public void Cancel(BlockEditContext ctx) { // nothing for now } public void Debugln() { Debug.Log("Hi I'm New"); } }