Skip to content

Commit

Permalink
Minor note re. tutorial hints post-respawn in VR mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tyson-kubota committed Dec 3, 2017
1 parent 9e30c03 commit 8129f20
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
35 changes: 16 additions & 19 deletions FallingPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ function ShowDeathInterstitialVR() {
}

function RespawnAfterDeathInterstitialVR() {
Debug.Log('called RespawnAfterDeathInterstitialVR');
isExitableFromVR = false;

yield DeathFadeVR(0.5, FadeDir.Out);
Expand Down Expand Up @@ -353,10 +352,10 @@ function RespawnAfterDeathInterstitialVR() {
}

function DeathRespawn () {
isPausable = false;
rb.isKinematic = true;
lifeStartTime = Time.time;
var respawnPosition = Respawn.currentRespawn.transform.position;
isPausable = false;
rb.isKinematic = true;
lifeStartTime = Time.time;
var respawnPosition = Respawn.currentRespawn.transform.position;

if (FallingLaunch.isVRMode) {
reticleVRUIScript.FadeReticleOut(0.5);
Expand All @@ -378,22 +377,22 @@ function DeathRespawn () {
}

// If you want to clear destroyed projectiles (set per-level)...
if (clearDestroyedObjects) {
Resources.UnloadUnusedAssets();
}
if (clearDestroyedObjects) {
Resources.UnloadUnusedAssets();
}

isAlive = 1;
RenderSettings.fogEndDistance = startingFogEndDistance;
RenderSettings.fogStartDistance = startingFogStartDistance;
isAlive = 1;
RenderSettings.fogEndDistance = startingFogEndDistance;
RenderSettings.fogStartDistance = startingFogStartDistance;

// Camera.main.transform.position = respawnPosition - (transform.forward * 4) + Vector3.up; // reset camera too
GetComponent.<Collider>().attachedRigidbody.transform.Translate(respawnPosition);
// Relocate the player. We need to do this or the camera will keep trying to focus on the (invisible) player where he's standing on top of the FalloutDeath box collider.
myTransform.position = respawnPosition; // + Vector3.up;
// Camera.main.transform.position = respawnPosition - (transform.forward * 4) + Vector3.up; // reset camera too
GetComponent.<Collider>().attachedRigidbody.transform.Translate(respawnPosition);
// Relocate the player. We need to do this or the camera will keep trying to focus on the (invisible) player where he's standing on top of the FalloutDeath box collider.
myTransform.position = respawnPosition; // + Vector3.up;

rb.isKinematic = false;
rb.isKinematic = false;

MoveController.controlMultiplier = 1.0;
MoveController.controlMultiplier = 1.0;

if (FallingLaunch.isVRMode && deathPauseUIVR && deathFadeUIVR) {
ShowDeathInterstitialVR();
Expand Down Expand Up @@ -801,8 +800,6 @@ function OnCollisionEnter (collision : Collision) {
//Debug.Log("You died in a fatal collision with " + collision.gameObject);

yield DeathRespawn ();
//isPausable = true;
//UIscriptComponent.UnhideGUI();
}
}

Expand Down
7 changes: 7 additions & 0 deletions lifeCountdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ function TickingAway (delay : float) {
FallingLaunch.secondsAlive
);

// In VR mode, DeathRespawn is now decoupled from the actual respawning time:
// e.g. the player has a several-second time interval to decide whether
// to exit or respawn. If they take more time than showIconVR's timer,
// the tutorial UI hint will already be transparent by the time they respawn.
// That's probably not a huge deal since it's non-critical UI, just a help hint.
// TODO: Pass optional args to DeathRespawn in VR mode, so we can show specific UI
// after user-initiated respawn or via a callback.
yield GetComponent(FallingPlayer).DeathRespawn();

if (!FallingLaunch.isVRMode) {
Expand Down

0 comments on commit 8129f20

Please sign in to comment.