// Update is called once per frame void Update() { //Draw the current score scoreText.text = "SCORE: " + Globals.score.ToString(); //Kick in the next scene transistion on key press if (Input.GetKey(Globals.inputK1["action"]) || Input.GetKey(Globals.inputK2["action"]) || Input.GetButtonDown(Globals.inputJ1["action"]) || Input.GetButtonDown(Globals.inputJ2["action"])) { //Create the transistion fader and GameObject myTransistion = Instantiate(transistionSprite, new Vector2(0, 0), transform.rotation); FadeInFadeOut myFadeInFadeout = myTransistion.GetComponent <FadeInFadeOut>(); myFadeInFadeout.fadeDir = 1; myFadeInFadeout.fadeTimer = 0; startNextLevelTransition = true; } if (startNextLevelTransition) { nextLevelTimer -= Time.deltaTime; if (nextLevelTimer <= 0) { //Increase the numeric level counter by 1. Globals.currentLevel += 1; //Handle reaching the end of the levels if (Globals.currentLevel > 4) { Globals.currentLevel = 1; } //Load scene based on numeric level. SceneManager.LoadScene(Globals.levelToScene[Globals.currentLevel]); } } }
IEnumerator Wait() { yield return(new WaitForSeconds(delayToStart)); if (theGameObject.GetComponent <FadeInFadeOut>() != null) { theGameObject.GetComponent <FadeInFadeOut>().FadeIn(); yield return(new WaitForSeconds(delayToFadeOut)); theGameObject.GetComponent <FadeInFadeOut>().FadeOut(); } else { FadeInFadeOut fd = theGameObject.AddComponent <FadeInFadeOut>(); fd.gameObjectsToFade = new Image[1]; fd.gameObjectsToFade[0] = theGameObject.GetComponent <Image>(); fd.fadeTime = delayToFadeOut; fd.maxAlpha = 1f; fd.FadeIn(); yield return(new WaitForSeconds(delayToFadeOut)); fd.FadeOut(); } }
protected override void LoadContent() { SpriteBatch = new SpriteBatch(GraphicsDevice); DataLoader.Initialize(); _map = DataLoader.AddTilemap(@"C\Maps\testing_map", @"C\Maps\default_setting"); _testp1 = new RedPlayer("#player1", new Position(200, 200), @"C\Chars\Red\w_0_1"); _testp1.FollowCamera = true; _testp1.AssociatedPlayer = PlayerIndex.One; _testp1.Initialize(); _testp2 = new TestPlayer("#player2", 200, 220, @"C\Tiles\blue"); _testp2.FollowCamera = true; _testp2.AssociatedPlayer = PlayerIndex.Two; _testp2.Initialize(); _testp3 = new TestPlayer("#player3", 200, 220, @"C\Tiles\yellow"); _testp3.FollowCamera = true; _testp3.AssociatedPlayer = PlayerIndex.Two; _testp3.Initialize(); _testp4 = new TestPlayer("#player4", 200, 220, @"C\Tiles\red"); _testp4.FollowCamera = true; _testp4.AssociatedPlayer = PlayerIndex.Two; _testp4.Initialize(); _intro = new FadeInFadeOut("intro_text", 400, 300, @"C\Title"); _playButton = new Button("play_button", 400, 300, @"C\UI\PlayButton"); _charSelBg1 = new Sprite("bg_1", 400, 300, @"C\UI\CharSelBg1"); _charSelBg2 = new Sprite("bg_2", 400, 300, @"C\UI\CharSelBg2"); _charSelFg1 = new Sprite("fg_1", 400, 300, @"C\UI\CharSelFg1"); _charSelP1Marker = new Sprite("cs_p1m", 0, 0, @"C\UI\CharSelP1Marker"); _charSelP2Marker = new Sprite("cs_p2m", 0, 0, @"C\UI\CharSelP2Marker"); _charSelP3Marker = new Sprite("cs_p3m", 0, 0, @"C\UI\CharSelP3Marker"); _charSelP4Marker = new Sprite("cs_p4m", 0, 0, @"C\UI\CharSelP4Marker"); Program.Controller1 = new ControllerState(PlayerIndex.One); Program.Controller2 = new ControllerState(PlayerIndex.Two); Program.Controller3 = new ControllerState(PlayerIndex.Three); Program.Controller4 = new ControllerState(PlayerIndex.Four); _n03.Set(null, _n02, null, _n07); _n07.Set(null, _n05, _n03, null); _n02.Set(_n03, _n06, null, _n05); _n05.Set(_n07, _n04, _n02, null); _n06.Set(_n02, null, null, _n04); _n04.Set(_n05, null, _n06, null); _selectionNodes.Add(_n03); _selectionNodes.Add(_n07); _selectionNodes.Add(_n02); _selectionNodes.Add(_n05); _selectionNodes.Add(_n04); _selectionNodes.Add(_n06); Objects.Add(_intro); //WaveObject wo = new WaveObject("#wave1",new Position(100,100), 20, 200, 5, 0.005); //WaveObject wo2 = new WaveObject("#wave1", new Position(100, 100), 20, 200, 5, 0.005); //wo.CreateWave(new string[] { @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\head" }); //wo2.CreateWave(new string[] { @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\stick", @"C\Chars\Yellow\GoldenSerpents\head" },Math.PI); //Objects.Add(wo); //Objects.Add(wo2); }
public void TransitionToLevel() { int currentLevelIndex = SceneManager.GetActiveScene().buildIndex; currentLevelIndex++; StartCoroutine(FadeInFadeOut.TransitionLevel(false, currentLevelIndex)); }
// Start is called before the first frame update void Start() { if (!depression) { StartCoroutine(FadeInFadeOut.TransitionLevel(true)); } }
private void OnTriggerEnter2D(Collider2D collision) { if (keyMoment && collision.gameObject.name == "Player") { if (fireflyController.denialGained) { StartCoroutine(FadeInFadeOut.TransitionLevel(false, 6)); } else if (fireflyController.angerGained) { StartCoroutine(FadeInFadeOut.TransitionLevel(false, 7)); } else if (fireflyController.bargainingGained) { StartCoroutine(FadeInFadeOut.TransitionLevel(false, 8)); } else if (!fireflyController.denialGained && !fireflyController.angerGained && !fireflyController.bargainingGained) { StartCoroutine(FadeInFadeOut.TransitionLevel(false, 5)); } } if (specificLevel != -1 && collision.gameObject.name == "Player") { StartCoroutine(FadeInFadeOut.TransitionLevel(false, specificLevel)); } else if (!keyMoment && collision.gameObject.name == "Player") { TransitionToLevel(); } }
private IEnumerator FadeOutCoroutine() { // start fading yield return(StartCoroutine(FadeInFadeOut.FadeCanvas(canvasGroup, 1f, 0f, fadeOutRate))); gameObject.SetActive(false); }
protected override void Act() { transform.rotation = new Quaternion(); transform.position = new Vector3(); instantiatedObject = Instantiate(new GameObject(), new Vector3(), new Quaternion()) as GameObject; instantiatedObject.name = "ActorCameraAnimation_" + name; fadeInFadeOut = instantiatedObject.AddComponent <FadeInFadeOut>(); //cameraToAnimate.cullingMask = cameraCullingMask; //cameraToAnimate.farClipPlane = 500; //cameraToAnimate.depth = cameraDepth; animate = instantiatedObject.AddComponent <Animation>(); var cameraToAnimate = instantiatedObject.AddComponent <LogicCameraFromGameObject>(); animate.AddClip(cameraAnimation, cameraAnimation.name); animate.Play(cameraAnimation.name); animate[cameraAnimation.name].enabled = true; cameraToAnimateHandle = actingInScene.GetPlayerNotifications().AddCameraToStack(cameraToAnimate, "ActorCameraAnimation"); ChildListenerToCameraAnimation(); isActing = true; if (fadeIn) { fadeInFadeOut.FadeIn(fadeDuration); } }
void Awake() { fadeInOut = gameObject.AddComponent <FadeInFadeOut>(); #if UNITY_EDITOR numActorScenes++; thisNum = numActorScenes; #endif }
internal override IEnumerable <KeyValuePair <string, string> > GetQueryParameters() { yield return(new KeyValuePair <string, string>("outputType", OutputType.ToString().ToLowerInvariant())); yield return(new KeyValuePair <string, string>("outputAudio", OutputAudio.ToString().ToLowerInvariant())); yield return(new KeyValuePair <string, string>("fadeInFadeOut", FadeInFadeOut.ToString().ToLowerInvariant())); yield return(new KeyValuePair <string, string>("maxMotionThumbnailDurationInSecs", MaxMotionThumbnailDurationInSecs.ToString(CultureInfo.InvariantCulture))); }
void Start() { originalLocation = this.transform.localPosition; source = gameObject.AddComponent <AudioSource>(); drawerFade = GameObject.FindGameObjectWithTag("DrawerHighlight").GetComponent <FadeInFadeOut>(); drawerSprite = GameObject.FindGameObjectWithTag("Drawer").GetComponent <DisplaySprite>(); }
void Start() { text1 = GameObject.Find("Text1").GetComponent <TextFadeInFadeOut> (); text2 = GameObject.Find("Text2").GetComponent <TextFadeInFadeOut> (); text3 = GameObject.Find("Text3").GetComponent <TextFadeInFadeOut> (); text4 = GameObject.Find("Text4").GetComponent <TextFadeInFadeOut> (); Flash = GameObject.Find("Flash").GetComponent <FadeInFadeOut> (); time0 = Time.time; goToMenu = -1; skipIntro = false; }
void Start() { fadeinOut = gameObject.AddComponent <FadeInFadeOut>(); fadeinOut.FadeIn(0.5f); ownAnimation = GetComponent <Animation>(); ownAnimation.Play(); if (GetComponent <AudioSource>() != null) { GetComponent <AudioSource>().Play(); } isInitiated = true; }
public void ApplyFadeOut(int fadeOutMs) { Working(true); DynamicVars.projectSettings.fxEditor.fadeSettings.FadeOut = fadeOutMs; bool valid = false; fadeout = new FadeInFadeOut((int)DynamicVars.wavOps.GetWaveFile.Format.SamplesPerSec, DynamicVars.wavOps.GetWaveFile, fadeOutMs, out valid); if (!valid) { MessageBox.Show("Opps! Parece que não é possível aplicar um fade de " + fadeOutMs + "ms neste ficheiro", "Fade demasiado longo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { fadeout.FadeOut(); DynamicVars.fxEditor.on_fxChange(); } Working(false); }
// Use this for initialization void Start() { feedText = GameObject.Find("ObjectRespond").GetComponent <FeedTextFromObject>(); textBox = GameObject.Find("TextBox").GetComponent <FadeInFadeOut>(); if (GameController.instance.isAndroidVersion) { isAutomatedStart = true; } AmariMovement.speed = 3.5f; m1pt = 1; m2pt = 2; m3pt = 3; f4pt = 0; f5pt = 4; f6pt = 5; blackScreenImage.color = Color.black; }
void Start() { Char1 = GameObject.Find("Char1").GetComponent <Image> (); Char2 = GameObject.Find("Char2").GetComponent <Image> (); Dialog1 = GameObject.Find("1NameBox").GetComponent <Image> (); Dialog2 = GameObject.Find("2NameBox").GetComponent <Image> (); Back1 = GameObject.Find("1NameTrans").GetComponent <Image> (); Back2 = GameObject.Find("2NameTrans").GetComponent <Image> (); FlashColor = GameObject.Find("Flash").GetComponent <Image> (); Name1 = GameObject.Find("1NameText").GetComponent <Text> (); Name2 = GameObject.Find("2NameText").GetComponent <Text> (); Dialog = GameObject.Find("DialogText").GetComponent <Text> (); Background1 = GameObject.Find("Background1").GetComponent <FadeInFadeOut> (); Char1Fade = GameObject.Find("Char1").GetComponent <FadeInFadeOut> (); Char2Fade = GameObject.Find("Char2").GetComponent <FadeInFadeOut> (); Flash = GameObject.Find("Flash").GetComponent <FadeInFadeOut> (); TitleCard = GameObject.Find("TitleCard").GetComponent <FadeInFadeOut> (); currentEvent = 0; previousEvent = 0; time = -1; }
void Start() { textBoxReference [0] = GameObject.Find("TextBox_Android"); textBoxReference [1] = GameObject.Find("TextBox"); playerSound = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerSound>(); if (GameController.instance.isAndroidVersion) { interactButton = GameObject.Find("InteractionButton").GetComponent <BubbleBehaviour> (); textBox = textBoxReference[0].GetComponent <FadeInFadeOut>(); textBoxReference[1].SetActive(false); } else { textBox = textBoxReference[1].GetComponent <FadeInFadeOut>(); textBoxReference[0].SetActive(false); } feedText = textBox.transform.GetChild(0).GetComponent <FeedTextFromObject> (); }
IEnumerator Wait(GameObject theGameObject) { if (theGameObject.GetComponent <FadeInFadeOut>() != null) { yield return(new WaitForSeconds(startDelay)); theGameObject.GetComponent <FadeInFadeOut>().FadeOut(1); } else { FadeInFadeOut fd = theGameObject.AddComponent <FadeInFadeOut>(); fd.gameObjectsToFade = new Image[1]; fd.gameObjectsToFade[0] = theGameObject.GetComponent <Image>(); fd.fadeTime = startDelay; fd.maxAlpha = 1f; yield return(new WaitForSeconds(startDelay)); fd.FadeOut(1); } }
void Start() { textBoxReference [0] = GameObject.Find ("TextBox_Android"); textBoxReference [1] = GameObject.Find ("TextBox"); playerSound = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerSound>(); if (GameController.instance.isAndroidVersion) { interactButton = GameObject.Find ("InteractionButton").GetComponent<BubbleBehaviour> (); textBox = textBoxReference[0].GetComponent<FadeInFadeOut>(); textBoxReference[1].SetActive(false); } else { textBox = textBoxReference[1].GetComponent<FadeInFadeOut>(); textBoxReference[0].SetActive(false); } feedText = textBox.transform.GetChild(0).GetComponent<FeedTextFromObject> (); }
/** * Invokes a specified cue action. */ private void InvokeCueAction(ScenarioCueAction action) { Debug.Log("Invoking action " + action.ToString()); switch (action) { // Ends the tutorial and goes to the launcher library. case ScenarioCueAction.GotoLibrary: if (!laserGiven) { GiveLaser(); } Instantiate(launcherRigPrefab); subtitlesObject.transform.localPosition = new Vector3(8.3f, 9.4f, -14); subtitlesObject.transform.localEulerAngles = new Vector3(18, 0, 0); break; // Shows arcade logo case ScenarioCueAction.ShowLogo: FadeInFadeOut logoFader = GameObject.Find("ArcadeLogo").GetComponent <FadeInFadeOut>(); logoFader.Show(); break; // Hides the arcade logo case ScenarioCueAction.HideLogo: FadeInFadeOut logoFaderB = GameObject.Find("ArcadeLogo").GetComponent <FadeInFadeOut>(); logoFaderB.Hide(); break; // Shows skip text case ScenarioCueAction.ShowSkipTxt: FadeInFadeOut stFader = GameObject.Find("SkippableText").GetComponent <FadeInFadeOut>(); stFader.Show(); break; // Hides the skip text case ScenarioCueAction.HideSkipTxt: FadeInFadeOut stFaderB = GameObject.Find("SkippableText").GetComponent <FadeInFadeOut>(); stFaderB.Hide(); break; // Gives a laser pointer to the user. case ScenarioCueAction.GiveLaser: GiveLaser(); targetInstance = Instantiate <GameObject>(targetPrefab); targetInstance.transform.parent = rig.transform; break; case ScenarioCueAction.HighlightMenu: highlightButtonOnBothControllers(EVRButtonId.k_EButton_ApplicationMenu, "Menu"); break; case ScenarioCueAction.HighlightSide: Destroy(targetInstance, 3); highlightButtonOnBothControllers(EVRButtonId.k_EButton_Grip, "Boční tlačítko"); break; case ScenarioCueAction.HighlightSystem: highlightButtonOnBothControllers(EVRButtonId.k_EButton_System, "Systém"); break; case ScenarioCueAction.HighlightTouchpad: highlightButtonOnBothControllers(EVRButtonId.k_EButton_SteamVR_Touchpad, "Dotyková plocha"); break; case ScenarioCueAction.HighlightTrigger: highlightButtonOnBothControllers(EVRButtonId.k_EButton_SteamVR_Trigger, "Spoušť"); break; case ScenarioCueAction.Skip: FadeInFadeOut logoFaderC = GameObject.Find("ArcadeLogo").GetComponent <FadeInFadeOut>(); logoFaderC.Hide(); FadeInFadeOut stFaderC = GameObject.Find("SkippableText").GetComponent <FadeInFadeOut>(); stFaderC.Hide(); ExitTutorial(); break; case ScenarioCueAction.WaitForUserRaise: pauseUntil = areControllersRaised; break; case ScenarioCueAction.WaitForUserTargetHit: pauseUntil = isTargetHit; break; case ScenarioCueAction.WaitForSide: pauseUntil = isSidePressed; break; case ScenarioCueAction.WaitForUserColor: pauseUntil = isColorSelected; break; } }
// Update is called once per frame void Update() { //Setup the string to display for script mulitpliers. //Currently it is setup to display, "Score: 10 + 4" for a score of 10 and a multplier of 4. string multiText = ""; if (Globals.comboTimer > 0) { //Note that we have to set the comboMulti to - 1 since it is already incremented for the next score in the MoveableBlock class. multiText = " +" + (Globals.comboMulti - 1).ToString(); } //Update the score text to be displayed in the UI Canvas that is a child of the GameController. scoreText.text = "SCORE: " + Globals.score.ToString() + multiText; float minutesRemaining = 0; float secondsRemaining = 0; //Count down the time timer. if (levelTimer > 0 && objectCount > 0) { levelTimer -= Time.deltaTime; //Calculate minutes and seconds remaining to put on the clock minutesRemaining = Mathf.FloorToInt(levelTimer / 60); secondsRemaining = Mathf.RoundToInt(levelTimer - (60 * minutesRemaining)); } //Setup a 1 second timer oneSecTimer -= Time.deltaTime; if (oneSecTimer <= 0) { oneSecTimer = 1f; //Plan an alarm sound if the seconds remainings is below 20 if (levelTimer <= 20 && levelTimer > 0) { source.PlayOneShot(timerAlarmClip, 1); } } //Get object count objectCount = GameObject.FindGameObjectsWithTag("Destroyable").Length; if (levelTimer <= 0 || objectCount == 0) { //Start the screen fade if (nextLevelTimer == 2) { //Create the transistion fader and GameObject myTransistion = Instantiate(transistionSprite, new Vector2(0, 0), transform.rotation); FadeInFadeOut myFadeInFadeout = myTransistion.GetComponent <FadeInFadeOut>(); myFadeInFadeout.fadeDir = 1; myFadeInFadeout.fadeTimer = 0; } nextLevelTimer -= Time.deltaTime; if (nextLevelTimer <= 0) { if (!levelChangeOnce) { SceneManager.LoadScene("InbetweenScene"); levelChangeOnce = true; } } } string extraZero = ""; if (secondsRemaining < 10) { extraZero = "0"; } //Update the timer text to be displayed in the UI Canvas that is a child of the GameController. timerText.text = minutesRemaining.ToString() + ":" + extraZero + secondsRemaining.ToString(); //Count down the combo timer and reset the combo if the timer runs out. Globals.comboTimer -= Time.deltaTime; if (Globals.comboTimer <= 0) { Globals.comboMulti = 1; } }
void Start() { textBox = transform.GetComponentInParent<FadeInFadeOut> (); text = transform.GetComponent<Text> (); ResetTextFeed (); }
// Use this for initialization void Start() { feedText = GameObject.Find("ObjectRespond").GetComponent<FeedTextFromObject>(); textBox = GameObject.Find("TextBox").GetComponent<FadeInFadeOut>(); AmariMovement.speed = 3.5f; m1pt = 1; m2pt = 2; m3pt = 3; f4pt = 0; f5pt = 4; f6pt = 5; blackScreenImage.color = Color.black; }
void Start() { textBox = GameObject.Find ("TextBox").GetComponent<FadeInFadeOut> (); text = transform.GetComponent<Text> (); defaultColor = new Color (1.0f, 1.0f, 1.0f, 1.0f); ResetTextFeed (); }
void Start() { textBox = transform.GetComponentInParent <FadeInFadeOut> (); text = transform.GetComponent <Text> (); ResetTextFeed(); }
// Use this for initialization void Start() { feedText = GameObject.Find("ObjectRespond").GetComponent<FeedTextFromObject>(); textBox = GameObject.Find("TextBox").GetComponent<FadeInFadeOut>(); if (GameController.instance.isAndroidVersion) isAutomatedStart = true; AmariMovement.speed = 3.5f; m1pt = 1; m2pt = 2; m3pt = 3; f4pt = 0; f5pt = 4; f6pt = 5; blackScreenImage.color = Color.black; }