public void SetCompleted(bool val) {
     var levelNames = GetLevelNames();
     for (int i = 0; i < levelNames.Count; ++i) {
         var levelName = levelNames[i];
         MadLevelProfile.SetCompleted(levelName, val);
     }
 }
Example #2
0
    void SetLevelBoolean(bool val)
    {
        string levelName = icon.level.name;

        switch (specialType)
        {
        case SpecialType.Regular:
            MadLevelProfile.SetLevelBoolean(levelName, name, val);
            break;

        case SpecialType.LevelNumber:
            MadDebug.Assert(false, "Level numbers are not persistent!");
            break;

        case SpecialType.Locked:
            MadLevelProfile.SetLocked(levelName, val);
            break;

        case SpecialType.Completed:
            MadLevelProfile.SetCompleted(levelName, val);
            break;

        default:
            MadDebug.Assert(false, "Unknown special type: " + specialType);
            break;
        }
    }
Example #3
0
    private void Execute()
    {
        // gain stars
        for (int i = 1; i <= starsCount; i++) // i = 1, 2, 3...
        {
            string starName = "star_" + i;    // this is the star property name
            MadLevelProfile.SetLevelBoolean(MadLevel.currentLevelName, starName, true);
        }

        // gain Water
        for (int i = 1; i <= starsCount; i++)
        {                                        // i = 1, 2, 3...
            string waterName = "Waterdrop_" + i; // this is the star property name
            MadLevelProfile.SetLevelBoolean(MadLevel.currentLevelName, waterName, true);
        }

        // complete level
        if (completeLevel)
        {
            MadLevelProfile.SetCompleted(MadLevel.currentLevelName, true);
        }

        // go back to level select screen
        MadLevel.LoadLevelByName("Select Level"); // name from level configuration
    }
Example #4
0
    void OnMouseDown()
    {
        Debug.Log("Level won", this);
        MadLevelProfile.SetCompleted(MadLevel.currentLevelName, true);

        MadLevelProfile.SetLevelInteger(MadLevel.currentLevelName, "score", points);

        MadLevel.LoadLevelByName("Level Select");
    }
    void CompleteAllLevels()
    {
        if (!CheckPlaying())
        {
            return;
        }

        var levelNames = MadLevel.GetAllLevelNames();

        foreach (var levelName in levelNames)
        {
            MadLevelProfile.SetCompleted(levelName, true);
        }

        MadLevel.ReloadCurrent();
    }