Exemplo n.º 1
0
        public override void OnPlayerDied(Player player, Controllable controllable)
        {
            base.OnPlayerDied(player);

            if (player == null)
            {
                return;
            }

            MyHud.BroadcastMessage($"{player.Name} has died.");

            if (Authority)
            {
                var position  = controllable.Position;
                var eyeAngles = controllable.EyeAngles;

                var deathCamera = new DeathCamera();
                deathCamera.Spawn();
                player.Controlling = deathCamera;

                deathCamera.Position = position;
                deathCamera.Teleport(position);

                deathCamera.EyeAngles       = eyeAngles;
                deathCamera.ClientEyeAngles = eyeAngles;

                // Handle team role shit
            }
        }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            if (camSwitch)
            {
                thirdPersonCamera.gameObject.SetActive(false);
                firstPersonCamera.gameObject.SetActive(true);

                Debug.Log("1st");
            }
            else
            {
                thirdPersonCamera.gameObject.SetActive(true);
                firstPersonCamera.gameObject.SetActive(false);

                Debug.Log("3rd");
            }


            camSwitch = !camSwitch;
        }
        if (PlayerDeath.death == true)
        {
            deathCamera.gameObject.SetActive(true);
            thirdPersonCamera.gameObject.SetActive(false);
            dc = GameObject.Find("DeathCamera").GetComponent <DeathCamera>();
            dc.CameraBackwards();
        }
    }
Exemplo n.º 3
0
        public override void OnKilled()
        {
            base.OnKilled();

            Inventory.DeleteContents();

            BecomeRagdollOnClient(Vector3.Zero, 0);

            Controller = null;
            Camera     = new DeathCamera();

            EnableAllCollisions = false;
            EnableDrawing       = false;
        }
Exemplo n.º 4
0
 private void Start()
 {
     m_topDown   = GetComponent <TopDownCamera> ();
     m_death     = GetComponent <DeathCamera> ();
     m_spectator = GetComponent <SpectatorCamera> ();
 }