Exemplo n.º 1
0
    void UpdateDisplay()
    {
        if (_myslot.IsOpen)
        {
            BG.ToggleWindowOn();
            SlotInfo.ToggleWindowOn();
            SlotOptions.ToggleWindowOff();

            //Update the slot visuals.
            _sprIcon.spriteName = _myslot.IconName;
            //_lblSlotName.text = "Tap to Select";
        }
        else
        {
            BG.ToggleWindowOff();
            SlotOptions.ToggleWindowOn();
            SlotInfo.ToggleWindowOff();

            _lblSlotName.text = "Add Slot";
        }

        if (_CostLabel)
        {
            float cost = (float)_myslot.Cost / 100.0f;

            string format = string.Format("{0:C}", cost);
            _CostLabel.text = format;
        }
    }
    public override void OnDeActivate()
    {
        //base.OnDeActivate ();
        //ActivityManager.Instance.ToggleHud(false);

        //PhasesCountWindow.ToggleWindowOff();
        BG.ToggleWindowOff();

        //Manually toggle off the game over window on deactivate.
        PhasesCountWindow.ToggleWindowOff();
    }
Exemplo n.º 3
0
    void Update()
    {
        if (!_cannonItemCard.Unlocked)
        {
            _myCheckbox.isChecked = false;
        }

        if (_myCheckbox.isChecked)
        {
            SelectedWindow.ToggleWindowOn();
        }
        else
        {
            SelectedWindow.ToggleWindowOff();
        }

//		if(!_myCheckbox.isChecked && SelectedWindow._isVisible)
//			SelectedWindow.ToggleWindowOff();
    }
    public void OnPress(bool p)
    {
        DraggingWindow.ToggleWindowOff();

//		if(p == true && !animationset)
//		{
//
//			animation.to = GParent.position;
//			animationset = true;
//
//		}
//
//
//		if(p == false)
//		{
//
//
//
//			dragvec = Vector2.zero;
//
//			animation.from = GParent.position ;
//
//			animation.Reset();
//			animation.Play(true);
//
//
////			foreach(CannonSelectionObject card in ActivityManager.Instance.CardSelectors)
////			{
////				if(collider.bounds.Intersects(card.collider.bounds))
////				{
////
////					//Call the button select function with forced cannon card for selection.
////					mySlotObject.ButtonCannonSelectedPressed(card.MyCannonCard);
////
////				}
////			}
////
//
//		}
//
    }
 public void CloseWindow()
 {
     myWindow.ToggleWindowOff();
 }
    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++;
            }
        }
    }