Created
April 17, 2018 11:25
-
-
Save estebanfeldman/4e1917e98d5d86e3c097fe8eb8d96c61 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using Sirenix.OdinInspector; | |
using Sirenix.OdinInspector.Editor; | |
using Sirenix.Utilities; | |
using Sirenix.Utilities.Editor; | |
using UnityEditor; | |
using UnityEngine; | |
public class TutorialSavedEditorWindow : OdinEditorWindow | |
{ | |
[MenuItem("Tools/Catch The Mantra/Tutorial Played")] | |
private static void OpenWindow() | |
{ | |
var window = GetWindow<TutorialSavedEditorWindow>(); | |
// Nifty little trick to quickly position the window in the middle of the editor. | |
window.position = GUIHelper.GetEditorWindowRect().AlignCenter(400, 200); | |
} | |
public bool HasPlayerDoneTutorial; | |
// Horizontal Group also has supprot for: Title, MarginLeft, MarginRight, PaddingLeft, PaddingRight, MinWidth and MaxWidth. | |
[HorizontalGroup("Read Tutorial Values", MarginLeft = 0.25f, MarginRight = 0.25f)] | |
public void ReadTutorialValues() | |
{ | |
if (ES3.KeyExists(TutorialManager.HasPlayerDoneTutorialKey)) | |
{ | |
HasPlayerDoneTutorial = ES3.Load<bool>(TutorialManager.HasPlayerDoneTutorialKey); | |
} | |
} | |
[HorizontalGroup("Write RateUs Values", MarginLeft = 0.25f, MarginRight = 0.25f)] | |
public void WriteTutorialValues() | |
{ | |
ES3.Save<bool>(TutorialManager.HasPlayerDoneTutorialKey, HasPlayerDoneTutorial); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment