Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (!readyOn)
        {
            if ((publicVariable.getIsPlayer() && publicVariable.getMasangDone()) || (!PhotonNetwork.isMasterClient && publicVariable.getMasangDone()))
            {
                publicVariable.setIsPlayer(true);
                ReadyButton.gameObject.SetActive(true);
            }
        }

        if (publicVariable.getIsPlayer() || !PhotonNetwork.isMasterClient || publicVariable.getIsStart())
        {
            waitingImage.gameObject.SetActive(false);
        }
        else
        {
            waitingImage.gameObject.SetActive(true);
        }
    }
Esempio n. 2
0
    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);
        }
    }