示例#1
0
        // Use this for initialization
        void Start()
        {
            levelCount        = LevelLoader.LevelCount;//从levelloader中得到关卡总数量;
            levelRecordLoader = LevelRecordLoader.GetInstance();
            levelInformation  = new List <LevelInformation>();
            onePageCount      = (uint)buttonCollect.Length;


            //初始化关卡信息
            for (uint i = 0; i < levelCount; i++)
            {
                string         name   = LevelLoader.GetName(i);            //得到名字
                Nullable <int> record = levelRecordLoader.GetMaxRecord(i); //得到record
                levelInformation.Add(new LevelInformation(name, record));
            }

            nextChallengeLevelIndex = GetnextChallengeLevelIndex();
            page = 0;
            Refresh();

            //对按钮的消息进行绑定
            for (int i = 0; i < onePageCount; i++)
            {
                Transform target = buttonCollect[i].transform;
                buttonCollect[i].GetComponent <Button>().onClick.AddListener(
                    () => HandlerNotification(target)
                    );
            }
        }
示例#2
0
    // Use this for initialization
    void Start()
    {
        levelCount        = LevelLoader.LEVELRANGE;//从levelloader中得到关卡总数量;
        levelRecordLoader = new LevelRecordLoader(levelCount);
        levelInformation  = new List <LevelInformation>();
        onePageCount      = (uint)buttonCollect.Length;


        //初始化关卡信息
        for (uint i = 0; i < levelCount; i++)
        {
            string         name   = LevelLoader.GetName(i);            //得到名字
            Nullable <int> record = levelRecordLoader.GetMaxRecord(i); //得到record
            levelInformation.Add(new LevelInformation(name, record));
        }

        nextChallengeLevelIndex = GetnextChallengeLevelIndex();
        page = 0;
        Refresh();

        //对按钮的消息进行绑定
        for (int i = 0; i < onePageCount; i++)
        {
            Transform target = buttonCollect[i].transform;
            buttonCollect[i].GetComponent <Button>().onClick.AddListener(() => { HandlerNotification(target); });
        }


        gameObject.SetActive(false);//因为startmenu菜单有要调用本菜单的函数的情况,所以,一定要保证在ide中selectmenu是可用的。在这里进行关闭
    }