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 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);
    }
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 OnDrag(Vector2 delta)
    {
        //dragvec = delta;

        //transform.localScale = new Vector3(3.0f,3.0f,3.0f);
        DraggingWindow.ToggleWindowOn();


        foreach (CannonSelectionObject card in ActivityManager.Instance.CardSelectors)
        {
            if (GetComponent <Collider>().bounds.Intersects(card.GetComponent <Collider>().bounds))
            {
                //Call the button select function with forced cannon card for selection.
                card._myCheckbox.isChecked = true;
            }
        }

//		Debug.LogError("BINGO");
    }
    public override void OnActivate()
    {
        //Prepare the grid.
        if (!prepredPhaseGrid)
        {
            PreparePhaseGrid();
        }

        if (presented)
        {
            //Toggle back on the game over window.
            PhasesCountWindow.ToggleWindowOn();
            BG.ToggleWindowOn();
            ActivityManager.Instance.ToggleHud(false);

            return;
        }

        //Fill up the list.
        int index = 0;

        foreach (BasePhase.PhaseData phase in GameObjectTracker.instance._PlayerData.Breathless.PhaseList)
        {
            _resultList[index].PhaseData = phase;
            index++;
        }


        GameOverWindow.SetWindowAlpha(1.0f);
        //Set the information
        GameOverWindow.ToggleWindowOn();

        //Reset the game over window animations for bring in.
        GOAlpha.Reset();
        GOAlpha.Play(true);
        GOPosition.Reset();
        GOPosition.Play(true);
        GOBringIN.Reset();
        GOBringIN.Play(true);


        //Set the timer to game over duration upon activate.
        ResetTimer(GameOverDuration);
        curState = state.GameOver;

        //Grab the games statistics. By now the game stats should be of a completed game.
        Statistics gameStats = GameObjectTracker.instance.RunStatistics;

        if (gameStats == null)
        {
            return;
        }

        //Set the score.
        ScoreLabel.text = string.Format("{0:#,#,#}", gameStats.Score);

        //Set the time.
        //TimeLabel.text = FormatSeconds(gameStats.TimeAmount);

        //Set the bonus amount
        BonusLabel.text = "N/A";

        //Set the coins collected.
        //MoneyLabel.text =  string.Format("{0:C}",gameStats.Money);
        //MoneyLabel.text =  gameStats.Money.ToString();

        //Set the PPS label
        //PPSLabel.text = gameStats.PPS.ToString() + " PPS";
        PPSText   = string.Format("{0:#,#,#} PPS", gameStats.PPS);
        ScoreText = string.Format("{0:#,#,#}", gameStats.Score);
        CoinsText = string.Format("{0:C}", gameStats.Money);

        PPSLabel.text = ScoreText;
        viewPPS       = false;

        MoneyLabel.text = CoinsText;

        //Set the animal.

        //Grab player data.
        BaseItemCard card = GameObjectTracker.instance._PlayerData.FindCardByCannonType(gameStats.CompletionCannon);

        //Check if its a valid card theng grab the icon name.
        if (card == null || gameStats.CompletionCannon == EntityFactory.CannonTypes.NULL ||
            gameStats.CompletionCannon == EntityFactory.CannonTypes.Empty)
        {
            Animal.spriteName = "phaseunknown";
            return;
        }

        Animal.spriteName = card.DisplayInfo.IconName;
    }