public void GetInputOn(OthelloBoardBluck obb) { if (obb.TeamNo == 0) { TryToPutNewStone(obb); } }
void TryToPutNewStone(OthelloBoardBluck obb) { int r = obb.R, l = obb.L; if (true // checkCanPutAnyNewStoneOnRL(r, l) ) { TransTeamAfterPutNewStone(turn, r, l); } }
void GetInputByMousePos() { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Input.GetMouseButtonDown(0)) { if (Physics.Raycast(ray, out hit, 10000f)) { if (hit.collider.tag == "BoardBluck") { OthelloBoardBluck bluck = hit.collider.gameObject.GetComponent <OthelloBoardBluck>(); _OhelloGameController.GetInputOn(bluck); } } } }
void GetInputByTouchPos() { Touch touch = Input.GetTouch(0); if ((Input.touchCount > 0) && (touch.phase == TouchPhase.Began)) { Ray ray = Camera.main.ScreenPointToRay(Input.GetTouch(0).position); RaycastHit hit; if (Physics.Raycast(ray, out hit, 10000f)) { if (hit.collider.tag == "BoardBluck") { OthelloBoardBluck bluck = hit.collider.gameObject.GetComponent <OthelloBoardBluck>(); _OhelloGameController.GetInputOn(bluck); } } } new WaitForSeconds(.1f); //0.1초마다 호출 }