Пример #1
0
    void Start()
    {
        targetData_LGSMB = new LinearGame_SameMatch_Basic_Data();
        targetData_LGSMI = new LinearGame_SameMatch_Intermediate_Data();
        targetData_LGSMA = new LinearGame_SameMatch_Advanced_Data();

        targetData_LGDMB = new LinearGame_DifferentMatch_Basic_Data();
        targetData_LGDMI = new LinearGame_DifferentMatch_Intermediate_Data();
        targetData_LGDMA = new LinearGame_DifferentMatch_Advanced_Data();

        targetData_LGPB = new LinearGame_Perception_Basic_Data();
        targetData_LGPI = new LinearGame_Perception_Intermediate_Data();
        targetData_LGPA = new LinearGame_Perception_Advanced_Data();

        targetData_LGEB = new LinearGame_Expression_Basic_Data();
        targetData_LGEI = new LinearGame_Expression_Intermediate_Data();
        targetData_LGEA = new LinearGame_Expression_Advanced_Data();



        // Create game data folder
        for (int i = 0; i < 12; i++)
        {
            if (!Directory.Exists(Application.persistentDataPath + "/" + (LevelType)i))
            {
                Directory.CreateDirectory(Application.persistentDataPath + "/" + (LevelType)i);
            }
        }

        RefreshLoadList();
    }
Пример #2
0
    public void LoadLevel()
    {
        if (currentLevelPrefab_LoadUI == null)
        {
            return;
        }

        string levelName = currentLevelPrefab_LoadUI.GetComponent <LevelData_Load>().levelName;

        switch (LevelModeToLoad)
        {
        case LevelType.LinearGame_SameMatch_Basic:
            targetData_LGSMB = SaveLoadManager.Load <LinearGame_SameMatch_Basic_Data>(levelName, encoding, LevelModeToLoad);
            break;

        case LevelType.LinearGame_SameMatch_Intermediate:
            targetData_LGSMI = SaveLoadManager.Load <LinearGame_SameMatch_Intermediate_Data>(levelName, encoding, LevelModeToLoad);
            break;

        case LevelType.LinearGame_SameMatch_Advanced:
            targetData_LGSMA = SaveLoadManager.Load <LinearGame_SameMatch_Advanced_Data>(levelName, encoding, LevelModeToLoad);
            break;


        case LevelType.LinearGame_DifferentMatch_Basic:
            targetData_LGDMB = SaveLoadManager.Load <LinearGame_DifferentMatch_Basic_Data>(levelName, encoding, LevelModeToLoad);
            break;

        case LevelType.LinearGame_DifferentMatch_Intermediate:
            targetData_LGDMI = SaveLoadManager.Load <LinearGame_DifferentMatch_Intermediate_Data>(levelName, encoding, LevelModeToLoad);
            break;

        case LevelType.LinearGame_DifferentMatch_Advanced:
            targetData_LGDMA = SaveLoadManager.Load <LinearGame_DifferentMatch_Advanced_Data>(levelName, encoding, LevelModeToLoad);
            break;


        case LevelType.LinearGame_Perception_Basic:
            targetData_LGPB = SaveLoadManager.Load <LinearGame_Perception_Basic_Data>(levelName, encoding, LevelModeToLoad);
            break;

        case LevelType.LinearGame_Perception_Intermediate:
            targetData_LGPI = SaveLoadManager.Load <LinearGame_Perception_Intermediate_Data>(levelName, encoding, LevelModeToLoad);
            break;

        case LevelType.LinearGame_Perception_Advanced:
            targetData_LGPA = SaveLoadManager.Load <LinearGame_Perception_Advanced_Data>(levelName, encoding, LevelModeToLoad);
            break;


        case LevelType.LinearGame_Expression_Basic:
            targetData_LGEB = SaveLoadManager.Load <LinearGame_Expression_Basic_Data>(levelName, encoding, LevelModeToLoad);
            break;

        case LevelType.LinearGame_Expression_Intermediate:
            targetData_LGEI = SaveLoadManager.Load <LinearGame_Expression_Intermediate_Data>(levelName, encoding, LevelModeToLoad);
            break;

        case LevelType.LinearGame_Expression_Advanced:
            targetData_LGEA = SaveLoadManager.Load <LinearGame_Expression_Advanced_Data>(levelName, encoding, LevelModeToLoad);
            break;
        }
    }