void Start() { text = GetComponent<MadText>(); int levelNumber = new MadLevelQuery() .ForGroup(MadLevel.currentGroupName) .OfLevelType(MadLevel.Type.Level) .CountLevels(); int unlocked = new MadLevelQuery() .ForGroup(MadLevel.currentGroupName) .OfLevelType(MadLevel.Type.Level) .CountUnlocked(); int starsTotal = new MadLevelQuery() .ForGroup(MadLevel.currentGroupName) .OfLevelType(MadLevel.Type.Level) .SelectProperty("star_1", "star_2", "star_3") .CountProperties(); int starsGained = new MadLevelQuery() .ForGroup(MadLevel.currentGroupName) .OfLevelType(MadLevel.Type.Level) .SelectProperty("star_1", "star_2", "star_3") .CountEnabled(); text.text = "Levels: " + levelNumber + ", Unlocked: " + unlocked + "\nStars: " + starsTotal + ", Acquired: " + starsGained; }
// =========================================================== // Methods for/from SuperClass/Interfaces // =========================================================== protected new void OnEnable() { base.OnEnable(); panel = serializedObject.FindProperty("panel"); font = serializedObject.FindProperty("font"); atlas = serializedObject.FindProperty("atlas"); text = serializedObject.FindProperty("text"); scale = serializedObject.FindProperty("scale"); letterSpacing = serializedObject.FindProperty("letterSpacing"); align = serializedObject.FindProperty("align"); wordWrap = serializedObject.FindProperty("wordWrap"); wordWrapLength = serializedObject.FindProperty("wordWrapLength"); showLiveBounds = false; madText = (MadText) target; UpdateTextureGUID(); }
// =========================================================== // Methods for/from SuperClass/Interfaces // =========================================================== protected new void OnEnable() { base.OnEnable(); panel = serializedObject.FindProperty("panel"); font = serializedObject.FindProperty("font"); atlas = serializedObject.FindProperty("atlas"); text = serializedObject.FindProperty("text"); scale = serializedObject.FindProperty("scale"); letterSpacing = serializedObject.FindProperty("letterSpacing"); align = serializedObject.FindProperty("align"); wordWrap = serializedObject.FindProperty("wordWrap"); wordWrapLength = serializedObject.FindProperty("wordWrapLength"); showLiveBounds = false; madText = (MadText)target; UpdateTextureGUID(); }