Exemple #1
0
    void ChangeSceneForNew()
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Open(deviceFileLocation, FileMode.Open);
        PlayerSlotData  data = (PlayerSlotData)bf.Deserialize(file);

        file.Close();

        data.slotType   = notEmptySlot;
        data.maxMap     = GameStructure.maxMap;
        data.mapResults = new MapResultData[GameStructure.maxMap];
        data.onLevel    = GameStructure.startLevel;
        for (int i = 0; i < data.mapResults.Length; i++)
        {
            data.mapResults[i] = new MapResultData();
        }
        data.speed = SharedData.basicSpeed;
        FileStream fileForSave = File.Create(deviceFileLocation);

        bf.Serialize(fileForSave, data);
        fileForSave.Close();

        for (int i = 0; i < GameStructure.maxMap; i++)
        {
            gmdata.Add(new MapResultData());
        }
        CurrentGameDatas.savedSpeed = SharedData.basicSpeed;
        CurrentGameDatas.speed      = SharedData.basicSpeed;
        CurrentGameDatas.CopyTheDatas(gmdata, deviceFileLocation);
        SceneLoader.LoadGuideAndSetMode();
    }
Exemple #2
0
 public void LoadSceneAndSaveSpeed()
 {
     if (CurrentGameDatas.savedSpeed != CurrentGameDatas.speed)
     {
         CurrentGameDatas.SaveSpeed();
     }
     SceneManager.LoadScene(GameStructure.GetLevelName());
 }
Exemple #3
0
 void ChangeSceneLoad()
 {
     CurrentGameDatas.savedSpeed = savedSpeed;
     CurrentGameDatas.speed      = savedSpeed;
     CurrentGameDatas.ItemCount  = summKeys + summGems + summRelic;
     CurrentGameDatas.CopyTheDatas(gmdata, deviceFileLocation);
     CurrentGameDatas.onLevel = onLevel;
     SceneLoader.LoadGuideAndSetMode();
 }
Exemple #4
0
 public void GoMyMap()
 {
     if (mapNumber != CurrentGameDatas.GetActualLevelLastMapNumber())
     {
         SceneLoader.LoadMapTimeScaleUsed(mapNumber);
     }
     else if (CurrentGameDatas.ItemCount >= CurrentGameDatas.GetActualLevelLastMapNumber() - 1)
     {
         SceneLoader.LoadMapTimeScaleUsed(mapNumber);
     }
 }
Exemple #5
0
 public override void ChangeLevel()
 {
     if (PreparLevel.SwitchLevelFromHigher)
     {
         return;
     }
     PreparLevel.SwitchLevelFromLower = true;
     CurrentGameDatas.onLevel++;
     CurrentGameDatas.SaveLevel();
     SceneManager.LoadScene(GameStructure.GetLevelName());
 }
Exemple #6
0
 void OpenGate(int i)
 {
     if (Gate.transform.childCount - 1 < i)
     {
         return;
     }
     if ((i + CurrentGameDatas.GetActualLevelFirstMapNumber() == ActualMapData.mapNumber - 1) && (ActualMapData.HawNewItem))
     {
         Gate.transform.GetChild(i).GetComponent <OpenGate>().OpenGateNew();
     }
     else
     {
         Gate.transform.GetChild(i).GetComponent <OpenGate>().OpenGateInstantly();
     }
 }
Exemple #7
0
    void Start()
    {
        Time.timeScale = SharedData.basicSpeed;

        if (levelUpButton != null && CurrentGameDatas.GetActualLevelLastMapNumber() <= CurrentGameDatas.ItemCount && CurrentGameDatas.onLevel != GameStructure.maxLevel)
        {
            levelUpButton.interactable = true;
        }

        int mapsNumber = CurrentGameDatas.GetActualLevelMapCount();

        int firstLevelNumber = CurrentGameDatas.GetActualLevelFirstMapNumber();
        int j = 0;

        for (int i = firstLevelNumber; i < firstLevelNumber + mapsNumber; i++)
        {
            gmdatas.Add(new MapResultData(CurrentGameDatas.mapDatas[i].Score, CurrentGameDatas.mapDatas[i].Scarab, CurrentGameDatas.mapDatas[i].Item, CurrentGameDatas.mapDatas[i].ItemType));
            if (CurrentGameDatas.mapDatas[i].Item == SharedData.HaveItemNumber)
            {
                if (CurrentGameDatas.mapDatas[i].ItemType == SharedData.KeyType)
                {
                    KeySpam(j);
                }
                else if (CurrentGameDatas.mapDatas[i].ItemType == SharedData.GemType)
                {
                    GemSpam(j);
                }
                else
                {
                    RelicSpam(j);
                }
                OpenGate(j);
            }
            j++;
        }

        ScoreMake();

        EndCheck();
    }