void Update() { if (activeGhost != null) { if (Input.GetMouseButtonUp(0)) { mouseDownCounts = true; } updateRaycast(); placeGhost(); if (Input.GetMouseButtonDown(0) && mouseDownCounts) { foreach (Coord coord in adjacentCoords) { if (activeGhost.CanBePlacedAt(coord.X, coord.Z)) { ItemLocationSelectedSignal itemLocationSelectedSignal = new ItemLocationSelectedSignal(activeGhost, coord.X, coord.Z); GameSceneSignalManager.Inst.FireSignal(itemLocationSelectedSignal); Destroy(activeGhost.gameObject); activeGhost = null; adjacentCoords = null; return; } } } } }