Exemple #1
0
    /*构造*/
    private GameData()
    {
        //NOTE : this is Test Init Here.、
//        Debug.Log("skill_____gamedata____重载");
        playerSkill        = new UDSkill();
        playerSkill.skills = new List <UDSkill.Skill>();
        for (int i = 0; i < 10; i++)
        {
            UDSkill.Skill skill = new UDSkill.Skill();
            skill.name  = "界面" + (i + 1);
            skill.level = 1;
            skill.desc  = "这是个牛逼的技能";
            playerSkill.skills.Add(skill);
        }
        playerleftButtons        = new UDBu();
        playerleftButtons.bulist = new List <UDBu.Bu>();
        for (int i = 0; i < 5; i++)
        {
            UDBu.Bu b = new UDBu.Bu();
            b.level = 1;
            b.name  = "<color=red>this:" + i + "</color>";
            playerleftButtons.bulist.Add(b);
            for (int j = 0; j < 2; j++)
            {
                UDBu.Bu bb = new UDBu.Bu();
                bb.level = 01;
                bb.name  = "<color=green>child" + j + "</color>";
                //  Debug.Log(playerleftButtons.bu_sub_list == null);
                b.bu_sub_list.Add(bb);
            }
        }
        playersolutions            = new SolutionItt();
        playersolutions.Solut_data = new List <SolutionItt.solut>();
        for (int i = 0; i < 6; i++)
        {
            SolutionItt.solut sss = new SolutionItt.solut();
            sss.name_main  = "DayDayUP" + i;
            sss.tture_main = Resources.Load("card_bg_big_" + i) as Texture;
            //sss.tture_out = "out" + i;
            playersolutions.Solut_data.Add(sss);
        }
    }
Exemple #2
0
    public override void Refresh()
    {
        down_panel_items.SetActive(false);
        down_panel.transform.localScale = Vector3.zero;
        down_panel.transform.DOScale(new Vector3(1, 1, 1), 0.5f);
        SolutionItt Solut = this.data != null ? this.data as SolutionItt : GameData.Instance.playersolutions;

        for (int i = 0; i < Solut.Solut_data.Count; i++)
        {
            GameObject g = GameObject.Instantiate(down_panel_items) as GameObject;
            g.SetActive(true);
            g.transform.Find("ProductNameText").GetComponent <Text>().text = Solut.Solut_data[i].name_main;
            g.transform.localPosition = Vector3.zero;
            g.transform.SetParent(down_panel_items.transform.parent);
            GameObject gg   = g.transform.Find("OutImage/InImage").gameObject;
            Image      imag = gg.GetComponent <Image>();
            imag.preserveAspect = true;
            Texture2D t2d = Solut.Solut_data[i].tture_main as Texture2D;
            // imag.overrideSprite = Sprite.Create(t2d, new Rect(new Vector2(0, 0)
            //    ,new Vector2(Solut.Solut_data[i].tture_main.width,Solut.Solut_data[i].tture_main.height)),new Vector2(0.5f,0.5f));
            gg.AddComponent <SolutionData>();
            gg.AddComponent <Button>().onClick.AddListener(Status);
        }
    }