private void setMovePosition(GameObject touchTarget) { Vector3 vc; if (movedPosition != null) { Destroy(movedPosition); } vc = touchTarget.transform.position; if (publicVariable.getIsModeling()) { vc.y += 0.12f; movedPosition = Instantiate(ArrowMark3D, anchor.transform); } else { vc.y += 0.04f; movedPosition = Instantiate(ArrowMark, anchor.transform); } movedPosition.transform.position = vc; }
void FixedUpdate() { if (Input.GetMouseButtonDown(0) && nowTurn.Equals(myTag)) { touchTarget = GetClickedObject(); if (!touchTarget.tag.Equals("Field")) { removeAllEnemyObjs(); if (lastMeObj != null) { removeObj(lastMeObj); } if (lastMovedPosition != null) { removeObj(lastMovedPosition); } } if (touchTarget.tag.Equals("Han") || touchTarget.tag.Equals("Cho")) // 말 선택시 { if (isChoosing && !touchTarget.tag.Equals(myTag)) // 말 선택 중 다른 팀 선택 했을때 { if (touchTarget.GetComponent <MalScript>().getSensorObj().GetComponent <Renderer>().enabled) { view.RPC("attack_RPC", PhotonTargets.All, lastTouch.GetComponent <MalScript>().getSensorObj().name, touchTarget.GetComponent <MalScript>().getSensorObj().name); offAllSensors(); isChoosing = false; } } else if (touchTarget.tag.Equals(myTag)) // 자기 팀을 선택 하면 { offAllSensors(); lastMeObj = setMeObj(touchTarget); lastTouch = touchTarget; if (publicVariable.getIsModeling()) { touchVoice(touchTarget.name); } searchPath.searchPath(touchTarget.GetComponent <MalScript>().getSensorObj().name, touchTarget.name); isChoosing = true; } } else if (touchTarget.tag.Equals("Sensor")) // 센서 선택시 { if (isChoosing && touchTarget.GetComponent <Renderer>().enabled) // 말 선택 중 이동가능한 센서 선택시 { preSensor = lastTouch.GetComponent <MalScript>().getSensorObj().name; view.RPC("move_RPC", PhotonTargets.All, preSensor, touchTarget.name); isChoosing = false; offAllSensors(); } } } if (!publicVariable.getIsPlayer()) // 상대나가면 승리 { aud.PlayOneShot(winSound); WinPanel.SetActive(true); PlayingSound.SetActive(false); JangGoonSound.SetActive(false); } }