예제 #1
0
    IEnumerator RefreshAbleExchangeCardList(int Quality)
    {
        MyTools.DestroyChildNodes(AbleExchangeTable.transform);

        UIScrollView sv = AbleExchangeTable.transform.parent.GetComponent <UIScrollView>();

        foreach (KeyValuePair <int, MagicCardConfig> pair in CsvConfigTables.Instance.MagicCardCsvDic)
        {
            if (pair.Value.Quality <= Quality && SerPlayerData.GetItemCount(pair.Value.CardID) > 1)
            {
                GameObject newUnit = NGUITools.AddChild(AbleExchangeTable.gameObject, AbleExchangeCardPrefab);
                newUnit.SetActive(true);
                newUnit.name = "Card_" + pair.Value.CardID;

                UI_MagicCard mc = newUnit.GetComponent <UI_MagicCard>();
                mc.UnconditionalShow(pair.Value.CardID);

                AbleExchangeTable.repositionNow = true;

                yield return(new WaitForEndOfFrame());

                sv.ResetPosition();
            }
        }
    }
예제 #2
0
    IEnumerator RefreshFishList()
    {
        MyTools.DestroyChildNodes(LstTable.transform);
        foreach (KeyValuePair <int, MagicCardConfig> pair in CsvConfigTables.Instance.MagicCardCsvDic)
        {
            if (pair.Value.ThemeID != 103)
            {
                continue;
            }

            if (SerPlayerData.GetItemCount(pair.Key) > 0)
            {
                GameObject newUnit = NGUITools.AddChild(LstTable.gameObject, CardPrefab);
                newUnit.SetActive(true);
                newUnit.name = "Card_" + pair.Key;

                UI_MagicCard mc = newUnit.GetComponent <UI_MagicCard>();
                mc.UnconditionalShow(pair.Key);

                LstTable.repositionNow = true;
                yield return(new WaitForEndOfFrame());

                FishLst.ResetPosition();
            }
        }
    }
예제 #3
0
    /// <summary> 显示商品详情 </summary>
    public void ShowCommodityDetails(ItemConfig ItemCfg)
    {
        TweenAlpha.Begin(DetailsRoot, 0.1f, 1);

        Details_ItemCfg      = ItemCfg;
        Details_Name.text    = ItemCfg.Name;
        Details_Des.text     = ItemCfg.Describe;
        Details_HoldNum.text = StringBuilderTool.ToString("已拥有:", SerPlayerData.GetItemCount(ItemCfg.ItemID));
    }
예제 #4
0
    public void Show()
    {
        isShowing = true;
        TweenAlpha.Begin(gameObject, 0.1f, 1);

        CandyCnt.text = SerPlayerData.GetItemCount(1003).ToString();

        StartCoroutine("RefreshCommodityList");
    }
예제 #5
0
    public void BuyRes()
    {
        CandyCnt.text = SerPlayerData.GetItemCount(1003).ToString();

        if (Details_ItemCfg != null)
        {
            Details_HoldNum.text = StringBuilderTool.ToString("已拥有:", SerPlayerData.GetItemCount(Details_ItemCfg.ItemID));
        }
    }
예제 #6
0
    /// <summary> 点击购买 </summary>
    public void OnClick_Buy()
    {
        GameApp.Instance.SoundInstance.PlaySe("button");
        Debug.Log("点击【购买】");

        if (SerPlayerData.GetItemCount(1003) < Details_ItemCfg.PriceValue)
        {
            GameApp.Instance.CommonHintDlg.OpenHintBox("糖果不足!");
            return;
        }
        if (SerPlayerData.GetItemCount(Details_ItemCfg.ItemID) > 0 && Details_ItemCfg.EnableSuperposition == 0)
        {
            GameApp.Instance.CommonHintDlg.OpenHintBox(StringBuilderTool.ToInfoString(Details_ItemCfg.Name, "只能拥有一个!"));
            return;
        }

        GameApp.SendMsg.BuyItem((uint)Details_ItemCfg.ItemID);
    }
예제 #7
0
    private bool EnableCompound(int CardID)
    {
        MagicCardConfig MCCfg        = null;
        bool            isEnableComp = false;

        if (CsvConfigTables.Instance.MagicCardCsvDic.TryGetValue(CardID, out MCCfg))
        {
            isEnableComp = (MCCfg.NeedItemsLst.Count > 0);
            for (int i = 0; i < MCCfg.NeedItemsLst.Count; i++)
            {
                if (SerPlayerData.GetItemCount(MCCfg.NeedItemsLst[i].ItemID) == 0)
                {
                    isEnableComp = false;
                    break;
                }
            }
        }
        return(isEnableComp);
    }
예제 #8
0
    /*void Update()
     * {
     *  if (Input.GetKeyUp(KeyCode.A))
     *  {
     *
     *  }
     * }*/

    public void Refresh()
    {
        if (GameApp.Instance.FightUI != null)
        {
            return;
        }

        uint Gold = SerPlayerData.GetItemCount(1001);

        //uint Diamond = SerPlayerData.GetItemCount(1002);

        GoldCnt.text = Gold.ToString();
        //DiamondCnt.text = Diamond.ToString();

        if (CandyCnt != null)
        {
            uint Candy = SerPlayerData.GetItemCount(1003);
            CandyCnt.text = Candy.ToString();
        }
    }
예제 #9
0
    /// <summary> 申请修改玩家名 </summary>
    public void ModifPlayerName()
    {
        GameApp.Instance.SoundInstance.PlaySe("button");

        if (PlayerNameInp.value.Length == 0)
        {
            GameApp.Instance.CommonHintDlg.OpenHintBox("玩家昵称不能为空!");
            return;
        }
        if (PlayerNameInp.value.Contains("*"))
        {
            GameApp.Instance.CommonHintDlg.OpenHintBox("玩家昵称中含有非法字符!");
            return;
        }

        if (SerPlayerData.GetItemCount(1000) < 200)
        {
            GameApp.Instance.CommonHintDlg.OpenHintBox("钻石不足!");
            return;
        }

        GameApp.SendMsg.CheckPlayerName(PlayerNameInp.value);
    }
예제 #10
0
    private void StatisHoldCnt()
    {
        if (ThemeID == 0)
        {
            return;
        }

        int total = 0;
        int hold  = 0;

        foreach (KeyValuePair <int, MagicCardConfig> pair in CsvConfigTables.Instance.MagicCardCsvDic)
        {
            if (pair.Value.ThemeID == ThemeID)
            {
                total++;
                if (SerPlayerData.GetItemCount(pair.Key) > 0)
                {
                    hold++;
                }
            }
        }
        Count.text = StringBuilderTool.ToString(hold, "/", total);
        Count.gameObject.SetActive(hold != 0 || total != 0);
    }
예제 #11
0
    public void RefreshResidueTime()
    {
        uint ItemCount = SerPlayerData.GetItemCount(ItemID);

        if (ItemCount > 0)
        {
            string des       = "";
            int    DaySum    = 0;
            uint   AccountID = SerPlayerData.GetAccountID();
            string itemKey   = "";
            string awardKey  = "";
            switch (PrivilegeType)
            {
            case EPrivilegeType.eMonth:
                des      = "月";
                DaySum   = 30 * (int)ItemCount;
                itemKey  = StringBuilderTool.ToString(AccountID, "_Privilege_Month");
                awardKey = StringBuilderTool.ToString(AccountID, "_Award_Month_", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                break;

            case EPrivilegeType.eSeason:
                des      = "季";
                DaySum   = 90 * (int)ItemCount;
                itemKey  = StringBuilderTool.ToString(AccountID, "_Privilege_Season");
                awardKey = StringBuilderTool.ToString(AccountID, "_Award_Season_", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                break;

            case EPrivilegeType.eYear:
                des      = "年";
                DaySum   = 365 * (int)ItemCount;
                itemKey  = StringBuilderTool.ToString(AccountID, "_Privilege_Year");
                awardKey = StringBuilderTool.ToString(AccountID, "_Award_Year_", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                break;
            }

            if (ItemCount == 1)
            {
                PlayerPrefs.SetString(itemKey, DateTime.Now.Ticks.ToString());
            }

            string   RecordFirstItemTime = PlayerPrefs.GetString(itemKey);
            DateTime dtFirstItemTime     = new DateTime(long.Parse(RecordFirstItemTime));
            TimeSpan ResidueTime         = DateTime.Now - dtFirstItemTime;
            DaySum -= ResidueTime.Days;
            ResidueTimeDesLab.text = StringBuilderTool.ToString("[6BFF78]", des, "卡特权已开通[-]([FEE209]", DaySum, "[-]天)");

            if (!PlayerPrefs.HasKey(awardKey))
            {
                PlayerPrefs.SetInt(awardKey, 1);

                Dictionary <int, int> AwardItemDic = new Dictionary <int, int>();
                switch (PrivilegeType)
                {
                case EPrivilegeType.eMonth:
                    AwardItemDic.Add(20002, 3);
                    AwardItemDic.Add(1001, 100);
                    AwardItemDic.Add(1003, 100);
                    break;

                case EPrivilegeType.eSeason:
                    AwardItemDic.Add(20002, 4);
                    AwardItemDic.Add(1001, 200);
                    AwardItemDic.Add(1003, 200);
                    break;

                case EPrivilegeType.eYear:
                    AwardItemDic.Add(20002, 5);
                    AwardItemDic.Add(1001, 300);
                    AwardItemDic.Add(1003, 300);
                    break;
                }
                foreach (KeyValuePair <int, int> pair in AwardItemDic)
                {
                    GameApp.SendMsg.GMOrder(StringBuilderTool.ToString("AddItem ", pair.Key, " ", pair.Value));
                }
                GameApp.Instance.GetItemsDlg.OpenGetItemsBox(AwardItemDic);
            }
        }
        else
        {
            ResidueTimeDesLab.text = "[C74343]未开通[-]";
        }
    }
예제 #12
0
    IEnumerator RefreshCardList()
    {
        MyTools.DestroyChildNodes(CardTable.transform);

        HoldLst.Clear();
        List <int> WithoutLst = new List <int>();
        List <int> WithoutAndEnableCompLst = new List <int>();
        List <int> WithoutAndUnableCompLst = new List <int>();

        foreach (KeyValuePair <int, MagicCardConfig> pair in CsvConfigTables.Instance.MagicCardCsvDic)
        {
            if (pair.Value.SystemID == CurChapterID && pair.Value.ThemeID == CurGroupID && (CurQuality == 0 ? true : pair.Value.Quality == CurQuality))
            {
                if (SerPlayerData.GetItemCount(pair.Key) > 0)
                {
                    HoldLst.Add(pair.Key);
                }
                else
                {
                    WithoutLst.Add(pair.Key);
                }
            }
        }

        if (HoldLst.Count == 0 && WithoutLst.Count == 0)
        {
            TweenAlpha.Begin(GroupExplain, 0.2f, 1);

            GroupConfig gc = null;
            CsvConfigTables.Instance.GroupCsvDic.TryGetValue(CurGroupID, out gc);
            if (gc != null)
            {
                GroupExplain_Pic.mainTexture = Resources.Load(StringBuilderTool.ToInfoString("MagicCardTheme/", gc.ThemePic)) as Texture;
                GroupExplain_Title.text      = gc.Name;
                GroupExplain_Explain.text    = gc.Explain;
            }
            yield break;
        }
        else
        {
            TweenAlpha.Begin(GroupExplain, 0.2f, 0);
        }

        for (int i = 0; i < HoldLst.Count; i++)
        {
            AddCard(HoldLst[i]);
            yield return(new WaitForEndOfFrame());
        }

        for (int i = 0; i < WithoutLst.Count; i++)
        {
            if (EnableCompound(WithoutLst[i]))
            {
                WithoutAndEnableCompLst.Add(WithoutLst[i]);
            }
            else
            {
                WithoutAndUnableCompLst.Add(WithoutLst[i]);
            }
        }
        for (int i = 0; i < WithoutAndEnableCompLst.Count; i++)
        {
            AddCard(WithoutAndEnableCompLst[i]);
            yield return(new WaitForEndOfFrame());
        }
        for (int i = 0; i < WithoutAndUnableCompLst.Count; i++)
        {
            AddCard(WithoutAndUnableCompLst[i]);
            yield return(new WaitForEndOfFrame());
        }

        CardLstRoot.GetComponent <UIScrollView>().ResetPosition();
    }
예제 #13
0
 void RefreshCoinCount()
 {
     NormalCoinCountLab.text = SerPlayerData.GetItemCount(20001).ToString();
     GoldCoinCountLab.text   = SerPlayerData.GetItemCount(20002).ToString();
 }
예제 #14
0
    /*void Awake()
     * {
     *
     * }
     *
     * void Start()
     * {
     *
     * }
     *
     * void OnDestroy()
     * {
     *
     * }
     *
     * void Update()
     * {
     *
     * }*/

    public void Show(int CardID)
    {
        if (CsvConfigTables.Instance.MagicCardCsvDic.TryGetValue(CardID, out MCCfg))
        {
            gameObject.SetActive(true);

            Name.text = MCCfg.Name;

            if (MagicVal != null)
            {
                MagicVal.text = MCCfg.MagicVal.ToString();
            }

            if (Des != null)
            {
                Des.text = MCCfg.Describe;
            }

            if (Count != null)
            {
                Count.text = SerPlayerData.GetItemCount(MCCfg.CardID).ToString();
            }

            if (SerPlayerData.GetItemCount(MCCfg.CardID) > 0)
            {
                Icon.mainTexture = Resources.Load(StringBuilderTool.ToInfoString("MagicCard/", MCCfg.ColouredIcon)) as Texture;

                for (int i = 0; i < Star.Length; i++)
                {
                    Star[i].spriteName = "c_t_star01";
                    Star[i].gameObject.SetActive(i < MCCfg.StarLv);
                }

                if (Bg != null)
                {
                    switch (MCCfg.Quality)
                    {
                    case 1:
                        Bg.spriteName = "lvbian";
                        break;

                    case 2:
                        Bg.spriteName = "lanbian";
                        break;

                    case 3:
                        Bg.spriteName = "zibian";
                        break;
                    }
                }

                if (QualitySign != null)
                {
                    switch (MCCfg.Quality)
                    {
                    case 1:
                        QualitySign.spriteName = "lvbiao";
                        break;

                    case 2:
                        QualitySign.spriteName = "lanbiao";
                        break;

                    case 3:
                        QualitySign.spriteName = "zibiao";
                        break;
                    }
                    QualitySign.MakePixelPerfect();
                }
            }
            else
            {
                Icon.mainTexture = Resources.Load(StringBuilderTool.ToInfoString("MagicCard/", MCCfg.ColorlessIcon)) as Texture;

                for (int i = 0; i < Star.Length; i++)
                {
                    Star[i].spriteName = "c_t_star01_hui";
                    Star[i].gameObject.SetActive(i < MCCfg.StarLv);
                }

                if (Bg != null)
                {
                    Bg.spriteName = "huibian";
                }

                if (QualitySign != null)
                {
                    QualitySign.spriteName = "";
                }
            }

            bool isEnableComp = (MCCfg.NeedItemsLst.Count > 0);
            if (isEnableComp)
            {
                bool MaterialCardsNotEnough    = false;
                Dictionary <int, int> ItemsDic = new Dictionary <int, int>();
                for (int i = 0; i < MCCfg.NeedItemsLst.Count; i++)
                {
                    if (ItemsDic.ContainsKey(MCCfg.NeedItemsLst[i].ItemID))
                    {
                        ItemsDic[MCCfg.NeedItemsLst[i].ItemID] += MCCfg.NeedItemsLst[i].ItemCnt;
                    }
                    else
                    {
                        ItemsDic.Add(MCCfg.NeedItemsLst[i].ItemID, MCCfg.NeedItemsLst[i].ItemCnt);
                    }
                }
                foreach (KeyValuePair <int, int> pair in ItemsDic)
                {
                    if (SerPlayerData.GetItemCount(pair.Key) < pair.Value)
                    {
                        MaterialCardsNotEnough = true;
                        break;
                    }
                }
                if (MaterialCardsNotEnough)
                {
                    isEnableComp = false;
                }
            }
            if (EnableCompound != null)
            {
                EnableCompound.SetActive(isEnableComp);
            }

            if (NewSign != null)
            {
                if (ShowNewSignCardIDLst.Contains(CardID))
                {
                    NewSign.alpha = 1;
                }
                else
                {
                    NewSign.alpha = 0;
                }
            }

            switch (MCCfg.StarLv)
            {
            case 1:
                Star[0].transform.localPosition = Vector3.zero;
                break;

            case 2:
                Star[0].transform.localPosition = new Vector3(-12, 0, 0);
                Star[1].transform.localPosition = new Vector3(12, 0, 0);
                break;

            case 3:
                Star[0].transform.localPosition = new Vector3(-24, 0, 0);
                Star[1].transform.localPosition = Vector3.zero;
                Star[2].transform.localPosition = new Vector3(24, 0, 0);
                break;

            case 4:
                Star[0].transform.localPosition = new Vector3(-36, 0, 0);
                Star[1].transform.localPosition = new Vector3(-12, 0, 0);
                Star[2].transform.localPosition = new Vector3(12, 0, 0);
                Star[3].transform.localPosition = new Vector3(36, 0, 0);
                break;

            case 5:
                break;
            }
        }
        else
        {
            gameObject.SetActive(false);
        }
    }
예제 #15
0
    public void UnconditionalShow(int CardID)
    {
        if (CsvConfigTables.Instance.MagicCardCsvDic.TryGetValue(CardID, out MCCfg))
        {
            gameObject.SetActive(true);

            Name.text = MCCfg.Name;

            if (MagicVal != null)
            {
                MagicVal.text = MCCfg.MagicVal.ToString();
            }

            if (Des != null)
            {
                Des.text = StringBuilderTool.ToInfoString("  ", MCCfg.Describe.Replace("\\n", "\n"));
                BoxCollider bc = Des.gameObject.GetComponent <BoxCollider>();
                if (bc != null)
                {
                    bc.center = new Vector3(Des.width / 2, -Des.height / 2, 0);
                    bc.size   = new Vector3(Des.width, Des.height, 0);
                }
                UITable tab = Des.transform.parent.GetComponent <UITable>();
                if (tab != null)
                {
                    tab.Reposition();
                    UIScrollView sv = tab.transform.parent.GetComponent <UIScrollView>();
                    if (sv != null)
                    {
                        sv.ResetPosition();
                    }
                }
            }

            if (Count != null)
            {
                Count.text = SerPlayerData.GetItemCount(MCCfg.CardID).ToString();
            }

            Icon.mainTexture = Resources.Load(StringBuilderTool.ToInfoString("MagicCard/", MCCfg.ColouredIcon)) as Texture;

            for (int i = 0; i < Star.Length; i++)
            {
                Star[i].spriteName = "c_t_star01";
                Star[i].gameObject.SetActive(i < MCCfg.StarLv);
            }


            if (MCCfg.ThemeID == 101)//恐龙世界
            {
                if (Title != null)
                {
                    Title.gameObject.SetActive(true);
                }
                if (LatinName != null)
                {
                    LatinName.gameObject.SetActive(true);
                }
                if (Epoch != null)
                {
                    Epoch.gameObject.SetActive(true);
                }
                if (Family != null)
                {
                    Family.gameObject.SetActive(true);
                }
                if (Weight != null)
                {
                    Weight.gameObject.SetActive(false);
                }
                if (Height != null)
                {
                    Height.gameObject.SetActive(true);
                }
                if (Habitat != null)
                {
                    Habitat.gameObject.SetActive(true);
                }
                if (Food != null)
                {
                    Food.gameObject.SetActive(true);
                }
                if (Satellite != null)
                {
                    Satellite.gameObject.SetActive(false);
                }
                if (Distance != null)
                {
                    Distance.gameObject.SetActive(false);
                }
                if (Temperature != null)
                {
                    Temperature.gameObject.SetActive(false);
                }
                if (Diameter != null)
                {
                    Diameter.gameObject.SetActive(false);
                }
                if (Day != null)
                {
                    Day.gameObject.SetActive(false);
                }
                if (Year != null)
                {
                    Year.gameObject.SetActive(false);
                }
                if (Time != null)
                {
                    Time.gameObject.SetActive(false);
                }
                if (Ruler != null)
                {
                    Ruler.gameObject.SetActive(false);
                }
            }
            else if (MCCfg.ThemeID == 102)//动物园
            {
                if (Title != null)
                {
                    Title.gameObject.SetActive(true);
                }
                if (LatinName != null)
                {
                    LatinName.gameObject.SetActive(true);
                }
                if (Epoch != null)
                {
                    Epoch.gameObject.SetActive(false);
                }
                if (Family != null)
                {
                    Family.gameObject.SetActive(false);
                }
                if (Weight != null)
                {
                    Weight.gameObject.SetActive(true);
                }
                if (Height != null)
                {
                    Height.gameObject.SetActive(true);
                }
                if (Habitat != null)
                {
                    Habitat.gameObject.SetActive(true);
                }
                if (Food != null)
                {
                    Food.gameObject.SetActive(true);
                }
                if (Satellite != null)
                {
                    Satellite.gameObject.SetActive(false);
                }
                if (Distance != null)
                {
                    Distance.gameObject.SetActive(false);
                }
                if (Temperature != null)
                {
                    Temperature.gameObject.SetActive(false);
                }
                if (Diameter != null)
                {
                    Diameter.gameObject.SetActive(false);
                }
                if (Day != null)
                {
                    Day.gameObject.SetActive(false);
                }
                if (Year != null)
                {
                    Year.gameObject.SetActive(false);
                }
                if (Time != null)
                {
                    Time.gameObject.SetActive(false);
                }
                if (Ruler != null)
                {
                    Ruler.gameObject.SetActive(false);
                }
            }
            else if (MCCfg.ThemeID == 103)//海洋世界
            {
                if (Title != null)
                {
                    Title.gameObject.SetActive(true);
                }
                if (LatinName != null)
                {
                    LatinName.gameObject.SetActive(true);
                }
                if (Epoch != null)
                {
                    Epoch.gameObject.SetActive(false);
                }
                if (Family != null)
                {
                    Family.gameObject.SetActive(false);
                }
                if (Weight != null)
                {
                    Weight.gameObject.SetActive(true);
                }
                if (Height != null)
                {
                    Height.gameObject.SetActive(true);
                }
                if (Habitat != null)
                {
                    Habitat.gameObject.SetActive(true);
                }
                if (Food != null)
                {
                    Food.gameObject.SetActive(true);
                }
                if (Satellite != null)
                {
                    Satellite.gameObject.SetActive(false);
                }
                if (Distance != null)
                {
                    Distance.gameObject.SetActive(false);
                }
                if (Temperature != null)
                {
                    Temperature.gameObject.SetActive(false);
                }
                if (Diameter != null)
                {
                    Diameter.gameObject.SetActive(false);
                }
                if (Day != null)
                {
                    Day.gameObject.SetActive(false);
                }
                if (Year != null)
                {
                    Year.gameObject.SetActive(false);
                }
                if (Time != null)
                {
                    Time.gameObject.SetActive(false);
                }
                if (Ruler != null)
                {
                    Ruler.gameObject.SetActive(false);
                }
            }
            else if (MCCfg.ThemeID == 201)//太阳系
            {
                if (Title != null)
                {
                    Title.gameObject.SetActive(true);
                }
                if (LatinName != null)
                {
                    LatinName.gameObject.SetActive(true);
                }
                if (Epoch != null)
                {
                    Epoch.gameObject.SetActive(false);
                }
                if (Family != null)
                {
                    Family.gameObject.SetActive(false);
                }
                if (Weight != null)
                {
                    Weight.gameObject.SetActive(false);
                }
                if (Height != null)
                {
                    Height.gameObject.SetActive(false);
                }
                if (Habitat != null)
                {
                    Habitat.gameObject.SetActive(false);
                }
                if (Food != null)
                {
                    Food.gameObject.SetActive(false);
                }
                if (Satellite != null)
                {
                    Satellite.gameObject.SetActive(true);
                }
                if (Distance != null)
                {
                    Distance.gameObject.SetActive(true);
                }
                if (Temperature != null)
                {
                    Temperature.gameObject.SetActive(true);
                }
                if (Diameter != null)
                {
                    Diameter.gameObject.SetActive(true);
                }
                if (Day != null)
                {
                    Day.gameObject.SetActive(true);
                }
                if (Year != null)
                {
                    Year.gameObject.SetActive(true);
                }
                if (Time != null)
                {
                    Time.gameObject.SetActive(false);
                }
                if (Ruler != null)
                {
                    Ruler.gameObject.SetActive(false);
                }
            }
            else if (MCCfg.ThemeID == 601)//春节
            {
                if (Title != null)
                {
                    Title.gameObject.SetActive(false);
                }
                if (LatinName != null)
                {
                    LatinName.gameObject.SetActive(false);
                }
                if (Epoch != null)
                {
                    Epoch.gameObject.SetActive(false);
                }
                if (Family != null)
                {
                    Family.gameObject.SetActive(false);
                }
                if (Weight != null)
                {
                    Weight.gameObject.SetActive(false);
                }
                if (Height != null)
                {
                    Height.gameObject.SetActive(false);
                }
                if (Habitat != null)
                {
                    Habitat.gameObject.SetActive(false);
                }
                if (Food != null)
                {
                    Food.gameObject.SetActive(false);
                }
                if (Satellite != null)
                {
                    Satellite.gameObject.SetActive(false);
                }
                if (Distance != null)
                {
                    Distance.gameObject.SetActive(false);
                }
                if (Temperature != null)
                {
                    Temperature.gameObject.SetActive(false);
                }
                if (Diameter != null)
                {
                    Diameter.gameObject.SetActive(false);
                }
                if (Day != null)
                {
                    Day.gameObject.SetActive(false);
                }
                if (Year != null)
                {
                    Year.gameObject.SetActive(false);
                }
                if (Time != null)
                {
                    Time.gameObject.SetActive(true);
                }
                if (Ruler != null)
                {
                    Ruler.gameObject.SetActive(false);
                }
            }
            else if (MCCfg.ThemeID == 603)//星座
            {
                if (Title != null)
                {
                    Title.gameObject.SetActive(false);
                }
                if (LatinName != null)
                {
                    LatinName.gameObject.SetActive(true);
                }
                if (Epoch != null)
                {
                    Epoch.gameObject.SetActive(false);
                }
                if (Family != null)
                {
                    Family.gameObject.SetActive(false);
                }
                if (Weight != null)
                {
                    Weight.gameObject.SetActive(false);
                }
                if (Height != null)
                {
                    Height.gameObject.SetActive(false);
                }
                if (Habitat != null)
                {
                    Habitat.gameObject.SetActive(false);
                }
                if (Food != null)
                {
                    Food.gameObject.SetActive(false);
                }
                if (Satellite != null)
                {
                    Satellite.gameObject.SetActive(false);
                }
                if (Distance != null)
                {
                    Distance.gameObject.SetActive(false);
                }
                if (Temperature != null)
                {
                    Temperature.gameObject.SetActive(false);
                }
                if (Diameter != null)
                {
                    Diameter.gameObject.SetActive(false);
                }
                if (Day != null)
                {
                    Day.gameObject.SetActive(false);
                }
                if (Year != null)
                {
                    Year.gameObject.SetActive(false);
                }
                if (Time != null)
                {
                    Time.gameObject.SetActive(true);
                }
                if (Ruler != null)
                {
                    Ruler.gameObject.SetActive(true);
                }
            }

            if (Bg != null)
            {
                switch (MCCfg.Quality)
                {
                case 1:
                    Bg.spriteName = "lvbian";
                    break;

                case 2:
                    Bg.spriteName = "lanbian";
                    break;

                case 3:
                    Bg.spriteName = "zibian";
                    break;
                }
            }

            if (QualitySign != null)
            {
                switch (MCCfg.Quality)
                {
                case 1:
                    QualitySign.spriteName = "lvbiao";
                    break;

                case 2:
                    QualitySign.spriteName = "lanbiao";
                    break;

                case 3:
                    QualitySign.spriteName = "zibiao";
                    break;
                }
                QualitySign.MakePixelPerfect();
            }

            if (System != null)
            {
                ChapterConfig cc = null;
                if (CsvConfigTables.Instance.ChapterCsvDic.TryGetValue(MCCfg.SystemID, out cc))
                {
                    System.text = cc.Name;
                }
            }

            if (Theme != null)
            {
                GroupConfig gc = null;
                if (CsvConfigTables.Instance.GroupCsvDic.TryGetValue(MCCfg.ThemeID, out gc))
                {
                    Theme.text = gc.Name;
                }
            }

            if (Quality != null)
            {
                Quality.text = StringBuilderTool.ToInfoString(ArabicToChinese(MCCfg.Quality), "阶卡");
            }

            if (Epoch != null)
            {
                Epoch.text = MCCfg.Epoch;
            }

            if (Family != null)
            {
                Family.text = MCCfg.Family;
            }

            if (LatinName != null)
            {
                LatinName.text = MCCfg.LatinName;
            }

            if (Height != null)
            {
                Height.text = MCCfg.Height;
            }

            if (Habitat != null)
            {
                Habitat.text = MCCfg.Habitat;
            }

            if (Food != null)
            {
                Food.text = MCCfg.Food;
            }

            if (Weight != null)
            {
                if (MCCfg.Weight.Length == 0)
                {
                    Weight.gameObject.SetActive(false);
                }
                Weight.text = MCCfg.Weight;
            }

            if (Satellite != null)
            {
                if (MCCfg.Satellite.Length == 0)
                {
                    Satellite.gameObject.SetActive(false);
                }
                Satellite.text = MCCfg.Satellite;
            }

            if (Temperature != null)
            {
                if (MCCfg.Temperature.Length == 0)
                {
                    Temperature.gameObject.SetActive(false);
                }
                Temperature.text = MCCfg.Temperature;
            }

            if (Distance != null)
            {
                if (MCCfg.Distance.Length == 0)
                {
                    Distance.gameObject.SetActive(false);
                }
                Distance.text = MCCfg.Distance;
            }

            if (Diameter != null)
            {
                if (MCCfg.Diameter.Length == 0)
                {
                    Diameter.gameObject.SetActive(false);
                }
                Diameter.text = MCCfg.Diameter;
            }

            if (Day != null)
            {
                if (MCCfg.Day.Length == 0)
                {
                    Day.gameObject.SetActive(false);
                }
                Day.text = MCCfg.Day;
            }

            if (Year != null)
            {
                if (MCCfg.Year.Length == 0)
                {
                    Year.gameObject.SetActive(false);
                }
                Year.text = MCCfg.Year;
            }

            if (Time != null)
            {
                if (MCCfg.Time.Length == 0)
                {
                    Time.gameObject.SetActive(false);
                }
                Time.text = MCCfg.Time;
            }

            if (Title != null)
            {
                if (MCCfg.Title.Length == 0)
                {
                    Title.gameObject.SetActive(false);
                }
                Title.text = MCCfg.Title;
            }

            if (GetWayFromStage != null)
            {
                bool showShortcut = (MCCfg.Shortcut != 0);
                GetWayFromStage.gameObject.SetActive(showShortcut);
                if (showShortcut)
                {
                    StageConfig sc = null;
                    if (CsvConfigTables.Instance.StageCsvDic.TryGetValue(MCCfg.Shortcut, out sc))
                    {
                        GetWayFromStage.text = sc.Name;
                    }
                }
            }

            if (EnableCompound != null)
            {
                EnableCompound.SetActive(false);
            }

            if (NewSign != null)
            {
                NewSign.alpha = 0;
            }

            switch (MCCfg.StarLv)
            {
            case 1:
                Star[0].transform.localPosition = Vector3.zero;
                break;

            case 2:
                Star[0].transform.localPosition = new Vector3(-12, 0, 0);
                Star[1].transform.localPosition = new Vector3(12, 0, 0);
                break;

            case 3:
                Star[0].transform.localPosition = new Vector3(-24, 0, 0);
                Star[1].transform.localPosition = Vector3.zero;
                Star[2].transform.localPosition = new Vector3(24, 0, 0);
                break;

            case 4:
                Star[0].transform.localPosition = new Vector3(-36, 0, 0);
                Star[1].transform.localPosition = new Vector3(-12, 0, 0);
                Star[2].transform.localPosition = new Vector3(12, 0, 0);
                Star[3].transform.localPosition = new Vector3(36, 0, 0);
                break;

            case 5:
                break;
            }
        }
        else
        {
            gameObject.SetActive(false);
        }
    }
예제 #16
0
    public void OnClick()
    {
        GameApp.Instance.SoundInstance.PlaySe("button");
        Debug.Log("点击:" + Name.text);

        //if (MCCfg != null && GameApp.Instance.CardHoldCountLst[MCCfg.CardID] > 0)
        //{
        //GameApp.Instance.HomePageUI.MagicBookUI.FullCard.Show(MCCfg.CardID);

        //Debug.Log(Name.text);
        //}
        //else
        //{
        //GameApp.Instance.CommonHintDlg.OpenHintBox("请先收集到此魔卡后再查看详情!");
        //}
        if (GameApp.Instance.TravelUI != null)
        {
            if (GameApp.Instance.TravelUI.TravelSeafloor != null)
            {
                GameApp.Instance.TravelUI.TravelSeafloor.PutFishModelInScene(MCCfg);
            }
            return;
        }

        if (Price != null)
        {
            Debug.Log("显示购买确认");
            GameApp.Instance.HomePageUI.MarketUI.ShowPurchaseConfirmation(gameObject);
            return;
        }

        if (ExchangeLab != null)
        {
            Debug.Log("显示可换魔卡界面");
            GameApp.Instance.HomePageUI.MarketUI.ShowAbleExchangeCardLst(this);
            return;
        }

        if (Sel != null)
        {
            Debug.Log("选中待更换的魔卡");
            for (int i = 0; i < transform.parent.childCount; i++)
            {
                Transform child = transform.parent.GetChild(i);
                if (child.name == transform.name)
                {
                    continue;
                }

                UI_MagicCard mc = child.GetComponent <UI_MagicCard>();
                mc.ShowSelSign(false);
            }
            ShowSelSign(true);
            GameApp.Instance.HomePageUI.MarketUI.SelectExchangeCard(this);
            return;
        }

        if (EnableCompound != null && EnableCompound.activeSelf)
        {
            if (GameApp.Instance.HomePageUI != null)
            {
                GameApp.Instance.HomePageUI.MagicBookUI.ShowCompound(MCCfg.CardID);
            }
            else if (GameApp.Instance.TravelUI != null)
            {
                GameApp.Instance.TravelUI.MagicBookUI.ShowCompound(MCCfg.CardID);
            }
        }
        else
        {
            if (SerPlayerData.GetItemCount(MCCfg.CardID) > 0)
            {
                RemoveShowNewSignCardID(MCCfg.CardID);
                if (NewSign != null)
                {
                    NewSign.alpha = 0;
                }

                if (GameApp.Instance.HomePageUI != null)
                {
                    GameApp.Instance.HomePageUI.MagicBookUI.ShowCardDetails(MCCfg.CardID);
                }
                else if (GameApp.Instance.TravelUI != null)
                {
                    GameApp.Instance.TravelUI.MagicBookUI.ShowCardDetails(MCCfg.CardID);
                }
            }
            else
            {
                GameApp.Instance.CommonHintDlg.OpenHintBox("请先收集到此魔卡后再查看详情!");
            }
            //GameApp.Instance.CommonHintDlg.OpenHintBox(StringBuilderTool.ToInfoString("查看", FullName(), "的卡牌详情!"));
        }
    }
예제 #17
0
    public void OnClick_Purchase()
    {
        GameApp.Instance.SoundInstance.PlaySe("button");
        Debug.Log("点击【购买】");

        switch (CurType)
        {
        case 1:
        {
            uint Gold           = SerPlayerData.GetItemCount(1001);
            uint CommodityID    = 0;
            uint CommodityPrice = 0;

            UI_MagicCard     mc = CurCommodityObj.GetComponent <UI_MagicCard>();
            UI_CommodityItem ci = CurCommodityObj.GetComponent <UI_CommodityItem>();
            if (mc != null)
            {
                CommodityID    = (uint)mc.MCCfg.CardID;
                CommodityPrice = uint.Parse(mc.Price.text);
            }
            else if (ci != null)
            {
                CommodityID    = (uint)ci.ItemCfg.ItemID;
                CommodityPrice = uint.Parse(ci.Price.text);
            }
            else
            {
                return;
            }

            if (Gold >= CommodityPrice)
            {
                if (mc != null)
                {
                    mc.SetPurchased();

                    GameApp.SendMsg.GMOrder(StringBuilderTool.ToString("AddItem ", mc.MCCfg.CardID, " 1"));
                }
                else if (ci != null)
                {
                    ci.SetPurchased();

                    GameApp.SendMsg.GMOrder(StringBuilderTool.ToString("AddItem ", ci.ItemCfg.ItemID, " 1"));
                }

                TweenAlpha.Begin(PurchaseConfirmationRoot, 0.2f, 0).from = 1;

                GameApp.SendMsg.GMOrder(StringBuilderTool.ToString("AddItem 1001 ", -CommodityPrice));
            }
            else
            {
                ShowGoldCoinNotEnough();
            }
        }
        break;

        case 2:
            break;

        case 3:
        {
            UI_CommodityItem ci = CurCommodityObj.GetComponent <UI_CommodityItem>();
            if (ci != null)
            {
                if (GameApp.Instance.Platform != null && GameApp.Instance.LeSDKInstance != null)
                {
                    GameApp.Instance.Platform.CreateOrder(ci.GoodsID);
                }
            }
        }
        break;
        }
    }
예제 #18
0
    void CheckPrivilegeAward()
    {
        //GameApp.Instance.RollingNoticeDlg.AddRollingNotice("欢迎试玩《魔卡百科》Demo版本!");

        Dictionary <EPrivilegeType, int> PrivilegeLst = new Dictionary <EPrivilegeType, int>();

        PrivilegeLst.Add(EPrivilegeType.eMonth, 2001);
        PrivilegeLst.Add(EPrivilegeType.eSeason, 2002);
        PrivilegeLst.Add(EPrivilegeType.eYear, 2003);
        foreach (KeyValuePair <EPrivilegeType, int> pair in PrivilegeLst)
        {
            uint ItemCount = SerPlayerData.GetItemCount(pair.Value);
            if (ItemCount > 0)
            {
                string des       = "";
                uint   AccountID = SerPlayerData.GetAccountID();
                string awardKey  = "";
                switch (pair.Key)
                {
                case EPrivilegeType.eMonth:
                    des      = "月";
                    awardKey = StringBuilderTool.ToString(AccountID, "_Award_Month_", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                    break;

                case EPrivilegeType.eSeason:
                    des      = "季";
                    awardKey = StringBuilderTool.ToString(AccountID, "_Award_Season_", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                    break;

                case EPrivilegeType.eYear:
                    des      = "年";
                    awardKey = StringBuilderTool.ToString(AccountID, "_Award_Year_", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                    break;
                }

                if (!PlayerPrefs.HasKey(awardKey))
                {
                    PlayerPrefs.SetInt(awardKey, 1);

                    Dictionary <int, int> AwardItemDic = new Dictionary <int, int>();
                    switch (pair.Key)
                    {
                    case EPrivilegeType.eMonth:
                        AwardItemDic.Add(20002, 3);
                        AwardItemDic.Add(1001, 100);
                        AwardItemDic.Add(1003, 100);
                        break;

                    case EPrivilegeType.eSeason:
                        AwardItemDic.Add(20002, 4);
                        AwardItemDic.Add(1001, 200);
                        AwardItemDic.Add(1003, 200);
                        break;

                    case EPrivilegeType.eYear:
                        AwardItemDic.Add(20002, 5);
                        AwardItemDic.Add(1001, 300);
                        AwardItemDic.Add(1003, 300);
                        break;
                    }
                    foreach (KeyValuePair <int, int> pair2 in AwardItemDic)
                    {
                        GameApp.SendMsg.GMOrder(StringBuilderTool.ToString("AddItem ", pair2.Key, " ", pair2.Value));
                    }
                    GameApp.Instance.GetItemsDlg.OpenGetItemsBox(AwardItemDic);
                    GameApp.Instance.CommonHintDlg.OpenHintBox(StringBuilderTool.ToInfoString(des, "卡特权每日奖励!"));
                }
            }
        }
    }