Ejemplo n.º 1
0
    public void Initialize(PassiveType passiveType, PassiveDB data, PassiveSelectScreen parent)
    {
        if (data == null)
        {
            return;
        }

        this.passiveDB   = data;
        this.passiveType = passiveType;
        this.hasItem     = data.hasPassive;
        this.parent      = parent;

        SetCanUse(hasItem);
        SetIcon();
        if (Language.Instance.NowLanguage == LanguageType.Korean)
        {
            SetText(data.koreanDescription);
            SetPrice(data.koreanName, data.price);


            text.font = Language.Instance.KoreanFont;
            //text.fontSize += 15;
            priceText.font     = Language.Instance.KoreanFont;
            priceText.fontSize = originSize + 15;
        }
        else
        {
            SetText(data.englishDescription);
            SetPrice(data.englishName, data.price);
            priceText.fontSize = originSize + 7;
        }
    }
Ejemplo n.º 2
0
    private void SetText(PassiveDB passiveDb)
    {
        if (description == null)
        {
            return;
        }
        if (passiveDb == null)
        {
            return;
        }



        int languageKey = PlayerPrefs.GetInt(PlayerPrefKeys.LanguageKey, (int)LanguageType.Korean);

        //한글
        if (languageKey == 0)
        {
            description.text     = string.Format("{0} 메달 입니다 구매하시겠습니까?", passiveDb.price);
            description.font     = Language.Instance.KoreanFont;
            description.fontSize = originTextSize + 8;
        }
        else
        {
            description.text     = string.Format("price is {0} medals\n Would you like to purchase it?", passiveDb.price);
            description.font     = Language.Instance.EnglishFont;
            description.fontSize = originTextSize;
        }
    }
Ejemplo n.º 3
0
    public void Initialize(PassiveType passiveType, PassiveDB passiveDb)
    {
        this.passiveType = passiveType;
        //아이콘세팅

        //텍스트 세팅
        this.price = passiveDb.price;
        SetIcon(passiveType.ToString());

        SetText(passiveDb);
    }
Ejemplo n.º 4
0
    private void RenewPassiveSlot()
    {
        if (slotList == null)
        {
            return;
        }

        for (int i = 0; i < slotList.Count; i++)
        {
            PassiveDB data = DatabaseLoader.Instance.passiveDB[slotList[i].passiveType];
            slotList[i].Initialize(slotList[i].passiveType, data, this);
        }
    }
Ejemplo n.º 5
0
    public void BuyButtonClick()
    {
        DatabaseLoader.Instance.BuyPassiveItem(nowBuyingPassive);
        if (playerGoods != null)
        {
            PassiveDB data = DatabaseLoader.Instance.passiveDB[nowBuyingPassive];
            playerGoods.UseMedals(data.price);
            UpdateMedalText();
        }
        //로컬 데이터 저장                             //0없음 1있음
        PlayerPrefs.SetInt(nowBuyingPassive.ToString(), 1);

        //클라우드에 저장
        // GoogleCloudSave.instance.SaveMyPassivies();

        ClosePassiveBuyScreen();
    }
Ejemplo n.º 6
0
 public void OpenPassiveBuyScreen(PassiveType type, PassiveDB data)
 {
     if (passiveBuyScreen == null)
     {
         return;
     }
     //돈이 되면 창 열기
     if (playerGoods.GetCurrentMedal() >= data.price)
     {
         passiveBuyScreen.gameObject.SetActive(true);
         passiveBuyScreen.Initialize(type, data);
         nowBuyingPassive = type;
     }
     //돈이 부족할때
     else
     {
         Debug.Log("돈이 부족합니다");
         SoundManager.Instance.PlaySoundEffect("error");
     }
     //
 }