void Update() { if (resetOnRKey) { if (Input.GetKey(KeyCode.R)) { MadLevelProfile.Reset(); MadLevel.ReloadCurrent(); } } }
// =========================================================== // Methods for/from SuperClass/Interfaces // =========================================================== // =========================================================== // Methods // =========================================================== void Start() { var sprite = GetComponent <MadSprite>(); if (sprite != null) { sprite.onMouseEnter += (s) => sprite.AnimScaleTo(Vector3.one * 1.5f, 1, MadiTween.EaseType.easeOutElastic); sprite.onMouseExit += (s) => sprite.AnimScaleTo(Vector3.one, 1, MadiTween.EaseType.easeOutElastic); sprite.onMouseDown += sprite.onTap = (s) => { MadLevelProfile.Reset(); MadLevel.ReloadCurrent(); }; } }
void ResetProfile(string profile) { if (!CheckPlaying()) { return; } if (EditorUtility.DisplayDialog( "Reset Profile " + profile + "?", "Are you sure you want to reset profile '" + profile + "'? This cannot be undone.", "Yes", "No")) { string prevProfile = MadLevelProfile.profile; MadLevelProfile.profile = selectedProfileName; MadLevelProfile.Reset(); MadLevelProfile.profile = prevProfile; MadLevel.ReloadCurrent(); } }