Exemplo n.º 1
0
 public void EnableArenaCamera()
 {
     state = GameCameraType.Arena;
     observeCamera.ObservePlayer(null);
     playerObserver.Observe(null, 0);
     orbitCamera.targetTransform = null;
 }
Exemplo n.º 2
0
 public void EnableArenaCamera()
 {
     state = GameCameraType.Arena;
     this.observeCamera.ObservePlayer(null);
     this.gameManager.ObservePlayer(null, 0);
     this.orbitCamera.targetTransform = null;
 }
Exemplo n.º 3
0
        public void SetType(GameCameraType type)
        {
            if (m_CameraType == type)
            {
                return;
            }
            if (type == GameCameraType.FreeLook)
            {
                freeLookVCam.transform.position = focusLookVCam.transform.position;
                freeLookVCam.gameObject.SetActive(true);
                focusLookVCam.gameObject.SetActive(false);
            }
            else
            {
                focusLookVCam.transform.position = freeLookVCam.transform.position;
                freeLookVCam.gameObject.SetActive(false);
                focusLookVCam.gameObject.SetActive(true);
            }

            m_CameraType = type;
        }
Exemplo n.º 4
0
    public bool ObserveNextPlayer()
    {
        var playerCount = playerManager.GetPlayerCount(true);

        if (playerCount == 0)
        {
            return(true);
        }

        state = GameCameraType.Observe;
        focusTargetCamera.enabled = false;
        observedPlayerIndex       = (observedPlayerIndex + 1) % playerCount;
        var player = playerManager.GetPlayerByIndex(observedPlayerIndex);

        //var player = this.playerManager.GetRandomPlayer(this.orbitCamera.targetTransform);
        if (!player)
        {
            return(true);
        }

        ObservePlayer(player);
        return(false);
    }
Exemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        if (gameManager == null ||
            gameManager.RavenNest == null ||
            !gameManager.RavenNest.Authenticated ||
            !gameManager.IsLoaded)
        {
            return;
        }

        if (state != GameCameraType.Free &&
            Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.Tab))
        {
            state = GameCameraType.Free;
            playerObserver.Observe(null, 0);
            observeCamera.ObservePlayer(null);
            orbitCamera.targetTransform = null;
            freeCamera.enabled          = true;
            orbitCamera.enabled         = false;
            focusTargetCamera.enabled   = false;

            AllowJoinObserve = false;

            return;
        }

        if (Input.GetKeyDown(KeyCode.Tab))
        {
            if (ObserveNextPlayer())
            {
                return;
            }
            return;
        }

        if (state == GameCameraType.Arena)
        {
            freeCamera.enabled        = false;
            orbitCamera.enabled       = false;
            focusTargetCamera.enabled = true;
            if (arena)
            {
                focusTargetCamera.Target = arena.transform;
            }
        }
        else if (state == GameCameraType.Raid)
        {
            freeCamera.enabled        = false;
            orbitCamera.enabled       = false;
            focusTargetCamera.enabled = true;
            if (arena)
            {
                focusTargetCamera.Target = raidManager.Boss.transform;
            }
        }
        else if (state == GameCameraType.Observe)
        {
            AllowJoinObserve        = true;
            observeNextPlayerTimer -= Time.deltaTime;
            if (observeNextPlayerTimer <= 0)
            {
                ObserveNextPlayer();
            }
        }
    }
Exemplo n.º 6
0
    // Update is called once per frame
    void Update()
    {
        if (gameManager == null ||
            gameManager.RavenNest == null ||
            !gameManager.RavenNest.Authenticated ||
            !gameManager.IsLoaded)
        {
            return;
        }

        if (state != GameCameraType.Free &&
            Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.Tab))
        {
            state = GameCameraType.Free;
            this.gameManager.ObservePlayer(null, 0);
            this.observeCamera.ObservePlayer(null);
            this.orbitCamera.targetTransform = null;
            this.freeCamera.enabled          = true;
            this.orbitCamera.enabled         = false;
            this.focusTargetCamera.enabled   = false;
            return;
        }

        if (Input.GetKeyDown(KeyCode.Tab))
        {
            if (ObserveNextPlayer())
            {
                return;
            }
            return;
        }

        if (state == GameCameraType.Arena)
        {
            this.freeCamera.enabled        = false;
            this.orbitCamera.enabled       = false;
            this.focusTargetCamera.enabled = true;
            if (arena)
            {
                this.focusTargetCamera.Target = arena.transform;
            }
        }
        else if (state == GameCameraType.Raid)
        {
            this.freeCamera.enabled        = false;
            this.orbitCamera.enabled       = false;
            this.focusTargetCamera.enabled = true;
            if (arena)
            {
                this.focusTargetCamera.Target = raidManager.Boss.transform;
            }
        }
        else if (state == GameCameraType.Observe)
        {
            this.observeNextPlayerTimer -= Time.deltaTime;
            if (this.orbitCamera.enabled && this.observeNextPlayerTimer <= 0)
            {
                var playerCount = this.playerManager.GetPlayerCount(true);
                this.observedPlayerIndex = (this.observedPlayerIndex + 1) % playerCount;
                var player = this.playerManager.GetPlayerByIndex(this.observedPlayerIndex);
                //var player = this.playerManager.GetRandomPlayer(this.orbitCamera.targetTransform);
                if (!player)
                {
                    return;
                }

                this.observeNextPlayerTimer = ObserverJumpTimer;
                ObservePlayer(player, this.observeNextPlayerTimer);
            }
        }
    }