void MakeTextAreaAndButtonForSend() { if (isMyTurn) { pointString = GUI.TextField(new Rect(Screen.width / 2 - 40, Screen.height / 2 - 70, 100, 50), pointString); if (GUI.Button(new Rect(Screen.width / 2 - 40, Screen.height / 2, 100, 50), "보 내 기")) { try { myPoint = int.Parse(pointString); } catch { GameObject obj = GameObject.Find("Again"); obj = Instantiate(editAgainPrefab); obj.name = "Again"; obj.GetComponent <Transform>().position = new Vector3(-3, 5, 0); waitTwoSecond = 2.0f; } if (myPoint > 99 || myPoint < 0 || myPointController.points - myPoint < 0) { waitTwoSecond = 2.0f; pointString = ""; myPoint = -1; GameObject obj = GameObject.Find("Again"); if (obj == null) { obj = Instantiate(editAgainPrefab); obj.name = "Again"; obj.GetComponent <Transform>().position = new Vector3(-3, 5, 0); } } else { pointString = ""; networkController.SendPoints(myPoint); myPointController.SetPoint(myPointController.points - myPoint); myPointController.CheckPoint(my); Debug.Log("sendpoint " + myPoint); Debug.Log(myPointController.getPoint() + " mypoint "); isMyTurn = false; } } } }
void WaitingSignOppPointAndCreateOppResultForFirstAttacker() { if (oppPoint == -1 && isFirst) { GameObject obj = GameObject.Find("Waiting"); if (obj == null) { obj = Instantiate(waitingSignPrefab); obj.GetComponent <Transform>().position = new Vector3(-2.5f, 5, 0); obj.name = "Waiting"; gameInitList.Add(obj.name); } } else if (oppPoint != -1 && isFirst) { if (isReceivePoint == false) { isReceivePoint = true; Debug.Log("comming " + oppPoint); oppPointController.SetPoint(oppPointController.points - oppPoint); oppPointController.CheckPoint(opp); } try { GameObject obj = GameObject.Find("Waiting"); Destroy(obj); } catch { } if (oppPoint < 10) { GameObject obj = GameObject.Find("oppBlack"); if (obj == null) { obj = Instantiate(blackForPointResultPrefab); obj.GetComponent <Transform>().position = new Vector3(-4, 1, 0); obj.name = "oppBlack"; isShowResult = true; gameInitList.Add(obj.name); } } else { GameObject obj = GameObject.Find("oppWhite"); if (obj == null) { obj = Instantiate(whiteForPointResultPrefab); obj.GetComponent <Transform>().position = new Vector3(-4, 1, 0); obj.name = "oppWhite"; gameInitList.Add(obj.name); isShowResult = true; } } } }