Skip to content

Commit

Permalink
Start menu VR mode UI tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tyson-kubota committed Nov 21, 2017
1 parent ea07c82 commit 2f296ff
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 53 deletions.
9 changes: 0 additions & 9 deletions FallingLaunch.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,6 @@ function OnApplicationPause(pauseStatus: boolean) {
}
}

function OnLevelWasLoaded (level : int) {
//loadedLevel = Application.loadedLevelName;
// var loadedLevel : GALevel = new GALevel();
// GoogleAnalytics.instance.Add(loadedLevel);
// GoogleAnalytics.instance.Dispatch();

//Debug.Log("my loaded level is... " + Application.loadedLevelName);
}

function EnableVRMode () {
isVRMode = true;
vrModeAnalyticsString = "isVRMode:";
Expand Down
8 changes: 5 additions & 3 deletions fallingStartMenuUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,16 @@ function Start () {
// HACK: reusing existing button sprite as a transparent background
// for the "VR Mode" text label (which is not clickable):
vrModeButton = UIButton.create("newgame.png", "newgame.png", 0,0);
vrModeButton.positionFromBottomLeft ( .05, (.05 * screenAspectRatio) );
// vrModeButton.positionFromBottomLeft ( .05, (.05 * screenAspectRatio) );
vrModeButton.positionFromBottom(.05);
vrModeButton.normalTouchOffsets = new UIEdgeOffsets( 40 );
vrModeButton.highlightedTouchOffsets = new UIEdgeOffsets( 40 );
vrModeButton.onTouchUpInside += OpenVRModeMenu;
vrModeButton.alphaTo(0.01f, 0.0f, Easing.Sinusoidal.easeOut);

vrModeLabel = boldText.addTextInstance( "VR MODE", 0, 0 );
vrModeLabel.positionFromBottomLeft ( .05, (.05 * screenAspectRatio) );
vrModeLabel = boldText.addTextInstance( "TRY VR MODE", 0, 0 );
// vrModeLabel.positionFromBottomLeft ( .05, (.05 * screenAspectRatio) );
vrModeLabel.positionFromBottom(.05);

vrModeLaunchButton = UIButton.create("startDown.png","startDown.png", 0, 0);
vrModeLaunchButton.positionFromCenter(.1, 0);
Expand Down
45 changes: 4 additions & 41 deletions fallingUITest.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ var lifeBarOutline : UIProgressBar;
var lifeBar : UIProgressBar;
var lifeBarThreat : UIProgressBar;
var rightArrow : UIButton;
var leftArrow : UIButton;
var loadNewLevelButton : UIButton;
var loadLevelOne : UIButton;
var loadLevelTwo : UIButton;
Expand Down Expand Up @@ -186,12 +185,7 @@ function SetupLevelUI() {
rightArrow.positionFromTopRight(buttonScaleFactor,0.2f);
rightArrow.onTouchUpInside += PauseGameCheck;

leftArrow = UIButton.create("restart.png","restart.png", 0, 0);
leftArrow.positionFromBottomLeft(.05f, .05f);
leftArrow.onTouchUpInside += RestartLevel;

rightArrow.hidden = true;
leftArrow.hidden = true;

BackToPauseMenuButton = UIButton.create("back.png","back.png", 40, 40);
BackToPauseMenuButton.positionFromBottomLeft ( .05f, (.05f * screenAspectRatio) );
Expand Down Expand Up @@ -559,16 +553,13 @@ function PauseGame() {
AudioListener.pause = true;

rightArrow.hidden = false;
//leftArrow.hidden = false;
if (level2Unlocked) {loadNewLevelButton.hidden = false;}
BackToHomeMenuButton.hidden = false;
optionsButton.hidden = false;
bgSprite.hidden = false;

//DisplayTiltOnPause();

//clear any unused stuff in pause menu.
//audio and video should be stopped, so any hiccuping won't be as obvious.
// Clear any unused stuff in pause menu.
// Audio and video should be stopped, so any hiccuping won't be as obvious.
Resources.UnloadUnusedAssets();

initialRespawn.SaveCheckpoint();
Expand All @@ -590,7 +581,7 @@ function UnPauseGame(resume : boolean) {

bgSprite.hidden = true;
rightArrow.hidden = true;
leftArrow.hidden = true;

loadNewLevelButton.hidden = true;
BackToHomeMenuButton.hidden = true;
HideOptionsButton();
Expand Down Expand Up @@ -753,7 +744,6 @@ function LevelSelect() {

function HidePauseMenuElements() {
rightArrow.hidden = true;
leftArrow.hidden = true;
pauseButton.hidden = true;
optionsButton.hidden = true;
loadNewLevelButton.hidden = true;
Expand All @@ -765,7 +755,6 @@ function ShowBackButton() {
}

function BackToPauseMenu() {
//leftArrow.hidden = false;
rightArrow.hidden = false;
pauseButton.hidden = false;

Expand Down Expand Up @@ -1088,24 +1077,11 @@ function PauseGameNow() {
AudioListener.pause = true;

rightArrow.hidden = false;
//leftArrow.hidden = false;
if (level2Unlocked) {loadNewLevelButton.hidden = false;}
bgSprite.hidden = false;
optionsButton.hidden = false;
//DisplayTiltOnPause();
}

// function PauseGameBackgroundCheck() {
// if (FallingPlayer.isPausable == true) {
// if (Time.timeScale == 0) {
// UnPauseGame(true);
// }
// else {
// PauseGameNow();
// }
// }
// }

function setHoldingPauseButtonTrue() {
holdingPauseButton = true;
}
Expand Down Expand Up @@ -1150,17 +1126,4 @@ function SaveCheckpointVR () {
);

initialRespawn.SaveCheckpoint();
}

function DisplayTiltOnPause () {

if (PlayerPrefs.GetInt("TiltNeutral", 0) == 1) {
angledTiltLabel.hidden = false;
}
else if (PlayerPrefs.GetInt("TiltNeutral", 0) == 2) {
verticalTiltLabel.hidden = false;
}
else {
flatTiltLabel.hidden = false;
}
}
}

0 comments on commit 2f296ff

Please sign in to comment.