完善编辑器

This commit is contained in:
tangbin
2025-07-19 12:48:11 +08:00
parent 2df2efaa3e
commit b8b50ec90b
27 changed files with 360 additions and 124 deletions

View File

@@ -24,14 +24,16 @@ public class UITeleportPanel : MonoBehaviour
UIWindow.Instance.ShowMessage("teleportItem.prefabʧ<62><CAA7>");
return;
}
GameObject go = Instantiate(obj) as GameObject; ;
go.transform.SetParent(itemParent, false);
int size = MapManager.Instance.AddTeleportPointSize();
Vector2Int newPos = MapManager.Instance.GetCameraPos();
UITeleportItem item = go.GetComponent<UITeleportItem>();
item.itemIdx = size;
var gridPos = MapManager.Instance.map.selector.getMapGrid(Camera.main.transform.position);
MapManager.Instance.CreateSpecialPoint(gridPos, item);
item.editCellType = MapManager.EditCellType.TeleportCell;
item.SetItemPos(newPos);
MapManager.Instance.CreateSpecialPoint(newPos, item);
}
public void AddItem(Vector2Int pos, int nextMapId, Vector2Int newMapPos)
@@ -52,6 +54,7 @@ public class UITeleportPanel : MonoBehaviour
item.txtPos.text = $"{pos.x},{pos.y}";
item.txtNextMapID.text = nextMapId.ToString();
item.txtNextMapPos.text = $"{newMapPos.x},{newMapPos.y}";
item.editCellType = MapManager.EditCellType.TriggerCell;
MapManager.Instance.CreateSpecialPoint(pos, item);
}