private void CmdSelectBlock(int playerId) { PlayerBuild player = GetPlayerBuild(playerId); if (player.GetSelected() != null) { GameObject buildingBlock = Instantiate <GameObject> (player.GetSelected().GetBlock()); buildingBlock.transform.position = player.GetGameObject().transform.position; buildingBlock.GetComponent <BuildingBlock> ().SetPlayer(playerId, player.GetSelectedColor(true)); Debug.Log(buildingBlock); NetworkServer.Spawn(buildingBlock); InputExit(playerId); } }
private void MoveDown(int playerId) { PlayerBuild player = GetPlayerBuild(playerId); //Debug.Log ("Input Down"); UIObject temp; //Debug.Log ("Selected: " + player.GetSelected ()); temp = player.GetSelected(); if (temp != null) { //Debug.Log ("Down: " + temp.GetDown()); temp = temp.GetDown(); if (temp != null) { player.SetSelected(temp); } } }
private void OpenBuildPanel(int playerId) { canvas.SetActive(true); PlayerBuild player = GetPlayerBuild(playerId); player.SetBuilding(true); if (player.GetSelected() == null) { if (uiObjects.Count > 0) { player.SetSelected(uiObjects [0]); } else { Debug.Log("UiObjects for Build Panel is Empty"); } } }