Skip to content

Instantly share code, notes, and snippets.

@eka
Created April 17, 2018 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eka/4e1917e98d5d86e3c097fe8eb8d96c61 to your computer and use it in GitHub Desktop.
Save eka/4e1917e98d5d86e3c097fe8eb8d96c61 to your computer and use it in GitHub Desktop.
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