Skip to content

Commit

Permalink
Unity 5 upgrade: remove GameAnalytics SDK; fix up other references
Browse files Browse the repository at this point in the history
  • Loading branch information
tyson-kubota committed Dec 19, 2016
1 parent b9946fa commit e7d5a6d
Show file tree
Hide file tree
Showing 17 changed files with 74 additions and 124 deletions.
4 changes: 2 additions & 2 deletions AudioDuckingRegion.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ function Start () {

function OnTriggerEnter (other : Collider) {
if (other.gameObject.layer == 16) {
if (duckingObject.audio) {lerpDuck(2, duckingVal);}
if (duckingObject.GetComponent.<AudioSource>()) {lerpDuck(2, duckingVal);}
}
}

function OnTriggerExit (other : Collider) {
if (other.gameObject.layer == 16) {
if (duckingObject.audio) {lerpDuck(2, 1);}
if (duckingObject.GetComponent.<AudioSource>()) {lerpDuck(2, 1);}
}
}

Expand Down
6 changes: 3 additions & 3 deletions EndSequence1stPerson.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ function Start () {
function PlayOutro () {
//GameAnalytics events for beating the game
FallingLaunch.secondsInLevel = (Time.time - FallingPlayer.levelStartTime);
GA.API.Design.NewEvent("GameComplete:" + FallingPlayer.isNewGamePlus, FallingLaunch.secondsInLevel, transform.position);
// GA.API.Design.NewEvent("GameComplete:" + FallingPlayer.isNewGamePlus, FallingLaunch.secondsInLevel, transform.position);

TestFlightUnity.TestFlight.PassCheckpoint( "LevelComplete:" + Application.loadedLevelName );
TestFlightUnity.TestFlight.PassCheckpoint( "GameComplete");
// TestFlightUnity.TestFlight.PassCheckpoint( "LevelComplete:" + Application.loadedLevelName );
// TestFlightUnity.TestFlight.PassCheckpoint( "GameComplete");

FallingPlayer.isPausable = false;
ScoreController.enabled = false;
Expand Down
4 changes: 2 additions & 2 deletions FallingEndMenuUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ var BackToEndMenuButton : UIButton;

function Start () {

textHeight = (UI.isHD == true) ? 18 : 18;
textHeight = (UIT.isHD == true) ? 18 : 18;

endGameSprite = UI.firstToolkit.addSprite( "tutorialBackground.png", 0, 0, 2 );
endGameSprite = UIT.firstToolkit.addSprite( "tutorialBackground.png", 0, 0, 2 );
endGameSprite.hidden = true;
endGameSprite.scaleTo( 0.1f, new Vector3( (Screen.width), 3, 1 ), Easing.Sinusoidal.easeOut);

Expand Down
10 changes: 5 additions & 5 deletions FallingLaunch.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ function Start () {

if (!alreadyLaunched) {

TestFlightUnity.TestFlight.TakeOff( testFlightToken );
Debug.Log("Your screen orientation is " + iPhoneInput.orientation + "!");
// TestFlightUnity.TestFlight.TakeOff( testFlightToken );
Debug.Log("Your screen orientation is " + Input.deviceOrientation + "!");

// if (!hasSetOrientation) {
// if (iPhoneInput.orientation == iPhoneOrientation.LandscapeRight) {
Expand All @@ -77,12 +77,12 @@ function Start () {
//this is necessary to override Unity 4's auto-orientation code
Input.compensateSensors = false;

var iOSGen = iPhone.generation;
var iOSGen = iOS.Device.generation;

// Debug.Log("this is an " + iOSGen + " device!");
// Debug.Log("Your screen dpi is " + Screen.dpi + "!");
if (iOSGen == iPhoneGeneration.iPad1Gen || iOSGen == iPhoneGeneration.iPad2Gen ||
iOSGen == iPhoneGeneration.iPhone4 || iOSGen == iPhoneGeneration.iPodTouch4Gen ||
if (iOSGen == UnityEngine.iOS.DeviceGeneration.iPad1Gen || iOSGen == UnityEngine.iOS.DeviceGeneration.iPad2Gen ||
iOSGen == UnityEngine.iOS.DeviceGeneration.iPhone4 || iOSGen == UnityEngine.iOS.DeviceGeneration.iPodTouch4Gen ||
iOSGen.ToString().Contains("iPhone3G")) {
QualitySettings.DecreaseLevel(false);
targetFPS = 30;
Expand Down
10 changes: 5 additions & 5 deletions FallingPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ function OnCollisionEnter (collision : Collision) {

if (audioDeath) {audioDeath.Play();}

GA.API.Design.NewEvent("Death:Collision:" + Application.loadedLevelName + ":" + FallingLaunch.thisLevelArea, FallingLaunch.secondsAlive, myTransform.position);
// GA.API.Design.NewEvent("Death:Collision:" + Application.loadedLevelName + ":" + FallingLaunch.thisLevelArea, FallingLaunch.secondsAlive, myTransform.position);

//var deathCollideEvent : GAEvent = new GAEvent("Death", "Collision", FallingLaunch.thisLevelArea, FallingLaunch.secondsAlive);
//GoogleAnalytics.instance.Add(deathCollideEvent);
Expand Down Expand Up @@ -373,12 +373,12 @@ function OnTriggerEnter (other : Collider) {

//if (clipToPlay == 1) {audioToPlay = audioScoreAlt;}
if (clipToPlay > 0.6f) {
audioToPlay.pan = (-clipToPlay/2);
audioToPlay.panStereo = (-clipToPlay/2);
audioToPlay.volume = Mathf.Clamp(myVol, (peakVol/2), peakVol);
}
else {
audioToPlay.volume = clipToPlay;
audioToPlay.pan = (clipToPlay/2);
audioToPlay.panStereo = (clipToPlay/2);
}

//audioToPlay.volume = Mathf.Clamp(myVol, (peakVol * .5), peakVol);
Expand All @@ -398,8 +398,8 @@ function OnTriggerEnter (other : Collider) {
isNewGamePlus = (FallingLaunch.NewGamePlus) ? "new_game_plus" : "first_game";
FallingLaunch.secondsInLevel = (Time.time - levelStartTime);

GA.API.Design.NewEvent("LevelComplete:" + isNewGamePlus, FallingLaunch.secondsInLevel, myTransform.position);
TestFlightUnity.TestFlight.PassCheckpoint( "LevelComplete:" + Application.loadedLevelName );
// GA.API.Design.NewEvent("LevelComplete:" + isNewGamePlus, FallingLaunch.secondsInLevel, myTransform.position);
// TestFlightUnity.TestFlight.PassCheckpoint( "LevelComplete:" + Application.loadedLevelName );

// to keep you from dying after you strike the levelend trigger
script.IncrementScore(25);
Expand Down
2 changes: 1 addition & 1 deletion FallingStartMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function Awake() {
// if (iPhoneInput.orientation == iPhoneOrientation.LandscapeRight) {
// flipMultiplier = -1;
//}
mainCamera = GetComponent.<Camera>();
mainCamera = Camera.main;
if (mainCamera.aspect < 1.5) {
titleCard.transform.Translate(-200,0,0);
}
Expand Down
44 changes: 0 additions & 44 deletions FramesPerSecond.js

This file was deleted.

34 changes: 17 additions & 17 deletions GUITextureLaunch.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
var peakValue : float;

function Start () {
transform.position = Vector3.zero;
transform.localScale = Vector3.zero;
guiTexture.pixelInset = Rect (0, 0, Screen.width, Screen.height);
guiTexture.color.a = 0.0;
transform.position = Vector3.zero;
transform.localScale = Vector3.zero;
GetComponent.<GUITexture>().pixelInset = Rect (0, 0, Screen.width, Screen.height);
GetComponent.<GUITexture>().color.a = 0.0;
}

function FadeFlash (timer : float, fadeType : FadeDir) {
Expand All @@ -19,14 +19,14 @@ function FadeFlash (timer : float, fadeType : FadeDir) {

while (i <= 1.0) {
i += step * Time.deltaTime;
guiTexture.color.a = Mathf.Lerp(start, end, i);
GetComponent.<GUITexture>().color.a = Mathf.Lerp(start, end, i);
yield;
}
}

function LinesFlash (timer : float, fadeType : FadeDir) {

var start = fadeType == FadeDir.In? guiTexture.color.a : peakValue;
var start = fadeType == FadeDir.In? GetComponent.<GUITexture>().color.a : peakValue;
var end = fadeType == FadeDir.In? peakValue : 0.0;
var i = 0.0;
var step = 1.0/timer;
Expand All @@ -35,11 +35,11 @@ function LinesFlash (timer : float, fadeType : FadeDir) {
// if ((controllerITween2.speedingUp == 2) && (controllerITween2.Slowdown < 1)) {
while (i <= 1.0) {
i += step * Time.deltaTime;
guiTexture.color.a = Mathf.Lerp(start, end, i);
GetComponent.<GUITexture>().color.a = Mathf.Lerp(start, end, i);
yield;

if (MoveController.Slowdown < 1) {break;}
}
}
yield WaitForSeconds (timer);
MoveController.speedingUp = 1;
// }
Expand All @@ -49,40 +49,40 @@ function LinesFlash (timer : float, fadeType : FadeDir) {
function LinesFlashOut (timer : float, fadeType : FadeDir) {

var start = fadeType == FadeDir.In? 0.0 : peakValue;
var end = fadeType == FadeDir.In? guiTexture.color.a : 0.0;
var end = fadeType == FadeDir.In? GetComponent.<GUITexture>().color.a : 0.0;
var i = 0.0;
var step = 1.0/timer;

if (MoveController.speedingUp == 0) {
while (i <= 1.0) {
while (i <= 1.0) {
i += step * Time.deltaTime;
guiTexture.color.a = Mathf.Lerp(end, start, i);
GetComponent.<GUITexture>().color.a = Mathf.Lerp(end, start, i);
yield;

if (MoveController.Slowdown > 1) {break;}
}
}
yield WaitForSeconds (timer/3);
MoveController.speedingUp = 1;
}
}

function LinesOff () {
guiTexture.color.a = 0;
GetComponent.<GUITexture>().color.a = 0;
}

function FadeOut (timer : float) {

var start = guiTexture.color.a;
var start = GetComponent.<GUITexture>().color.a;
var end = 0.0;
var i = 0.0;
var step = 1.0/timer;

while (i <= 1.0) {
i += step * Time.deltaTime;
guiTexture.color.a = Mathf.Lerp(start, end, i);
GetComponent.<GUITexture>().color.a = Mathf.Lerp(start, end, i);
yield;
}
}
yield WaitForSeconds (timer);

}
10 changes: 5 additions & 5 deletions IntroUITrigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function Start () {

if (thisTrigger == Triggers.trigger1) {
var tutorialSprite1 : UISprite;
tutorialSprite1 = UI.firstToolkit.addSprite( "tutorialBackground.png", 0, 0, 8 );
tutorialSprite1 = UIT.firstToolkit.addSprite( "tutorialBackground.png", 0, 0, 8 );
tutorialSprite = tutorialSprite1;
tutorialSprite.hidden = true;
tutorialSprite.scaleTo( 0.1f, new Vector3( (Screen.width), 3, 1 ), Easing.Sinusoidal.easeOut);
Expand All @@ -37,7 +37,7 @@ function Start () {

if (thisTrigger == Triggers.trigger2) {
var tutorialSprite2 : UISprite;
tutorialSprite1 = UI.firstToolkit.addSprite( "tutorialBackground.png", 0, 0, 6 );
tutorialSprite1 = UIT.firstToolkit.addSprite( "tutorialBackground.png", 0, 0, 6 );
tutorialSprite = tutorialSprite1;
tutorialSprite.hidden = true;
tutorialSprite.scaleTo( 0.1f, new Vector3( (Screen.width), 3, 1 ), Easing.Sinusoidal.easeOut);
Expand All @@ -46,7 +46,7 @@ function Start () {

if (thisTrigger == Triggers.trigger3) {
var tutorialSprite3 : UISprite;
tutorialSprite1 = UI.firstToolkit.addSprite( "tutorialBackground.png", 0, 0, 4 );
tutorialSprite1 = UIT.firstToolkit.addSprite( "tutorialBackground.png", 0, 0, 4 );
tutorialSprite = tutorialSprite1;
tutorialSprite.hidden = true;
tutorialSprite.scaleTo( 0.1f, new Vector3( (Screen.width), 3, 1 ), Easing.Sinusoidal.easeOut);
Expand All @@ -55,9 +55,9 @@ function Start () {

fallingIntroUIComponent = fallingIntroUI.GetComponent("fallingIntroUI");
fallingUIComponent = fallingUI.GetComponent("fallingUITest");
helpIcon = UI.firstToolkit.addSprite( thisIcon + ".png", 0, 0, iconDepth );
helpIcon = UIT.firstToolkit.addSprite( thisIcon + ".png", 0, 0, iconDepth );

textHeight = (UI.isHD == true) ? 18 : 18;
textHeight = (UIT.isHD == true) ? 18 : 18;

helpIcon.pixelsFromBottom(textHeight);
helpIcon.hidden = true;
Expand Down
3 changes: 1 addition & 2 deletions MoveController.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ function fallingSpeed () {
// Debug.Log("Slowdown = " + Slowdown + ", speedingUp = " + speedingUp );
// Debug.Log("You have " + fingerCount + " fingers touching the screen." );

constantForce.relativeForce = (Vector3.down * Slowdown);

GetComponent.<ConstantForce>().relativeForce = (Vector3.down * Slowdown);
}

function speedsUp () {
Expand Down
2 changes: 1 addition & 1 deletion ProjectileDestroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function Start () {
function OnCollisionEnter (collision : Collision) {
if (collision.gameObject.CompareTag ("Player")) {
// throw an analytics event!
GA.API.Design.NewEvent("Projectile:Collision:" + ProjectileName, FallingLaunch.secondsAlive, transform.position);
// GA.API.Design.NewEvent("Projectile:Collision:" + ProjectileName, FallingLaunch.secondsAlive, transform.position);
gameObject.GetComponent.<Rigidbody>().isKinematic = true;
Destroy(gameObject, 1);
}
Expand Down
2 changes: 1 addition & 1 deletion SimpleVelocityLimiter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private var sqrMaxVelocity : float;
// For more info, see:
// http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.Awake.html
function Awake() {
rb = rigidbody;
rb = GetComponent.<Rigidbody>();
SetMaxVelocity(maxVelocity);
}

Expand Down
6 changes: 3 additions & 3 deletions changeBackdrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ function Start () {
oceanCamera = transform.FindChild("Camera-for-ocean").gameObject;
backdropMist = transform.FindChild("Cylinder").gameObject;

oceanRenderer = gameObject.Find("sky-water-ocean/Mesh").renderer;
oceanRenderer = gameObject.Find("sky-water-ocean/Mesh").GetComponent.<Renderer>();
oceanRenderer.enabled = false;

cloudRenderer = gameObject.Find("simple-cloud-plane/Mesh").renderer;
cloudRenderer = gameObject.Find("simple-cloud-plane/Mesh").GetComponent.<Renderer>();
cloudRenderer.enabled = false;

endSphereRenderer = gameObject.Find("score-orbs-end/score-orb/Mesh").renderer;
endSphereRenderer = gameObject.Find("score-orbs-end/score-orb/Mesh").GetComponent.<Renderer>();
endSphereRenderer.enabled = false;
}

Expand Down
2 changes: 1 addition & 1 deletion dontgothroughthings.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ private var myRigidbody : Rigidbody;

//initialize values
function Awake() {
myRigidbody = rigidbody;
myRigidbody = GetComponent.<Rigidbody>();
previousPosition = myRigidbody.position;
var cldr : Collider = GetComponent.<Collider>();
minimumExtent = Mathf.Min(Mathf.Min(cldr.bounds.extents.x, cldr.bounds.extents.y), cldr.bounds.extents.z);
Expand Down
14 changes: 7 additions & 7 deletions fallingStartMenuUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function Awake () {
// }

if (!FallingLaunch.hasSetOrientation) {
if (iPhoneInput.orientation == iPhoneOrientation.LandscapeRight) {
if (Input.deviceOrientation == DeviceOrientation.LandscapeRight) {
FallingLaunch.flipMultiplier = FallingLaunch.flipMultiplier * -1;
//Debug.Log("I'm in LandscapeRight!");
Screen.orientation = ScreenOrientation.LandscapeRight;
Expand Down Expand Up @@ -159,12 +159,12 @@ function Start () {
level4Unlocked = true;
}

bgSpriteStart = UI.firstToolkit.addSprite( "menuBackground.png", 0, 0, 2 );
bgSpriteStart = UIT.firstToolkit.addSprite( "menuBackground.png", 0, 0, 2 );
bgSpriteStart.positionCenter();
bgSpriteStart.scaleTo( 0.0001f, new Vector3( (Screen.width * 6), (Screen.height * 6), 1 ), Easing.Sinusoidal.easeOut);
bgSpriteStart.alphaTo( 0.0001f, 0.1f, Easing.Sinusoidal.easeOut);

bgSprite = UI.firstToolkit.addSprite( "menuBackground.png", 0, 0, 2 );
bgSprite = UIT.firstToolkit.addSprite( "menuBackground.png", 0, 0, 2 );
bgSprite.positionCenter();
bgSprite.scaleTo( 0.01f, new Vector3( (Screen.width * 6), (Screen.height * 6), 1 ), Easing.Sinusoidal.easeOut);
bgSprite.alphaTo( 0.01f, 0.94f, Easing.Sinusoidal.easeOut);
Expand All @@ -177,7 +177,7 @@ function Start () {

pauseButton.hidden = true;

if (UI.isHD == true) {
if (UIT.isHD == true) {
buttonScaleFactor = (((Screen.height / 2.0) - 100.0) / Screen.height);
}
else {
Expand Down Expand Up @@ -444,9 +444,9 @@ function Start () {
howToButton.onTouchUpInside += OpenHowTo;
howToButton.hidden = true;

helpIcon1 = UI.firstToolkit.addSprite( "tiltText.png", 0, 0, 0 );
helpIcon2 = UI.firstToolkit.addSprite( "spheresText.png", 0, 0, 0 );
helpIcon3 = UI.firstToolkit.addSprite( "boostText.png", 0, 0, 0 );
helpIcon1 = UIT.firstToolkit.addSprite( "tiltText.png", 0, 0, 0 );
helpIcon2 = UIT.firstToolkit.addSprite( "spheresText.png", 0, 0, 0 );
helpIcon3 = UIT.firstToolkit.addSprite( "boostText.png", 0, 0, 0 );
helpIcon1.positionFromTop(.3f);
helpIcon2.positionCenter();
helpIcon3.positionFromBottom(.3f);
Expand Down
Loading

0 comments on commit e7d5a6d

Please sign in to comment.