/// <summary>
 /// You should implement this method which is called from start and optionally if the selection chages.
 /// </summary>
 /// <param name="isStart"></param>
 public override void RunMethod(bool isStart = true)
 {
     if (GameItem != null)
     {
         _textComponent.text = Text.FormatValue(GameItem.GetCounterInt(_counterIndex));
     }
 }
Example #2
0
        /// <summary>
        /// Display the confirm window
        /// </summary>
        void DisplayConfirmWindow()
        {
            Sprite sprite = null;

            if (ConfirmDialogSpriteType == UnlockGameItemButton.DialogSpriteType.FromGameItem)
            {
                sprite = _gameItemToBuy.GetSpriteByType(GameItem.LocalisableSpriteType.UnlockWindow) ??
                         _gameItemToBuy.Sprite;
            }
            else if (ConfirmDialogSpriteType == UnlockGameItemButton.DialogSpriteType.Custom)
            {
                sprite = ConfirmDialogSprite.GetSprite();
            }

            var dialogInstance = DialogManager.Instance.Create(null, null, ConfirmContentPrefab, null, runtimeAnimatorController: ConfirmContentAnimatorController, contentSiblingIndex: 1);

            dialogInstance.Show(title: ConfirmTitleText.FormatValue(_gameItemToBuy.Name, _gameItemToBuy.Description, _gameItemToBuy.ValueToUnlock),
                                text: ValueOrNull(ConfirmText1.FormatValue(_gameItemToBuy.Name, _gameItemToBuy.Description, _gameItemToBuy.ValueToUnlock)),
                                text2: ValueOrNull(ConfirmText2.FormatValue(_gameItemToBuy.Name, _gameItemToBuy.Description, _gameItemToBuy.ValueToUnlock)),
                                sprite: sprite,
                                doneCallback: ConfirmWindowCallback,
                                dialogButtons:
                                ConfirmContentShowsButtons
                        ? DialogInstance.DialogButtonsType.Custom
                        : DialogInstance.DialogButtonsType.OkCancel);
        }
        /// <summary>
        /// You should implement this method which is called from start and optionally if the selection chages.
        /// </summary>
        /// <param name="isStart"></param>
        public override void RunMethod(bool isStart = true)
        {
            Assert.IsNotNull(GameManager.Instance.Levels, "Levels are not setup when referenced from ShowLevelInfo");

            if (GameItem != null)
            {
                _textComponent.text = Text.FormatValue(GameItem.Number, GameItem.Name, GameItem.Description, GameItem.ValueToUnlock);
            }
        }
        /// <summary>
        /// You should implement this method which is called from start and optionally if the selection chages.
        /// </summary>
        /// <param name="isStart"></param>
        public override void RunMethod(bool isStart = true)
        {
            Assert.IsNotNull(GameManager.Instance.Worlds, "Worlds are not setup when referenced from ShowWorldStars");

            if (GameItem != null)
            {
                var world = GameItem as World;
                _textComponent.text = Text.FormatValue(world.StarsTotal, world.StarsWon);
            }
        }