示例#1
0
        public void LoadLevelFromDropdown()
        {
            Dropdown cbx = GameObject.Find("drpLoad").GetComponent <Dropdown>();

            currentLevel.Destroy();
            currentLevel = SerializedGameLevels.getLevel(cbx.options[cbx.value].text);
        }
示例#2
0
        // Use this for initialization
        void Start()
        {
            Game.game.Initialize();
            Init();

            currentLevel = SerializedGameLevels.getLevel("testlevel");
        }
示例#3
0
        public void CreateNew()
        {
            SerializedGameLevel gl = new SerializedGameLevel();

            gl.crtSettings_id = "crt";
            gl.mapName        = GameObject.Find("inpMapName").GetComponent <InputField>().text;
            gl.name           = GameObject.Find("inpNewName").GetComponent <InputField>().text;

            Map2D map = new Map2D();
            int   x   = int.Parse(GameObject.Find("inpX").GetComponent <InputField>().text);
            int   y   = int.Parse(GameObject.Find("inpY").GetComponent <InputField>().text);

            map.Create(x, y);
            Map2D.Save(map, gl.mapName);

            SerializedGameLevels.gameLevels.levels.Add(gl);
            SaveAll();

            currentLevel.Destroy();
            currentLevel = SerializedGameLevels.getLevel(gl.name);
        }