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); }
public void AddPendingRespawn(RespawnCamera respawnCamera) { _pendingRespawns.Add(respawnCamera); }
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; }