Esempio n. 1
0
    public void Level_Resume(float gameTime)
    {
        if (GO_LevelScript)
        {
            GameLevelProcessor processor = GO_LevelScript.GetComponent <GameLevelProcessor>();

            if (processor)
            {
                //Set resume flag and time
                processor.Resume(gameTime);
            }

            //and start
            GO_LevelScript.SetActive(true);

            isOn = true;
        }
    }
Esempio n. 2
0
    private string _fullFileNamePath = ""; //Default set from Start

    #endregion Fields

    #region Methods

    //////////////////////////////////////////
    public void LoadGameLevelData()
    {
        //Get file name from UI, parse, and set to file
        setFileName(GameLevelDataNameGen.getName(input_fileName.text));

        //Load from XML file
        GameLevelData = XMLSerialization.Deserialize<C_GameLevelData>(_fullFileNamePath);

        //Set level name to UI
        input_levelName.text = GameLevelData.m_levelName;

        //Pass to game level data to the processor
        script_gameLevelData = null;
        script_gameLevelData = GO_GameLevelProcessor.GetComponent<GameLevelProcessor>();
        if(script_gameLevelData != null)
        {
            script_gameLevelData.gameLevelData = GameLevelData;
        }
    }
Esempio n. 3
0
    //////////////////////////////////////////

    public void LoadGameLevelData()
    {
        //Get file name from UI, parse, and set to file
        setFileName(GameLevelDataNameGen.getName(input_fileName.text));

        //Load from XML file
        GameLevelData = XMLSerialization.Deserialize <C_GameLevelData>(_fullFileNamePath);

        //Set level name to UI
        input_levelName.text = GameLevelData.m_levelName;

        //Pass to game level data to the processor
        script_gameLevelData = null;
        script_gameLevelData = GO_GameLevelProcessor.GetComponent <GameLevelProcessor>();
        if (script_gameLevelData != null)
        {
            script_gameLevelData.gameLevelData = GameLevelData;
        }
    }
Esempio n. 4
0
    public void Level_Start()
    {
        if (GO_LevelScript)
        {
            if (!isOn)
            {
                GameLevelProcessor processor = GO_LevelScript.GetComponent <GameLevelProcessor>();

                if (processor)
                {
                    //Reset internal game processing flag and time
                    //   for fresh game level start
                    processor.Reset();
                }

                GO_LevelScript.SetActive(true);

                isOn = true;
            }
        }
    }
Esempio n. 5
0
    //////////////////////////////////////////
    //Get settings, set to GameLevelData, and save
    public void SaveGameLevelData()
    {
        GameLevelData = new C_GameLevelData();

        //Pull game level data from the processor
        script_gameLevelData = null;
        script_gameLevelData = GO_GameLevelProcessor.GetComponent<GameLevelProcessor>();
        if(script_gameLevelData != null)
        {
            //Get the settings from the various trigger arrays on the processor object
            GameLevelData = script_gameLevelData.gameLevelData;

            //Get Level Name from UI
            string levelName = input_levelName.text;
            GameLevelData.m_levelName = levelName;

            //Get file name from UI, parse, and set to file
            setFileName(GameLevelDataNameGen.getName(input_fileName.text));

            //Save to XML file
            XMLSerialization.Serialize<C_GameLevelData>(GameLevelData, _fullFileNamePath);
        }
    }
Esempio n. 6
0
    //////////////////////////////////////////

    //Get settings, set to GameLevelData, and save
    public void SaveGameLevelData()
    {
        GameLevelData = new C_GameLevelData();

        //Pull game level data from the processor
        script_gameLevelData = null;
        script_gameLevelData = GO_GameLevelProcessor.GetComponent <GameLevelProcessor>();
        if (script_gameLevelData != null)
        {
            //Get the settings from the various trigger arrays on the processor object
            GameLevelData = script_gameLevelData.gameLevelData;

            //Get Level Name from UI
            string levelName = input_levelName.text;
            GameLevelData.m_levelName = levelName;

            //Get file name from UI, parse, and set to file
            setFileName(GameLevelDataNameGen.getName(input_fileName.text));

            //Save to XML file
            XMLSerialization.Serialize <C_GameLevelData>(GameLevelData, _fullFileNamePath);
        }
    }