From e7d5a6db87b1483d46586e1f9b9d2bf3c94c3667 Mon Sep 17 00:00:00 2001 From: tyson-kubota Date: Sun, 18 Dec 2016 23:22:28 -0500 Subject: [PATCH] Unity 5 upgrade: remove GameAnalytics SDK; fix up other references --- AudioDuckingRegion.js | 4 ++-- EndSequence1stPerson.js | 6 +++--- FallingEndMenuUI.js | 4 ++-- FallingLaunch.js | 10 ++++----- FallingPlayer.js | 10 ++++----- FallingStartMenu.js | 2 +- FramesPerSecond.js | 44 ---------------------------------------- GUITextureLaunch.js | 34 +++++++++++++++---------------- IntroUITrigger.js | 10 ++++----- MoveController.js | 3 +-- ProjectileDestroy.js | 2 +- SimpleVelocityLimiter.js | 2 +- changeBackdrop.js | 6 +++--- dontgothroughthings.js | 2 +- fallingStartMenuUI.js | 14 ++++++------- fallingUITest.js | 36 ++++++++++++++++---------------- lifeCountdown.js | 9 ++------ 17 files changed, 74 insertions(+), 124 deletions(-) delete mode 100644 FramesPerSecond.js diff --git a/AudioDuckingRegion.js b/AudioDuckingRegion.js index 0a594cc..ec80464 100644 --- a/AudioDuckingRegion.js +++ b/AudioDuckingRegion.js @@ -11,13 +11,13 @@ function Start () { function OnTriggerEnter (other : Collider) { if (other.gameObject.layer == 16) { - if (duckingObject.audio) {lerpDuck(2, duckingVal);} + if (duckingObject.GetComponent.()) {lerpDuck(2, duckingVal);} } } function OnTriggerExit (other : Collider) { if (other.gameObject.layer == 16) { - if (duckingObject.audio) {lerpDuck(2, 1);} + if (duckingObject.GetComponent.()) {lerpDuck(2, 1);} } } diff --git a/EndSequence1stPerson.js b/EndSequence1stPerson.js index 81a6b8e..fc73a19 100644 --- a/EndSequence1stPerson.js +++ b/EndSequence1stPerson.js @@ -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; diff --git a/FallingEndMenuUI.js b/FallingEndMenuUI.js index b9acc2b..9d97cac 100644 --- a/FallingEndMenuUI.js +++ b/FallingEndMenuUI.js @@ -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); diff --git a/FallingLaunch.js b/FallingLaunch.js index 1d18141..4c60118 100644 --- a/FallingLaunch.js +++ b/FallingLaunch.js @@ -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) { @@ -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; diff --git a/FallingPlayer.js b/FallingPlayer.js index 22f5843..3f644f3 100644 --- a/FallingPlayer.js +++ b/FallingPlayer.js @@ -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); @@ -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); @@ -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); diff --git a/FallingStartMenu.js b/FallingStartMenu.js index e91704c..166e521 100644 --- a/FallingStartMenu.js +++ b/FallingStartMenu.js @@ -57,7 +57,7 @@ function Awake() { // if (iPhoneInput.orientation == iPhoneOrientation.LandscapeRight) { // flipMultiplier = -1; //} - mainCamera = GetComponent.(); + mainCamera = Camera.main; if (mainCamera.aspect < 1.5) { titleCard.transform.Translate(-200,0,0); } diff --git a/FramesPerSecond.js b/FramesPerSecond.js deleted file mode 100644 index ee67a51..0000000 --- a/FramesPerSecond.js +++ /dev/null @@ -1,44 +0,0 @@ -// Attach this to a GUIText to make a frames/second indicator. -// -// It calculates frames/second over each updateInterval, -// so the display does not keep changing wildly. -// -// It is also fairly accurate at very low FPS counts (<10). -// We do this not by simply counting frames per interval, but -// by accumulating FPS for each frame. This way we end up with -// correct overall FPS even if the interval renders something like -// 5.5 frames. - -var updateInterval = 0.5; - -private var accum = 0.0; // FPS accumulated over the interval -private var frames = 0; // Frames drawn over the interval -private var timeleft : float; // Left time for current interval - -function Start() -{ - if( !guiText ) - { - print ("FramesPerSecond needs a GUIText component!"); - enabled = false; - return; - } - timeleft = updateInterval; -} - -function Update() -{ - timeleft -= Time.deltaTime; - accum += Time.timeScale/Time.deltaTime; - ++frames; - - // Interval ended - update GUI text and start new interval - if( timeleft <= 0.0 ) - { - // display two fractional digits (f2 format) - guiText.text = "" + (accum/frames).ToString("f2"); - timeleft = updateInterval; - accum = 0.0; - frames = 0; - } -} \ No newline at end of file diff --git a/GUITextureLaunch.js b/GUITextureLaunch.js index f13e91e..aa60b83 100644 --- a/GUITextureLaunch.js +++ b/GUITextureLaunch.js @@ -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.().pixelInset = Rect (0, 0, Screen.width, Screen.height); + GetComponent.().color.a = 0.0; } function FadeFlash (timer : float, fadeType : FadeDir) { @@ -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.().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.().color.a : peakValue; var end = fadeType == FadeDir.In? peakValue : 0.0; var i = 0.0; var step = 1.0/timer; @@ -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.().color.a = Mathf.Lerp(start, end, i); yield; if (MoveController.Slowdown < 1) {break;} - } + } yield WaitForSeconds (timer); MoveController.speedingUp = 1; // } @@ -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.().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.().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.().color.a = 0; } function FadeOut (timer : float) { - var start = guiTexture.color.a; + var start = GetComponent.().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.().color.a = Mathf.Lerp(start, end, i); yield; - } - + } + yield WaitForSeconds (timer); } diff --git a/IntroUITrigger.js b/IntroUITrigger.js index c59199c..5f5ddd0 100644 --- a/IntroUITrigger.js +++ b/IntroUITrigger.js @@ -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); @@ -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); @@ -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); @@ -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; diff --git a/MoveController.js b/MoveController.js index b3a79b7..18d6e28 100644 --- a/MoveController.js +++ b/MoveController.js @@ -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.().relativeForce = (Vector3.down * Slowdown); } function speedsUp () { diff --git a/ProjectileDestroy.js b/ProjectileDestroy.js index cff8d7a..7b4fea2 100644 --- a/ProjectileDestroy.js +++ b/ProjectileDestroy.js @@ -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.().isKinematic = true; Destroy(gameObject, 1); } diff --git a/SimpleVelocityLimiter.js b/SimpleVelocityLimiter.js index 7b5b941..8a94b74 100644 --- a/SimpleVelocityLimiter.js +++ b/SimpleVelocityLimiter.js @@ -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.(); SetMaxVelocity(maxVelocity); } diff --git a/changeBackdrop.js b/changeBackdrop.js index 1d7ae1c..ea8fd49 100644 --- a/changeBackdrop.js +++ b/changeBackdrop.js @@ -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.(); oceanRenderer.enabled = false; - cloudRenderer = gameObject.Find("simple-cloud-plane/Mesh").renderer; + cloudRenderer = gameObject.Find("simple-cloud-plane/Mesh").GetComponent.(); cloudRenderer.enabled = false; - endSphereRenderer = gameObject.Find("score-orbs-end/score-orb/Mesh").renderer; + endSphereRenderer = gameObject.Find("score-orbs-end/score-orb/Mesh").GetComponent.(); endSphereRenderer.enabled = false; } diff --git a/dontgothroughthings.js b/dontgothroughthings.js index 35b871d..4b1d1ec 100644 --- a/dontgothroughthings.js +++ b/dontgothroughthings.js @@ -10,7 +10,7 @@ private var myRigidbody : Rigidbody; //initialize values function Awake() { - myRigidbody = rigidbody; + myRigidbody = GetComponent.(); previousPosition = myRigidbody.position; var cldr : Collider = GetComponent.(); minimumExtent = Mathf.Min(Mathf.Min(cldr.bounds.extents.x, cldr.bounds.extents.y), cldr.bounds.extents.z); diff --git a/fallingStartMenuUI.js b/fallingStartMenuUI.js index 7fa421e..eed8941 100644 --- a/fallingStartMenuUI.js +++ b/fallingStartMenuUI.js @@ -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; @@ -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); @@ -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 { @@ -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); diff --git a/fallingUITest.js b/fallingUITest.js index f750280..a0446be 100644 --- a/fallingUITest.js +++ b/fallingUITest.js @@ -99,7 +99,7 @@ function Start () { fallingLaunch = GameObject.Find("LaunchGameObject"); fallingLaunchComponent = fallingLaunch.GetComponent("FallingLaunch"); - 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.Linear.easeIn); bgSprite.alphaTo( 0.01f, 0.9f, Easing.Sinusoidal.easeOut); @@ -128,7 +128,7 @@ function Start () { var tiltPlacementRatio : float; - if (UI.isHD == true) { + if (UIT.isHD == true) { spriteEdgeSize = 4; buttonScaleFactor = (((Screen.height / 2.0) - 100.0) / Screen.height); tiltPlacementRatio = (196.0/Screen.width); @@ -152,11 +152,11 @@ function Start () { // var tutorialHeight = 1.25 * spriteEdgeSize; -// tutorialSprite = UI.firstToolkit.addSprite( "tutorialBackground.png", 0, 0, 4 ); +// tutorialSprite = UIT.firstToolkit.addSprite( "tutorialBackground.png", 0, 0, 4 ); // tutorialSprite.hidden = true; // tutorialSprite.scaleTo( 0.1f, new Vector3( (Screen.width), 3, 1 ), Easing.Sinusoidal.easeOut); - fadeSprite = UI.firstToolkit.addSprite( "menuBackgroundBlack.png", 0, 0, -1 ); + fadeSprite = UIT.firstToolkit.addSprite( "menuBackgroundBlack.png", 0, 0, -1 ); fadeSprite.positionCenter(); fadeSprite.scaleTo( 0.01f, new Vector3( (Screen.width * 6), (Screen.height * 6), 1 ), Easing.Linear.easeIn); fadeSprite.alphaTo( 0.01f, 0.0f, Easing.Sinusoidal.easeOut); @@ -199,16 +199,16 @@ function Start () { BackToHomeMenuButton.hidden = true; if (level1 == Application.loadedLevelName) { - nextLevelLabel = UI.firstToolkit.addSprite( "level2.png", 0, 0, 0 ); + nextLevelLabel = UIT.firstToolkit.addSprite( "level2.png", 0, 0, 0 ); } else if (level2 == Application.loadedLevelName) { - nextLevelLabel = UI.firstToolkit.addSprite( "level3.png", 0, 0, 0 ); + nextLevelLabel = UIT.firstToolkit.addSprite( "level3.png", 0, 0, 0 ); } else if (level3 == Application.loadedLevelName) { - nextLevelLabel = UI.firstToolkit.addSprite( "level4.png", 0, 0, 0 ); + nextLevelLabel = UIT.firstToolkit.addSprite( "level4.png", 0, 0, 0 ); } else if (level4 == Application.loadedLevelName) { - nextLevelLabel = UI.firstToolkit.addSprite( "level1.png", 0, 0, 0 ); + nextLevelLabel = UIT.firstToolkit.addSprite( "level1.png", 0, 0, 0 ); } //nextLevelLabel.positionFromCenter(.0f); @@ -406,28 +406,28 @@ function Start () { animateProgressBar (lifeBar); // Loop (); - GA.API.Design.NewEvent("LevelBegin:" + Application.loadedLevelName + ":" + FallingLaunch.thisLevelArea, FallingLaunch.secondsInLevel, transform.parent.position); + // GA.API.Design.NewEvent("LevelBegin:" + Application.loadedLevelName + ":" + FallingLaunch.thisLevelArea, FallingLaunch.secondsInLevel, transform.parent.position); if (FallingLaunch.restPosition == FallingLaunch.neutralPosFlat) { - GA.API.Design.NewEvent("TiltPreference:" + Application.loadedLevelName, 0.0f, transform.parent.position); + // GA.API.Design.NewEvent("TiltPreference:" + Application.loadedLevelName, 0.0f, transform.parent.position); } else if (FallingLaunch.restPosition == FallingLaunch.neutralPosVertical) { - GA.API.Design.NewEvent("TiltPreference:" + Application.loadedLevelName, 90.0f, transform.parent.position); + // GA.API.Design.NewEvent("TiltPreference:" + Application.loadedLevelName, 90.0f, transform.parent.position); } else { - GA.API.Design.NewEvent("TiltPreference:" + Application.loadedLevelName, 45.0f, transform.parent.position); + // GA.API.Design.NewEvent("TiltPreference:" + Application.loadedLevelName, 45.0f, transform.parent.position); } if (FallingLaunch.invertHorizAxisVal == 1) { - GA.API.Design.NewEvent("AxesPreference:Horizontal:" + Application.loadedLevelName, 1.0f, transform.parent.position); + // GA.API.Design.NewEvent("AxesPreference:Horizontal:" + Application.loadedLevelName, 1.0f, transform.parent.position); } else if (FallingLaunch.invertHorizAxisVal == -1) { - GA.API.Design.NewEvent("AxesPreference:Horizontal:" + Application.loadedLevelName, -1.0f, transform.parent.position); + // GA.API.Design.NewEvent("AxesPreference:Horizontal:" + Application.loadedLevelName, -1.0f, transform.parent.position); } if (FallingLaunch.invertVertAxisVal == -1) { - GA.API.Design.NewEvent("AxesPreference:Vertical:" + Application.loadedLevelName, -1.0f, transform.parent.position); + // GA.API.Design.NewEvent("AxesPreference:Vertical:" + Application.loadedLevelName, -1.0f, transform.parent.position); } else if (FallingLaunch.invertVertAxisVal == 1) { - GA.API.Design.NewEvent("AxesPreference:Vertical:" + Application.loadedLevelName, 1.0f, transform.parent.position); + // GA.API.Design.NewEvent("AxesPreference:Vertical:" + Application.loadedLevelName, 1.0f, transform.parent.position); } } @@ -478,7 +478,7 @@ function PauseGame() { FallingPlayer.isPausable = false; FallingLaunch.secondsInLevel = (Time.time - FallingPlayer.levelStartTime); - GA.API.Design.NewEvent("GUI:PauseGame:" + Application.loadedLevelName + ":" + FallingLaunch.thisLevelArea, FallingLaunch.secondsInLevel, transform.parent.position); + // GA.API.Design.NewEvent("GUI:PauseGame:" + Application.loadedLevelName + ":" + FallingLaunch.thisLevelArea, FallingLaunch.secondsInLevel, transform.parent.position); //Debug.Log("you paused at " + transform.parent.position); circleReticle.hidden = true; @@ -564,7 +564,7 @@ function RestartLevel() { // Camera.main.SendMessage("fadeOut"); //fadeOut(); - GA.API.Design.NewEvent("GUI:RestartLevel:" + Application.loadedLevelName + ":" + FallingLaunch.thisLevelArea, FallingLaunch.secondsInLevel, transform.parent.position); + // GA.API.Design.NewEvent("GUI:RestartLevel:" + Application.loadedLevelName + ":" + FallingLaunch.thisLevelArea, FallingLaunch.secondsInLevel, transform.parent.position); Respawn.currentRespawn = initialRespawn; HideGUI(); diff --git a/lifeCountdown.js b/lifeCountdown.js index 2ea9ae7..5fbedd7 100644 --- a/lifeCountdown.js +++ b/lifeCountdown.js @@ -59,14 +59,9 @@ function TickingAway (delay : float) { FallingPlayer.isPausable = false; LifeFlashTextureScript.FadeFlash (1, FadeDir.Out); FallingLaunch.secondsAlive = (Time.time - FallingPlayer.lifeStartTime); - GA.API.Design.NewEvent("Death:Drained:"+Application.loadedLevelName + ":" + FallingLaunch.thisLevelArea, FallingLaunch.secondsAlive, transform.position); + // GA.API.Design.NewEvent("Death:Drained:"+Application.loadedLevelName + ":" + FallingLaunch.thisLevelArea, FallingLaunch.secondsAlive, transform.position); //Debug.Log("You died!"); - //GA.API.Design.NewEvent("Death:Drained:", FallingLaunch.secondsAlive, transform.position); - - //var deathDrainEvent : GAEvent = new GAEvent("Death", "Drained", FallingLaunch.thisLevelArea, FallingLaunch.secondsAlive); - //GoogleAnalytics.instance.Add(deathDrainEvent); - //GoogleAnalytics.instance.Dispatch(); - + yield GetComponent(FallingPlayer).DeathRespawn (); GetComponent(FallingPlayer).ShowDeathHelp(); // GameAnalytics syntax: GA.API.Design.NewEvent(String eventName, float eventValue, Vector3 trackPosition);