Exemplo n.º 1
0
    void IniButtonItemEvent()
    {
        NextButton    = UISettingManager.GetUIObject("NextButton").transform;
        PriviosButton = UISettingManager.GetUIObject("PreviousButton").transform;
        int index = 0;

        foreach (Button item in GameItemsRoot.GetComponentsInChildren <Button>())
        {
            Text nameText = item.transform.Find("name").GetComponent <Text>();
            //  nameText.text = jsonTestData.instance.gameItemList[index].name;

            item.onClick.AddListener(delegate() { GameItemClick(item.transform); });
            index++;
        }
        int num = 0;

        foreach (Button item in GameLauncher.GetComponentsInChildren <Button>())
        {
            Text nameText = item.transform.Find("name").GetComponent <Text>();
            // nameText.text = jsonTestData.instance.gameItemList[num].name;
            item.onClick.AddListener(delegate() { GameItemClick(item.transform); });
            num++;
        }

        UISettingManager.AddButtonClickListener("NextButton", NextGamePage);
        UISettingManager.AddButtonClickListener("PreviousButton", PriviousGamePage);
    }
Exemplo n.º 2
0
    void Start()
    {
        gameRoot            = UISettingManager.GetUIObject("GameRoot");
        GameDetail          = UISettingManager.GetUIObject("GameDetail");
        GameTop             = UISettingManager.GetUIObject("GameTop");
        GameLauncher        = UISettingManager.GetUIObject("GameLauncher");
        GameItemsList       = UISettingManager.GetUIObject("GameItemsList");
        GameItemsRoot       = UISettingManager.GetUIObject("GameItemsRoot");
        backImage           = UISettingManager.GetUIObject("BackImage").transform;
        GameRecommendButton = UISettingManager.GetUIObject("GameRecommendButton").transform;
        AllGameButton       = UISettingManager.GetUIObject("AllGameButton").transform;
        BackGameButton      = UISettingManager.GetUIObject("BackGameButton").transform;
        GamePageText        = UISettingManager.GetUIObject("GamePageText").GetComponent <Text>();
        GameDetailName      = UISettingManager.GetUIObject("GameDetailName").GetComponent <Text>();
        GamePageText.text   = GameData.CurrentPages + 1 + "/" + GameData.gameTotalPages.ToString();


        IniButtonItemEvent();

        gameRoot.SetActive(false);
        GameDetail.SetActive(false);
        GameTop.SetActive(true);
        GameLauncher.SetActive(true);
        GameItemsList.SetActive(false);


        BackGameButton.GetComponent <Button>().onClick.AddListener(delegate() { TopGameButtonEvent(BackGameButton); });
        GameRecommendButton.GetComponent <Button>().onClick.AddListener(delegate() { TopGameButtonEvent(GameRecommendButton); });
        AllGameButton.GetComponent <Button>().onClick.AddListener(delegate() { TopGameButtonEvent(AllGameButton); });
    }