public override void ForcePlaceAt(GridBlock pos) { if (spawnedObject == null) { spawnedObject = Instantiate(Prefab, pos.Position, Quaternion.identity); } ApplyPlacement(null, pos, pos.Position); }
public override void StartPlacing(Player player, GridPosition pos, Vector3 worldPos) { if (Reference.Reference != null) { return; } if (spawnedObject == null) { spawnedObject = Instantiate(Prefab, worldPos, Quaternion.identity); } spawnedObject.gameObject.SetActive(true); spawnedObject.transform.position = worldPos; }
public override void ApplyPlacement(Player player, GridBlock block, Vector3 worldPos) { if (Reference.Reference != null) { return; } spawnedObject.transform.position = block.GridPosition.WorldPosition; Reference.Reference = spawnedObject; spawnedObject.SetupObject(block); spawnedObject.transform.SetParent(PlaceableParent.Reference); WorldObjectList.Add(spawnedObject); spawnedObject = null; }