コード例 #1
0
        private void CreateEditPanel(int slot, string fileName)
        {
            Transform t = GameMenu.CreatePanel(slot, editPanelPrefab, contentTransform).transform;

            t.FindChild("Name").GetComponent <Text>().text = fileName;
            t.FindChild("Button").GetComponent <Button>().onClick.AddListener(() => LoadEditorWithLevel(fileName));
        }
コード例 #2
0
        private void CreateDemoPanel(int slot, Demo demo)
        {
            Transform t = GameMenu.CreatePanel(slot, demoPanelPrefab, demoContentPanel.transform).transform;

            t.FindChild("Map").GetComponent <Text>().text    = demo.LevelName;
            t.FindChild("Time").GetComponent <Text>().text   = demo.TotalTickTime.ToTimeString();
            t.FindChild("Player").GetComponent <Text>().text = demo.PlayerName;

            t.FindChild("Button").GetComponent <Button>().onClick.AddListener(() => WorldInfo.info.PlayDemo(demo, false, false));
            t.FindChild("Remove").GetComponent <Button>().onClick.AddListener(demo.DeleteDemoFile);
        }
コード例 #3
0
        private void CreateDemoPanel(int slot, Demo demo)
        {
            Transform t       = GameMenu.CreatePanel(slot, demoPanelPrefab, demoContentPanel.transform).transform;
            MapData   demoMap = GameInfo.info.MapManager.GetMapById(demo.MapID);

            t.FindChild("Map").GetComponent <Text>().text    = demoMap.name;
            t.FindChild("Time").GetComponent <Text>().text   = demo.TotalTickTime.ToTimeString();
            t.FindChild("Player").GetComponent <Text>().text = demo.PlayerName;

            t.FindChild("Button").GetComponent <Button>().onClick.AddListener(() =>
            {
                loadingDemo = demo;
                GameMenu.SingletonInstance.AddWindow(Window.LOADING);
                SceneManager.sceneLoaded += LoadedDemoMap;
                GameInfo.info.MapManager.LoadMap(demoMap);
            });
            t.FindChild("Remove").GetComponent <Button>().onClick.AddListener(demo.DeleteDemoFile);
        }
コード例 #4
0
        private void LoadPlayableMaps()
        {
            contentTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 75f * defaultMapData.Count + 10f);

            int counter = 0;

            foreach (MapData map in defaultMapData)
            {
                string pb = "-";
                long   pbTime;
                Assert.IsNotNull(PlayerSave.current);
                if (PlayerSave.current.GetPersonalBest(map, out pbTime))
                {
                    pb = pbTime.ToTimeString();
                }
                GameObject panel = GameMenu.CreatePanel(counter, mapPanelPrefab, contentTransform);
                panel.GetComponent <MapPanel>().Set(counter++, map, pb);
            }
        }