Example #1
0
    private RespawnCamera GetRespawnCamera()
    {
        if (_respawnCamera == null)
        {
            var camGO = new GameObject("Player" + playerNumber + "RespawnCam");
            _respawnCamera = camGO.AddComponent <RespawnCamera>();
            var cam = camGO.AddComponent <Camera>();
            cam.rect        = _myCamera.rect;
            cam.cullingMask = _myCamera.cullingMask;
        }

        _respawnCamera.transform.position = _myCamera.transform.position;
        _respawnCamera.transform.rotation = _myCamera.transform.rotation;

        iTween.MoveTo(_respawnCamera.gameObject,
                      iTween.Hash(
                          "position", _respawnCamera.transform.position + transform.up * 1 + transform.forward * -5,
                          "time", 4,
                          "looktarget", transform)
                      );

        return(_respawnCamera);
    }
Example #2
0
 public void AddPendingRespawn(RespawnCamera respawnCamera)
 {
     _pendingRespawns.Add(respawnCamera);
 }
Example #3
0
    private RespawnCamera GetRespawnCamera()
    {
        if (_respawnCamera == null)
        {
            var camGO = new GameObject("Player" + playerNumber + "RespawnCam");
            _respawnCamera = camGO.AddComponent<RespawnCamera>();
            var cam = camGO.AddComponent<Camera>();
            cam.rect = _myCamera.rect;
            cam.cullingMask = _myCamera.cullingMask;
        }

        _respawnCamera.transform.position = _myCamera.transform.position;
        _respawnCamera.transform.rotation = _myCamera.transform.rotation;

        iTween.MoveTo(_respawnCamera.gameObject,
            iTween.Hash(
            "position", _respawnCamera.transform.position + transform.up * 1 + transform.forward * -5,
            "time", 4,
            "looktarget", transform)
            );

        return _respawnCamera;
    }
Example #4
0
 public void AddPendingRespawn(RespawnCamera respawnCamera)
 {
     _pendingRespawns.Add(respawnCamera);
 }