using System.Linq;
using UnityEditor;
using UnityEngine;
namespace Unity.Tutorials.Core.Editor
{
///
/// A set of common utilities that tutorial authors can use as callbacks.
/// Callback functions need to be public instance methods.
///
// Enable the following line temporarily if you need to create an instance of this.
//[CreateAssetMenu(fileName = "CommonTutorialCallbacksHandler", menuName = "Tutorials/CommonTutorialCallbacksHandler")]
public class CommonTutorialCallbacks : ScriptableObject
{
///
/// Mutes or unmutes the editor audio.
///
/// Will the editor audio be muted.
public void SetAudioMasterMute(bool mute)
{
EditorUtility.audioMasterMute = mute;
}
///
/// Highlights a folder/asset in the Project window.
///
/// All paths are relative to the project folder, examples:
/// - "Assets/Hello.png"
/// - "Packages/com.unity.somepackage/Hello.png"
///
public void PingFolderOrAsset(string folderPath)
{
// Null/empty/invalid paths are handled without problems
EditorGUIUtility.PingObject(AssetDatabase.LoadAssetAtPath