23 lines
654 B
C#
23 lines
654 B
C#
#if UNITY_EDITOR
|
|
|
|
using Blocks4u.Runtime;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
|
|
namespace Blocks4u.Editor
|
|
{
|
|
[CustomEditor(typeof(BlocklyLogicBehaviour), true)]
|
|
public class BlocklyLogicEditor : UnityEditor.Editor
|
|
{
|
|
public override void OnInspectorGUI()
|
|
{
|
|
if (GUILayout.Button("Open Editor"))
|
|
{
|
|
var script = MonoScript.FromMonoBehaviour((MonoBehaviour) serializedObject.targetObject);
|
|
Application.OpenURL($"{ServerHolder.Server.URL}index.html?script={AssetDatabase.GetAssetPath(script)}&token={ServerHolder.Server.SessionToken}");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#endif |