public void CreateObstacle() { GridCell deployCell = Grid.Instance.GetCell(cellIdToPosition); Transform tr = PhotonNetwork.Instantiate(ObstacleCodeCall, deployCell.transform.position, Quaternion.identity, 0).transform; Deployable towerComp = tr.GetComponent <Deployable>(); towerComp.InitialDeploy(deployCell.CellId); }
public void Deploy(GridCell deployCell) { GameObject Unit = PhotonNetwork.Instantiate(objectSpawnCodeCall, deployCell.transform.position, Quaternion.identity, 0); if (Unit == null) { return; } if (deployCell.HasObstacle()) { PhotonNetwork.Destroy(Unit); return; } Deployable d = Unit.GetComponent <Deployable>(); if (d == null) { Unit = null; return; } d.InitialDeploy(deployCell.CellId); d = null; Unit = null; }