コード例 #1
0
ファイル: MadLevelProperty.cs プロジェクト: MatSe91/Lightbeam
    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;
        }
    }
コード例 #2
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
    }
コード例 #3
0
 public void SetBoolean(bool val) {
     ProcessProperties((levelName, propertyName, v) => {
         MadLevelProfile.SetLevelBoolean(levelName, propertyName, val);
     });
 }