Exemple #1
0
    private void Update()
    {
        if (GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player))
        {
            if (isDead)
            {
                if (UIReviveTime == null)
                {
                    UIReviveTime = myChampionData.UIIcon.ReviveTime;
                }

                if (deadEffect == null)
                {
                    deadEffect = Camera.main.GetComponentInChildren <DeadEffect>();
                }

                reviveTime       -= Time.deltaTime;
                UIReviveTime.text = Mathf.FloorToInt(reviveTime).ToString();

                if (Camera.main.GetComponent <RTS_Cam.RTS_Camera>().targetFollow != null)
                {
                    Camera.main.GetComponent <RTS_Cam.RTS_Camera>().ResetTarget();
                }

                if (reviveTime < 0)
                {
                    reviveTime = 10.0f;
                    // UIText 변경
                    UIReviveTime.text          = "";
                    PlayerData.Instance.isDead = false;

                    ReviveSync();
                    // 카메라 캐릭터위치로 옮김
                    Camera.main.transform.position = new Vector3(transform.position.x, Camera.main.transform.position.y, transform.position.z)
                                                     + Camera.main.GetComponent <RTS_Cam.RTS_Camera>().targetOffset;

                    // 카메라 회색화면 끄기
                    deadEffect.TurnOff();

                    myChampionData.UIIcon.ReviveCoverImage.enabled = false;

                    myChampionData.TheAIPath.canMove = true;
                    if (PhotonNetwork.player.GetTeam().ToString().Contains("red"))
                    {
                        transform.position = myChampionData.RedPos;
                        myChampAtk.AStarTargetObj.transform.position = myChampionData.RedPos;
                    }
                    else if (PhotonNetwork.player.GetTeam().ToString().Contains("blue"))
                    {
                        transform.position = myChampionData.BluePos;
                        myChampAtk.AStarTargetObj.transform.position = myChampionData.BluePos;
                    }

                    // 부활할때 idle로
                    myChampionAnimation.AnimationAllOff();
                    this.photonView.RPC("ReviveSync", PhotonTargets.Others, null);
                }
            }
        }

        assistCheck();
    }
Exemple #2
0
    private void Update()
    {
        if (GetComponent <PhotonView>().owner.Equals(PhotonNetwork.player))
        {
            // 플레이어가 사망한 경우
            if (isDead)
            {
                if (uiReviveTime == null)
                {
                    uiReviveTime = myChampionData.UIIcon.reviveTimeText;
                }

                if (deadEffect == null)
                {
                    deadEffect = Camera.main.GetComponentInChildren <DeadEffect>();
                }

                // 부활 시간을 처리한다
                reviveTime       -= Time.deltaTime;
                uiReviveTime.text = Mathf.FloorToInt(reviveTime).ToString();

                if (Camera.main.GetComponent <RTS_Cam.RTS_Camera>().targetFollow != null)
                {
                    Camera.main.GetComponent <RTS_Cam.RTS_Camera>().ResetTarget();
                }

                // 부활까지 기다리는 시간이 끝났다
                if (reviveTime < 0)
                {
                    reviveTime = 10.0f;

                    // UIText를 변경한다
                    uiReviveTime.text          = "";
                    PlayerData.Instance.isDead = false;

                    // 모든 클라이언트에서 동일하게 부활하도록 처리
                    SyncRevive();

                    // 카메라를 캐릭터위치로 옮긴다
                    Camera.main.transform.position = new Vector3(transform.position.x, Camera.main.transform.position.y, transform.position.z)
                                                     + Camera.main.GetComponent <RTS_Cam.RTS_Camera>().targetOffset;

                    // 카메라의 회색화면을 끈다
                    deadEffect.TurnOff();

                    // 기타 설정을 처리
                    myChampionData.UIIcon.reviveCoverImage.enabled = false;
                    myChampionData.theAIPath.canMove = true;

                    if (PhotonNetwork.player.GetTeam().ToString().Contains("red"))
                    {
                        transform.position = myChampionData.redPos;
                        myChampAtk.aStarTargetObj.transform.position = myChampionData.redPos;
                    }
                    else if (PhotonNetwork.player.GetTeam().ToString().Contains("blue"))
                    {
                        transform.position = myChampionData.bluePos;
                        myChampAtk.aStarTargetObj.transform.position = myChampionData.bluePos;
                    }

                    myChampionAnimation.AnimationAllOff();
                    this.photonView.RPC("SyncRevive", PhotonTargets.Others, null);
                }
            }
        }

        // 어시스트를 확인한다
        CheckAssist();
    }