public void OnBeginDrag(PointerEventData eventData) { if (isInteractable) { var entity = Instantiate(prefab, Vector3.zero, Quaternion.identity); draggableBuilding = entity.GetComponent <IDraggable>(); buildingEntity = entity.GetComponent <IBuilding>(); var productionBuilding = entity.GetComponent <Entities.IProductionBuilding>(); productionBuilding?.SetData(buildingData); draggableBuilding.BeginDrag(); } }