void ActivateNotification() { Notification.SetActive(true); NotiAnimation.Reset(); IconIntro.Reset(); IconIntro.Play(true); BGIntroA.Reset(); BGIntroA.Play(true); BGIntro.Reset(); BGIntro.Play(true); CounterAnimation.Reset(); CounterAnimation.Play(true); NotiPop.Play(); //Play sound effect. AudioPlayer.GetPlayer().PlayMenuSFX(AudioPlayer.MenuSFX.LevelUp); ToyBox.GetPandora().SetSlowMotion(true); }
public void Tally(float speed = 1.0f) { exitAnimation.duration = speed; exitAnimation.Reset(); exitAnimation.Play(true); }
// Update is called once per frame new void LateUpdate() { base.LateUpdate(); if (!isFullyInit) { Init(); } if (_haveTweenTrans && Input.GetKeyUp(KeyCode.T)) { _tweenTransform.Reset(); _tweenTransform.Play(true); } if (_haveTweenScale && Input.GetKeyUp(KeyCode.T)) { _tweenScale.Reset(); _tweenScale.Play(true); } }
public void TriggerTitleAnimation() { //Enable the object and play the animation. TitleAnimation.gameObject.SetActive(true); CurtainLeft.Reset(); CurtainRight.Reset(); curtainsDrawn = false; TitleAnimation.Reset(); TitleAnimation.Play(true); AudioPlayer.GetPlayer().PlayMenuSFX(AudioPlayer.MenuSFX.SlotPushed); }
public void ActivateNotification() { //Turn on window. myWindow.ToggleWindowOn(); WindowTween.Reset(); WindowTween.Play(true); //Play the animations. BGTween.gameObject.SetActive(true); BGTween.Reset(); BGTween.Play(true); //Label tweening animation reset can be done here. LabelTween.Reset(); //BGTween.Play(true); }
public bool PlayCounterReset() { if (hasUIPanel) { //CounterResetNotificationUIPanel.enabled = true; CounterResetNotificationUIPanel.alpha = AlphaVisible; } if (hasanimation) { CounterResetNotificationAnimation.Reset(); CounterResetNotificationAnimation.Play(true); } return(true); }
// Update is called once per frame void LateUpdate() { if (MyTarget == null) { // if I dont have a target, remove me from the scene GameObject.Destroy(this.gameObject); return; } // make sure to follow the target transform.localPosition = MyTarget.transform.position; if (myTempBot == null) { Debug.LogError("HeatbarObject: Target host, is not a Bot object"); return; } curHeat = myTempBot.Temperature; if (curHeat > maxHeat) { curHeat = maxHeat; } if (curHeat <= 0) { curHeat = 0.0009f; } Vector3 heatscale = new Vector3(Slider.foreground.localScale.x, curHeat, Slider.foreground.localScale.z); //Slider.foreground.localScale = heatscale; Slider.sliderValue = myTempBot.HeatPercent; //Play the cannon animation if we attached a cannon. if (myTempBot.VisibleTemp && !botcannon) { TheometerWindowPanel.alpha = 1.0f; //Set image. Animal.spriteName = myTempBot.GetCannon().CannonTextureName; //Play animation and set bool Animal.enabled = true; //Animal.alpha = 1.0f; AnimalAnimation.Reset(); AnimalAnimation.Play(true); AnimalAlphaA.Reset(); AnimalAlphaA.Play(true); botcannon = true; ThermometerAnimation.Reset(); } if (!myTempBot.VisibleTemp) { botcannon = false; Animal.enabled = false; // no cannon attached, pulling away the thermometer // WarningAnimation.Reset(); // WarningAnimation.Play(false); WarningIcon.spriteName = NeedCannonSprite; QuestionMark.alpha = 1.0f; highTemp.alpha = 0.0f; lowTemp.alpha = 0.0f; curTemp.alpha = 0.0f; Pointer.alpha = 0.0f; ThermometerAnimation.Play(false); TheometerWindowPanel.alpha = 0.0f; // temp = false; } else { WarningIcon.alpha = 0.0f; WarningIcon.spriteName = WarningSprite; QuestionMark.alpha = 0.0f; } //Set the labels if we are shielded. if (myTempBot.IsShieldActive() || myTempBot.Warning) { //Turn on highTemp.alpha = 1.0f; lowTemp.alpha = 1.0f; curTemp.alpha = 1.0f; Pointer.alpha = 1.0f; //Update variables. curTemp.text = myTempBot.CurrentTemp.ToString(); Vector3 pos = Vector3.zero; pos.y = myTempBot.HeatPercent; //curTemp.transform.localPosition = pos; Current.localPosition = pos; ThermometerAnimation.Play(true); SetHeatLampIntensity(8); SetHeatLampRange(15); } else { highTemp.alpha = 0.0f; lowTemp.alpha = 0.0f; curTemp.alpha = 0.0f; Pointer.alpha = 0.0f; ThermometerAnimation.Play(false); SetHeatLampIntensity(1); SetHeatLampRange(10); } //Handle warning info if (!myTempBot.Warning) { //WarningAnimation.Reset(); WarningAnimation.Play(false); WarningLabel.alpha = 0.0f; temp = false; //WarningLabel.gameObject.SetActive(false); } if (!temp && myTempBot.Warning) { //WarningLabel.gameObject.SetActive(true); //WarningAnimation.Reset(); WarningAnimation.Play(true); WarningLabel.alpha = 1.0f; temp = true; } }
// Update is called once per frame void Update() { points = GameObjectTracker.GetGOT().GetCurrentPoints(); //Trigger point adding animation. if (points > prevPoints) { //myLabelText = "" + points + ""; myLabelText = string.Format("{0:#,#,#}", points); myLabel.text = myLabelText; //Set the label of the point to add. //Lets set the label to the difference between prev point and current... uhh yeah. int dif = points - prevPoints; PointsAdd.text = "+ " + dif.ToString(); PointsAdd.alpha = 1.0f; PointsAddBG.alpha = 1.0f; //Trigger animation. PointsAddAnimation.Reset(); PointsAddAnimation.Play(true); prevPoints = points; } //Trigger point subtraction here. if (points < prevPoints) { //myLabelText = "" + points + ""; myLabelText = string.Format("{0:#,#,#}", points); myLabel.text = myLabelText; //Create the label as the difference between the points int dif = prevPoints - points; PointsSubtract.text = "- " + dif.ToString(); //PointsSubtract.alpha = 1.0f; //Trigger animation. PointsSubtractAnimation.Reset(); PointsSubtractAnimation.Play(true); PointsSubtractAlphaAnimation.Reset(); PointsSubtractAlphaAnimation.Play(true); prevPoints = points; } if (points == 0) { myLabel.text = "0"; prevPoints = 0; } int newGems = GameObjectTracker.instance.GetGemsCollected(); //Apply gems label here to draw it anyway. if (newGems > prevGemCount) { //Set the bank amount. float gemcount = (float)newGems; gemcount = gemcount / 100.0f; string gemFormat = string.Format("{0:C}", gemcount); Bank.text = gemFormat; //Get the multiplier to set as the adding amount int multiplier = GameObjectTracker.instance.GetMultiplier(); float addrate = (float)multiplier; addrate = addrate / 100.0f; string addFormat = string.Format("{0:C}", addrate); BankAdd.text = addFormat; //Make visible the count label BankAdd.alpha = 1.0f; //Trigger Animation BankAddAnimation.Reset(); BankAddAnimation.Play(true); prevGemCount = newGems; } if (newGems == 0) { //Draw gems at 0 here. only called when gems are 0. //Set the bank amount. float gemcount = (float)newGems; gemcount = gemcount / 100.0f; string gemFormat = string.Format("{0:C}", gemcount); Bank.text = gemFormat; prevGemCount = 0; } }
// public void ButtonOpenCannonListPressed(){ // // // when the slot is clicked, and we know the slot is available to change. // // tell the activity to open up the cannon grid to select the cannon. // // The slot is not told that the button to select cannon has been clicked // // Two different scripts // if (_myActivity != null){ // _myActivity.StartCannonSelect(this); // } // } public void ButtonCannonSelectedPressed(BaseItemCard ForcedCard = null) { BaseItemCard cannonItemCard = ActivityManager.Instance.HighlitedCard; //Lets check if there is no selected item if (cannonItemCard == null) { //Turn off the info window. //SlotInfo.ToggleWindowOff(); //Play sound. AudioPlayer.GetPlayer().PlayMenuSFX(AudioPlayer.MenuSFX.Select); //If we press the button and we have no cannon then we clear the slot. if (_myslot.Type != EntityFactory.CannonTypes.NULL) { //Clear slot if pressed with nothign selected. _myslot.Type = EntityFactory.CannonTypes.NULL; //Play the clear animation DeSelectAnimation.Reset(); DeSelectAnimation.Play(true); //Set to zebra as default. if (_myslot.StartActive) { _myslot.Type = EntityFactory.CannonTypes.Zebra; _lblSlotName.text = "Default"; } ToyBox.GetPandora().AssignSlot(_myslot.Type, _slotIndex); //Since we cleared the slow, play the cleared slot label. _lblSlotName.text = EmptySlotLabel; //Update teh costs here. GameObjectTracker.instance._PlayerData.GemCart -= _slotitemCost; _slotitemCost = 0; // then update the slot visuals UpdateDisplay(); return; } MinusSlot(); // Debug.LogError("Slot Minused"); return; } // the cannon isn't used, assign it ToyBox.GetPandora().AssignSlot(cannonItemCard.ContainedCannonType, _slotIndex); // then update the slot visuals _sprIcon.spriteName = cannonItemCard.DisplayInfo.IconName; _lblSlotName.text = cannonItemCard.Label; //Check here if slot is 0 then apply cost. or it would apply cost every time we tap. if (_slotitemCost != cannonItemCard.DisplayInfo.GemRequirements) { //Negate the current item cost count before we update. GameObjectTracker.instance._PlayerData.GemCart -= _slotitemCost; //Set the cost. _slotitemCost = cannonItemCard.DisplayInfo.GemRequirements; GameObjectTracker.instance._PlayerData.GemCart += _slotitemCost; } //Play the animation if (SelectTween) { SelectTween.Reset(); SelectTween.Play(true); //Play audio sound AudioPlayer.GetPlayer().PlayMenuSFX(AudioPlayer.MenuSFX.SlotPushed); AudioPlayer.GetPlayer().PlayMenuSFX(AudioPlayer.MenuSFX.SlotSelect); } }
void EndTouch() { EndTouchAnimation.Reset(); EndTouchAnimation.Play(true); }
void OnTimerDone() { // Debug.Log("ON TIMER!"); //If this is set to true when timer is done. if (gamereviewtrigger) { //Lets play the game review music here... sure... AudioPlayer.GetPlayer().PlayAudioClip(GameReviewMusic); } if (curState == state.Present && !PPSButton.gameObject.activeSelf) { PPSButton.gameObject.SetActive(true); ScoreButtonIntro.Reset(); ScoreButtonIntro.Play(true); Animal.gameObject.SetActive(true); if (IncommingPPS) { AudioPlayer.GetPlayer().PlaySound(IncommingPPS); } presented = true; //Set the game review and timer gamereviewtrigger = true; float t = AudioPlayer.GetPlayer().RemainingTime; ResetTimer(t); //Debug.LogError("Track change timer set :" + t.ToString()); } //Close the curtains here. if (curState == state.GameOver) { curState = state.CloseCurtain; //Hide the hud. ActivityManager.Instance.ToggleHud(false); //Pull curtain ActivityManager.Instance.PullCurtain(); //Pause the game ToyBox.GetPandora().TimePaused = true; ResetTimer(localDuration * 2.0f); } //This is when we finish displaying the game over sign. if (curState == state.CloseCurtain) { GameOverWindow.SetWindowAlpha(0.0f); GameOverWindow.ToggleWindowOff(); PhasesCountWindow.ToggleWindowOn(); //BG.ToggleWindowOn(); curState = state.Count; //Set the tween animation for badges. BadgesGridTween.Reset(); ResetTimer(localDuration); } if (curState == state.Scores) { switch (ScoresState) { //Present coins. case 0: { MoneyLabel.alpha = 1.0f; MoneyTween.Reset(); MoneyTween.Play(true); AudioPlayer.GetPlayer().PlayMenuSFX(AudioPlayer.MenuSFX.CashRegister); break; } //Present score case 1: { ScoreLabel.alpha = 1.0f; PointsTween.Reset(); PointsTween.Play(true); AudioPlayer.GetPlayer().PlayMenuSFX(AudioPlayer.MenuSFX.SlotSelect); break; } //Present Bonus case 2: { BonusLabel.alpha = 1.0f; BonusTween.Reset(); BonusTween.Play(true); AudioPlayer.GetPlayer().PlayMenuSFX(AudioPlayer.MenuSFX.SlotSelect); break; } default: { break; } } ScoresState++; if (ScoresState > 3) { curState = state.Present; ResetTimer(localDuration); return; } //Resetting the timer after being displayed. ResetTimer(); return; } if (curState == state.Count) { int index = 0; foreach (FUIPhaseResultObject badge in _resultList) { //If we hit a badge with null data then we are finished and change state. //Testing, should be a test if there is valid phase data. if (badge.PhaseData == null) { curState = state.Scores; //Play animation and sound effects. BadgesGridTween.Play(true); AudioPlayer.GetPlayer().PlayMenuSFX(AudioPlayer.MenuSFX.SlotPushed); //Turn on windows here. PhasesCountWindow.ToggleWindowOn(); BG.ToggleWindowOn(); ResetTimer(); return; } if (!badge.gameObject.activeSelf) { //Repositioning on the start too aparently... panel.ResetPosition(); //Else we will activate the current object, reset the timer, and return from the function. badge.gameObject.SetActive(true); //Repositioning EndGameTable.Reposition(); panel.ResetPosition(); //Resetting the timer after being displayed. ResetTimer(); if (IncommingPhase) { AudioPlayer.GetPlayer().PlaySound(IncommingPhase); } return; } index++; } } }
// Update is called once per frame void Update() { //Grab data from GOT int newmultiplier = GameObjectTracker.GetGOT().GetMultiplier(); int newGems = GameObjectTracker.instance.GetGemsCollected(); float alpha = GameObjectTracker.GetGOT().GetComboAlpha(); //Set the bank amount. float gemcount = (float)newGems; gemcount = gemcount / 100.0f; string gemFormat = string.Format("{0:C}", gemcount); Bank.text = gemFormat; //Set the phase icon. //CurrentPhaseIcon.spriteName = GameObjectTracker.GetGOT().Game if (alpha < CloseBuffer && visible) { // Debug.LogError("alpha: " + alpha); MyAnimation.Play(false); visible = false; } if (newmultiplier == 0) { //Set previous multiplier. prevMultiplier = 0; //If we are visible play our animation //Dont process any more. return; } //Turn out counter if we go past 0 and is not visible. if (alpha > CloseBuffer && !visible) { //MyAnimation.Reset(); MyAnimation.Play(true); visible = true; } //If we are changed then trigger counter pop. if (newmultiplier > prevMultiplier) { Counter.text = newmultiplier.ToString(); //Set the shadow PrevCounter.text = Counter.text; CounterPop.Reset(); CounterPop.Play(true); } //Update gem colleciton if (newGems != prevGems) { //Format collect amount text to money. float collect = (float)newmultiplier; collect = collect / 100.0f; string collectCount = string.Format("+{0:C}", collect); //Set the text CollectCount.text = collectCount; //CollectCount.alpha = 1.0f; CollectAnimation.Reset(); CollectAnimation.Play(true); //AlphaAni.Reset(); AlphaAni.Play(true); BankAnimation.Reset(); BankAnimation.Play(true); prevGems = newGems; } //Fill up the outline! Outline.fillAmount = alpha; Outline.color = Color.Lerp(Color.red, Color.white, alpha); Quaternion qrot = Quaternion.identity; float ClockAngle = Mathf.Lerp(359, 0, alpha); qrot = Quaternion.AngleAxis(ClockAngle, Vector3.forward); //ClockBigHand. ClockBigHand.transform.localRotation = qrot; //Update the muliplier. int currentMultiplierModifier = GameObjectTracker.instance.Game.GetCurrentMultiplierModifier(); Multiplier.text = "x" + currentMultiplierModifier; // we dont want to show a x0 for gameover if (currentMultiplierModifier == 0) { //MyAnimation.Reset(); //MyAnimation.Play(false); } //Set prev multiplier prevMultiplier = newmultiplier; }