public void Refresh()
    {
        PriceText.text       = Cur_ShopItem.Price.ToString();
        ProbabilityText.text = Cur_ShopItem.Probability.ToString();
        TypeText.text        = Cur_ShopItem.ShopItemType.ToString();

        switch (Cur_ShopItem)
        {
        case ShopItem_Card sic:
        {
            ClientUtils.ChangeImagePicture(Pic, sic.PicID);
            NameText.text = sic.Name;
            break;
        }

        case ShopItem_Budget sib:
        {
            NameText.text = string.Format(LanguageManager.Instance.GetText("LevelEditorPanel_BudgetValueText"), sib.Budget);
            break;
        }

        case ShopItem_LifeUpperLimit silu:
        {
            NameText.text = string.Format(LanguageManager.Instance.GetText("LevelEditorPanel_LifeUpperLimitValueText"), silu.LifeUpperLimit);
            break;
        }

        case ShopItem_EnergyUpperLimit sieu:
        {
            NameText.text = string.Format(LanguageManager.Instance.GetText("LevelEditorPanel_EnergyUpperLimitValueText"), sieu.EnergyUpperLimit);
            break;
        }
        }
    }
Ejemplo n.º 2
0
    public void SetLevel(Level level)
    {
        if (level == null)
        {
            Cur_Level                = null;
            LevelNameText.text       = "";
            LevelTypeText.text       = "";
            LevelBadgeNum            = 0;
            DifficultyLevelText.text = "";
            ClientUtils.ChangeImagePicture(PicImage, (int)AllCards.SpecialPicIDs.Empty);
        }
        else
        {
            Cur_Level          = level;
            LevelNameText.text = level.LevelNames[LanguageManager.Instance.GetCurrentLanguage()];

            if (level.LevelType != LevelTypes.Enemy)
            {
                LevelTypeText.text = Level.GetLevelTypeDesc(level.LevelType);
            }
            else
            {
                LevelTypeText.text = Level.GetLevelTypeDesc(level.LevelType) + " (" + Enemy.GetEnemyTypeDesc(((Enemy)level).EnemyType) + ")";
            }

            LevelBadgeNum            = level.DifficultyLevel;
            DifficultyLevelText.text = "Lv." + level.DifficultyLevel;

            ClientUtils.ChangeImagePicture(PicImage, Cur_Level.LevelPicID);
        }
    }
Ejemplo n.º 3
0
 public void Init(CardDeck.CoolingDownCard cdc, ClientPlayer clientPlayer)
 {
     ClientPlayer           = clientPlayer;
     M_CoolingDownCard      = cdc;
     CoolDownRoundText.text = cdc.LeftRounds.ToString();
     ClientUtils.ChangeImagePicture(Image, AllCards.GetCard(cdc.CardID).BaseInfo.PictureID);
     CooldDownIconAnim.SetTrigger("Add");
 }
Ejemplo n.º 4
0
 public void Refresh()
 {
     TypeText.text = Cur_Bonus.BonusType.ToString();
     NameText.text = Utils.TextMeshProColorStringConvertToText(Cur_Bonus.GetDesc());
     if (Cur_Bonus is Bonus_UnlockCardByID b_UnlockCardByID)
     {
         ClientUtils.ChangeImagePicture(Pic, AllCards.GetPicIDByCardID(b_UnlockCardByID.CardID));
     }
 }
 public void Initialize(CardInfo_Base ci, OnButtonClickDelegate onClick)
 {
     IsEdit = false;
     Button.onClick.RemoveAllListeners();
     CardIDText.text = string.Format("{0:000}", ci.CardID);
     ClientUtils.ChangeImagePicture(Image, ci.BaseInfo.PictureID);
     Button.onClick.AddListener(delegate { onClick(); });
     HideImage.gameObject.SetActive(ci.BaseInfo.IsHide);
     TempImage.gameObject.SetActive(ci.BaseInfo.IsTemp);
     CardPreviewButtonStarsGroup.SetStarNumber(ci.UpgradeInfo.CardLevel, ci.UpgradeInfo.CardLevelMax);
 }
Ejemplo n.º 6
0
    void Awake()
    {
        ClientUtils.ChangeImagePicture(Pic, (int)AllCards.SpecialPicIDs.Shop);
        List <string> shopItemTypes = Enum.GetNames(typeof(ShopItem.ShopItemTypes)).ToList();

        TypeDropdown.ClearOptions();
        TypeDropdown.options.Add(new Dropdown.OptionData(" "));
        TypeDropdown.AddOptions(shopItemTypes);

        LanguageManager.Instance.RegisterTextKey(TypeLabel, "LevelEditorPanel_ShopItemTypeLabel");
    }
Ejemplo n.º 7
0
 public void Initiate(int count, CardInfo_Base cardInfo, SelectCardOnMouseEnterHandler enterHandler, SelectCardOnMouseLeaveHandler leaveHandler, Color color)
 {
     Count                  = count;
     Metal                  = cardInfo.BaseInfo.Metal;
     Energy                 = cardInfo.BaseInfo.Energy;
     Text_CardName.text     = cardInfo.BaseInfo.CardNames[LanguageManager.Instance.GetCurrentLanguage()];
     CardInfo               = cardInfo;
     OnMouseEnterHandler    = enterHandler;
     OnMouseLeaveHandler    = leaveHandler;
     CardButton.image.color = color;
     CardButton.onClick.RemoveAllListeners();
     ClientUtils.ChangeImagePicture(CardImage, CardInfo.BaseInfo.PictureID);
     StarsGroup.SetStarNumber(CardInfo.UpgradeInfo.CardLevel, CardInfo.UpgradeInfo.CardLevelMax);
 }
Ejemplo n.º 8
0
    public void Initialize(Bonus bonus, UnityAction onEditButtonClick, UnityAction onDeleteButtonClick)
    {
        Cur_Bonus = bonus;
        EditButton.onClick.RemoveAllListeners();
        EditButton.onClick.AddListener(onEditButtonClick);
        DeleteButton.onClick.RemoveAllListeners();
        DeleteButton.onClick.AddListener(onDeleteButtonClick);

        ClientUtils.ChangeImagePicture(Pic, Cur_Bonus.PicID);
        TypeText.text = Cur_Bonus.BonusType.ToString();
        NameText.text = Utils.TextMeshProColorStringConvertToText(Cur_Bonus.GetDesc());
        if (Cur_Bonus is Bonus_UnlockCardByID b_UnlockCardByID)
        {
            ClientUtils.ChangeImagePicture(Pic, AllCards.GetPicIDByCardID(b_UnlockCardByID.CardID));
        }
    }
Ejemplo n.º 9
0
    public void Init(SideEffectExecute buffSee, int buffId)
    {
        Cur_Buff = ((PlayerBuffSideEffects)buffSee.SideEffectBases[0]);
        int buffValue = GetBuffValue(buffSee, Cur_Buff);

        BuffValueText.text = buffValue == 0 ? "" : buffValue.ToString();
        BuffId             = buffId;
        ClientUtils.ChangeImagePicture(Image, Cur_Buff.M_SideEffectParam.GetParam_ConstInt("BuffPicId"));
        Color buffColor = ClientUtils.HTMLColorToColor(AllBuffs.GetBuff((Cur_Buff.Name)).M_SideEffectParam.GetParam_String("BuffColor"));

        BuffBloom.color        = buffColor;
        BuffDescText.color     = buffColor;
        BuffValuePanel.enabled = Cur_Buff.M_SideEffectParam.GetParam_Bool("HasNumberShow");
        BuffValueText.enabled  = Cur_Buff.M_SideEffectParam.GetParam_Bool("HasNumberShow");
        BuffAnim.SetTrigger("Add");
        BuffDescText.text = Utils.TextMeshProColorStringConvertToText(Cur_Buff.GenerateDesc());
    }
Ejemplo n.º 10
0
    public void Initialize(CardInfo_Base cardInfo, UnityAction <int> onMoveUp, UnityAction <int> onMoveDown, UnityAction <int> onRemove)
    {
        CardInfo      = cardInfo;
        CardName.text = CardInfo.BaseInfo.CardNames[LanguageManager.Instance.GetCurrentLanguage()];
        Color cardColor = ClientUtils.HTMLColorToColor(CardInfo.GetCardColor());

        CardBGImage.color = cardColor;
        ClientUtils.ChangeImagePicture(CardImage, CardInfo.BaseInfo.PictureID);
        StarsGroup.SetStarNumber(CardInfo.UpgradeInfo.CardLevel, CardInfo.UpgradeInfo.CardLevelMax);

        MoveUpButton.onClick.RemoveAllListeners();
        MoveDownButton.onClick.RemoveAllListeners();
        RemoveButton.onClick.RemoveAllListeners();

        MoveUpButton.onClick.AddListener(delegate { onMoveUp(CardInfo.CardID); });
        MoveDownButton.onClick.AddListener(delegate { onMoveDown(CardInfo.CardID); });
        RemoveButton.onClick.AddListener(delegate { onRemove(CardInfo.CardID); });
    }
Ejemplo n.º 11
0
    public override void Initialize(Bonus bonus)
    {
        base.Initialize(bonus);
        IconImageContainer.SetActive(true);
        CardImageContainer.SetActive(false);
        switch (bonus.BonusType)
        {
        case Bonus.BonusTypes.LifeUpperLimit:
        {
            ItemImage.sprite         = LifeIcon;
            ItemImage.color          = ClientUtils.GetColorFromColorDict(AllColors.ColorType.LifeIconColor);
            ItemImage.preserveAspect = true;
            break;
        }

        case Bonus.BonusTypes.EnergyUpperLimit:
        {
            ItemImage.sprite         = EnergyIcon;
            ItemImage.color          = ClientUtils.GetColorFromColorDict(AllColors.ColorType.EnergyIconColor);
            ItemImage.preserveAspect = true;
            break;
        }

        case Bonus.BonusTypes.Budget:
        {
            ItemImage.sprite         = BudgetIcon;
            ItemImage.color          = Color.white;
            ItemImage.preserveAspect = true;
            break;
        }

        case Bonus.BonusTypes.UnlockCardByID:
        {
            IconImageContainer.SetActive(false);
            CardImageContainer.SetActive(true);
            ClientUtils.ChangeImagePicture(CardImage, BonusCardInfo.BaseInfo.PictureID);
            CardImage.color          = Color.white;
            CardImageBorder.color    = ClientUtils.ChangeColorToWhite(ClientUtils.HTMLColorToColor(BonusCardInfo.GetCardColor()), 0.5f);
            CardImage.preserveAspect = true;
            break;
        }
        }
    }
    public void Initialize(ShopItem shopItem, UnityAction onEditButtonClick, UnityAction onDeleteButtonClick)
    {
        Cur_ShopItem = shopItem;
        EditButton.onClick.RemoveAllListeners();
        EditButton.onClick.AddListener(onEditButtonClick);
        DeleteButton.onClick.RemoveAllListeners();
        DeleteButton.onClick.AddListener(onDeleteButtonClick);

        ClientUtils.ChangeImagePicture(Pic, shopItem.PicID);
        PriceText.text       = shopItem.Price.ToString();
        ProbabilityText.text = shopItem.Probability.ToString();
        TypeText.text        = shopItem.ShopItemType.ToString();
        switch (shopItem)
        {
        case ShopItem_Card sic:
        {
            NameText.text = sic.Name;
            break;
        }

        case ShopItem_Budget sib:
        {
            NameText.text = string.Format(LanguageManager.Instance.GetText("LevelEditorPanel_BudgetValueText"), sib.Budget);
            break;
        }

        case ShopItem_LifeUpperLimit silu:
        {
            NameText.text = string.Format(LanguageManager.Instance.GetText("LevelEditorPanel_LifeUpperLimitValueText"), silu.LifeUpperLimit);
            break;
        }

        case ShopItem_EnergyUpperLimit sieu:
        {
            NameText.text = string.Format(LanguageManager.Instance.GetText("LevelEditorPanel_EnergyUpperLimitValueText"), sieu.EnergyUpperLimit);
            break;
        }
        }
    }
Ejemplo n.º 13
0
    public static StoryEditorPanel_LevelButton BaseInitialize(Level level, Transform parent, UnityAction <Level> onSetButtonClick, UnityAction onEditButtonClick, UnityAction onDeleteButtonClick)
    {
        StoryEditorPanel_LevelButton btn = null;

        switch (level.LevelType)
        {
        case LevelTypes.Enemy:
        {
            btn = GameObjectPoolManager.Instance.PoolDict[GameObjectPoolManager.PrefabNames.StoryEditorPanel_EnemyButton].AllocateGameObject <StoryEditorPanel_EnemyButton>(parent);
            break;
        }

        case LevelTypes.Shop:
        {
            btn = GameObjectPoolManager.Instance.PoolDict[GameObjectPoolManager.PrefabNames.StoryEditorPanel_ShopButton].AllocateGameObject <StoryEditorPanel_ShopButton>(parent);
            break;
        }
        }

        btn.Cur_Level = level;
        btn.RefreshLevelName();
        btn.OnSetButtonClickAction = delegate { onSetButtonClick(btn.Cur_Level); };
        btn.EditButton.onClick.AddListener(onEditButtonClick);
        btn.DeleteButton.onClick.RemoveAllListeners();
        btn.DeleteButton.onClick.AddListener(onDeleteButtonClick);

        ClientUtils.ChangeImagePicture(btn.PicImage, btn.Cur_Level.LevelPicID);

        foreach (StoryEditorPanel_LevelButtonSliderBar slider in btn.Sliders)
        {
            slider.PoolRecycle();
        }

        btn.Sliders.Clear();

        btn.ChildrenInitialize();
        return(btn);
    }
Ejemplo n.º 14
0
 public void Initialize(int pictureID, int cardID)
 {
     ClientUtils.ChangeImagePicture(PicImage, pictureID);
     CardIDText.text = cardID.ToString();
 }
Ejemplo n.º 15
0
 public void ChangePicture(int picID)
 {
     ClientUtils.ChangeImagePicture(Picture, picID);
     Picture.size = new Vector2(10.575f, 12.37f);
 }
Ejemplo n.º 16
0
    public void Initialize(int nodeIndex, UnityAction <int> onSelected, UnityAction <ChapterMapNode> onHovered, LevelTypes levelType = LevelTypes.Enemy, EnemyType enemyType = EnemyType.Soldier)
    {
        IsSelected = false;
        IsHovered  = false;

        OnHovered = onHovered;
        NodeIndex = nodeIndex;

        Button.onClick.RemoveAllListeners();
        Button.onClick.AddListener(delegate { onSelected(NodeIndex); });

        int picID = 0;

        transform.localScale = Vector3.one * 1f;
        switch (levelType)
        {
        case LevelTypes.Enemy:
        {
            switch (enemyType)
            {
            case EnemyType.Soldier:
            {
                picID = (int)AllCards.SpecialPicIDs.LockedEmeny;
                break;
            }

            case EnemyType.Boss:
            {
                Button.transform.localScale = Vector3.one * 1.5f;
                picID = (int)AllCards.SpecialPicIDs.LockedBoss;
                break;
            }
            }

            break;
        }

        case LevelTypes.Rest:
        {
            picID = (int)AllCards.SpecialPicIDs.Rest;
            break;
        }

        case LevelTypes.Shop:
        {
            picID = (int)AllCards.SpecialPicIDs.Shop;
            break;
        }

        case LevelTypes.Start:
        {
            picID = (int)AllCards.SpecialPicIDs.Empty;
            break;
        }

        case LevelTypes.Treasure:
        {
            Button.transform.localScale = Vector3.one * 1.2f;
            picID = (int)AllCards.SpecialPicIDs.Treasure;
            break;
        }
        }

        ClientUtils.ChangeImagePicture(PicImage, picID);
    }