Exemplo n.º 1
0
    void AllGameAward()
    {
        if (currentIndex == 0)
        {
            return;
        }
        currentIndex = 0;
        ClearAllAward();
        foreach (SpriteRenderer sr in AllBtn.GetComponentsInChildren <SpriteRenderer>())
        {
            sr.color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
        }
        foreach (SpriteRenderer sr in Game1Btn.GetComponentsInChildren <SpriteRenderer>())
        {
            sr.color = new Color(1.0f, 1.0f, 1.0f, 0.3f);
        }
        foreach (SpriteRenderer sr in Game2Btn.GetComponentsInChildren <SpriteRenderer>())
        {
            sr.color = new Color(1.0f, 1.0f, 1.0f, 0.3f);
        }
        foreach (SpriteRenderer sr in Game3Btn.GetComponentsInChildren <SpriteRenderer>())
        {
            sr.color = new Color(1.0f, 1.0f, 1.0f, 0.3f);
        }
        foreach (SpriteRenderer sr in Game4Btn.GetComponentsInChildren <SpriteRenderer>())
        {
            sr.color = new Color(1.0f, 1.0f, 1.0f, 0.3f);
        }
        foreach (SpriteRenderer sr in Game5Btn.GetComponentsInChildren <SpriteRenderer>())
        {
            sr.color = new Color(1.0f, 1.0f, 1.0f, 0.3f);
        }
        foreach (SpriteRenderer sr in Game6Btn.GetComponentsInChildren <SpriteRenderer>())
        {
            sr.color = new Color(1.0f, 1.0f, 1.0f, 0.3f);
        }

        //create allGameAward
        //get AllAwardData
        awardList = dbs.allGameData;
        int i = 0;

        foreach (AwardItemData item in awardList)
        {
            GameObject obj = (GameObject)GameObject.Instantiate(awardPrefabs);
            obj.transform.parent = this.transform;
            obj.GetComponent <AwardItem>().SetupAward(i, AwardHeight, item.title, item.progress, item.max, item.AwardDetail);
            i++;
        }
        BG.setHeight(AwardHeight * i);
        list.ListHeight = AwardHeight * i;
    }
Exemplo n.º 2
0
 void AllGameRanking()
 {
     if (currentIndex == 0)
     {
         return;
     }
     currentIndex = 0;
     foreach (SpriteRenderer sr in AllBtn.GetComponentsInChildren <SpriteRenderer>())
     {
         sr.color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
     }
     foreach (SpriteRenderer sr in Game1Btn.GetComponentsInChildren <SpriteRenderer>())
     {
         sr.color = new Color(1.0f, 1.0f, 1.0f, 0.3f);
     }
     foreach (SpriteRenderer sr in Game2Btn.GetComponentsInChildren <SpriteRenderer>())
     {
         sr.color = new Color(1.0f, 1.0f, 1.0f, 0.3f);
     }
     foreach (SpriteRenderer sr in Game3Btn.GetComponentsInChildren <SpriteRenderer>())
     {
         sr.color = new Color(1.0f, 1.0f, 1.0f, 0.3f);
     }
     foreach (SpriteRenderer sr in Game4Btn.GetComponentsInChildren <SpriteRenderer>())
     {
         sr.color = new Color(1.0f, 1.0f, 1.0f, 0.3f);
     }
     foreach (SpriteRenderer sr in Game5Btn.GetComponentsInChildren <SpriteRenderer>())
     {
         sr.color = new Color(1.0f, 1.0f, 1.0f, 0.3f);
     }
     foreach (SpriteRenderer sr in Game6Btn.GetComponentsInChildren <SpriteRenderer>())
     {
         sr.color = new Color(1.0f, 1.0f, 1.0f, 0.3f);
     }
     CreateRankList(gLoader.rankingList, 0);
 }