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; } }
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 }
public void SetBoolean(bool val) { ProcessProperties((levelName, propertyName, v) => { MadLevelProfile.SetLevelBoolean(levelName, propertyName, val); }); }