コード例 #1
0
    void Awake()
    {
        myData = new AchievementsData();

        if (GameStateXML.IfFileExist("Achievements.xml"))
        {
            LoadData();
        }
        else
        {
            CreateFile();
        }

        int ndatos = myData.MessageStorage.Count;

        if (ndatos < 8)
        {
            scrollHeight = Screen.height;
        }
        if (ndatos >= 8 && ndatos < 15)
        {
            scrollHeight = Screen.height * 2;
        }
        if (ndatos >= 15)
        {
            scrollHeight = Screen.height * 3;
        }
    }
コード例 #2
0
 public void LoadAchievements()
 {
     _data = GameStateXML.LoadXML("Achievements.xml");
     if (_data.ToString() != "")
     {
         myAchievements = (AchievementsData)GameStateXML.DeserializeObject(_data, "AchievementsData");
     }
 }
コード例 #3
0
    /*
     * Achievementes Handle
     * */

    public void CreateAchievements()
    {
        myAchievements.MessageStorage.Add("Haz obtenido una semilla nueva!");

        // Time to creat our XML!
        _data = GameStateXML.SerializeObject(myAchievements, "AchievementsData");
        // This is the final resulting XML from the serialization process
        GameStateXML.CreateXML("Achievements.xml", _data);
    }
コード例 #4
0
    public void LoadData()
    {
        _data = GameStateXML.LoadXML("Configuration.xml");

        if (_data.ToString() != "")
        {
            myData = (PlantARData)GameStateXML.DeserializeObject(_data, "PlantARData");
        }
    }
コード例 #5
0
    public void LoadData()
    {
        _data = GameStateXML.LoadXML("Test.xml");

        if (_data.ToString() != "")
        {
            myData = (ManagerData)GameStateXML.DeserializeObject(_data, "ManagerData");
        }
    }
コード例 #6
0
    /// <summary>
    ///  XML 불러오는 함수
    /// </summary>
    public void LoadData()
    {
        LoadDBData();

        _data = GameStateXML.LoadXML(m_sXMLDataName);

        if (_data.ToString() != "")
        {
            myData = (ManagerData)GameStateXML.DeserializeObject(_data, "ManagerData");
        }
    }
コード例 #7
0
 public void CreateFile()
 {
     myData.currentLevel       = 1;
     myData.compostLevelHealth = 0;
     myData.sunLevelHealth     = 0;
     myData.waterLevelHealth   = 0;
     myData.plantName          = "Default";
     myData.playerName         = "Default";
     myData.plantarTime        = 0;
     myData.modelAuxChangeTime = 0;
     myData.waterAuxTime       = 0;
     myData.modelType          = 1;
     myData.notificationOn     = false;
     // Time to creat our XML!
     _data = GameStateXML.SerializeObject(myData, "PlantARData");
     // This is the final resulting XML from the serialization process
     GameStateXML.CreateXML("Configuration.xml", _data);
     Debug.Log(_data);
 }
コード例 #8
0
 /// <summary>
 /// XML 저장 함수
 /// </summary>
 public void SaveData()
 {
     _data = GameStateXML.SerializeObject(myData, "ManagerData");
     GameStateXML.CreateXML(m_sXMLDataName, _data);
 }
コード例 #9
0
 public void SaveAchievements()
 {
     _data = GameStateXML.SerializeObject(myAchievements, "AchievementsData");
     GameStateXML.CreateXML("Achievements.xml", _data);
 }
コード例 #10
0
 public void SaveData()
 {
     _data = GameStateXML.SerializeObject(myData, "PlantARData");
     GameStateXML.CreateXML("Configuration.xml", _data);
 }
コード例 #11
0
    //Once Run
    void Awake()
    {
        myData = new PlantARData();

        if (GameStateXML.IfFileExist("Configuration.xml"))
        {
            LoadData();
        }
        //CreateFile();
        else
        {
            CreateFile();
        }

        compostCount  = myData.compostLevelHealth;
        waterCount    = myData.waterLevelHealth;
        compostHealth = compostCount * 2f / 10f;
        sunHealth     = (float)(myData.sunLevelHealth * 2 / 10);
        waterHealth   = waterCount * 2f / 10f;

        if (ApplicationModel.firstTime)
        {
            initialTime = myData.plantarTime;
            ApplicationModel.initialTime = initialTime;
            ApplicationModel.firstTime   = false;
        }
        else
        {
            initialTime = ApplicationModel.initialTime;
        }

        nMessage             = 0;
        informationText.text = "";
        dialogText.text      = "";
        timerText.text       = "";
        timeReset            = false;
        animationHealth      = false;
        dialogPanel          = false;
        modelChange          = false;

        switch (myData.currentLevel)
        {
        case 0:
            dialogPanel = true;
            break;

        case 1:
            dialogPanel  = true;
            dialogButton = true;
            nMessage     = 1;
            break;

        case 2:
            dialogPanel  = true;
            dialogButton = true;
            nMessage     = 9;
            break;

        case 3:
            nMessage = 17;
            break;

        case 4:
            nMessage = 18;
            break;

        case 5:
            nMessage = 19;
            break;

        case 6:
            nMessage = 20;
            break;

        case 7:
            nMessage = 21;
            break;

        case 8:
            nMessage = 22;
            break;
        }

        /*ManageData();
         * SaveData();*/
        myAchievements = new AchievementsData();

        if (GameStateXML.IfFileExist("Achievements.xml"))
        {
            LoadAchievements();
        }
        else
        {
            CreateAchievements();
        }
    }
コード例 #12
0
 public void SaveData()
 {
     ManageData();
     _data = GameStateXML.SerializeObject(myData, "ManagerData");
     GameStateXML.CreateXML("Test.xml", _data);
 }