2020-10-28 06:39:26 +11:00
|
|
|
|
using System;
|
|
|
|
|
using Mono.CSharp;
|
2021-03-25 18:39:35 +11:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using UnityExplorer.Core.Runtime;
|
2020-10-28 06:39:26 +11:00
|
|
|
|
|
2021-05-11 19:15:46 +10:00
|
|
|
|
namespace UnityExplorer.UI.CSharpConsole
|
2020-10-28 06:39:26 +11:00
|
|
|
|
{
|
|
|
|
|
public class ScriptInteraction : InteractiveBase
|
|
|
|
|
{
|
|
|
|
|
public static void Log(object message)
|
|
|
|
|
{
|
|
|
|
|
ExplorerCore.Log(message);
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-25 18:39:35 +11:00
|
|
|
|
public static void StartCoroutine(IEnumerator ienumerator)
|
|
|
|
|
{
|
2021-04-07 17:20:09 +10:00
|
|
|
|
RuntimeProvider.Instance.StartCoroutine(ienumerator);
|
2021-03-25 18:39:35 +11:00
|
|
|
|
}
|
|
|
|
|
|
2021-05-11 19:15:46 +10:00
|
|
|
|
public static void AddUsing(string directive)
|
|
|
|
|
{
|
|
|
|
|
CSConsole.AddUsing(directive);
|
|
|
|
|
}
|
2020-10-28 06:39:26 +11:00
|
|
|
|
|
2021-05-11 19:15:46 +10:00
|
|
|
|
public static void GetUsing()
|
|
|
|
|
{
|
|
|
|
|
ExplorerCore.Log(CSConsole.Evaluator.GetUsing());
|
|
|
|
|
}
|
2020-10-28 06:39:26 +11:00
|
|
|
|
|
2021-05-11 19:15:46 +10:00
|
|
|
|
public static void Reset()
|
|
|
|
|
{
|
|
|
|
|
CSConsole.ResetConsole();
|
|
|
|
|
}
|
2020-10-28 06:39:26 +11:00
|
|
|
|
|
2021-05-11 19:15:46 +10:00
|
|
|
|
public static object CurrentTarget()
|
|
|
|
|
{
|
|
|
|
|
return InspectorManager.ActiveInspector?.Target;
|
|
|
|
|
}
|
2020-10-28 06:39:26 +11:00
|
|
|
|
|
2021-05-11 19:15:46 +10:00
|
|
|
|
public static object[] AllTargets()
|
|
|
|
|
{
|
|
|
|
|
return InspectorManager.Inspectors.Select(it => it.Target).ToArray();
|
|
|
|
|
}
|
2020-10-28 06:39:26 +11:00
|
|
|
|
|
2021-05-11 19:15:46 +10:00
|
|
|
|
public static void Inspect(object obj)
|
|
|
|
|
{
|
|
|
|
|
InspectorManager.Inspect(obj);
|
|
|
|
|
}
|
2020-10-28 06:39:26 +11:00
|
|
|
|
|
2021-05-11 19:15:46 +10:00
|
|
|
|
public static void Inspect(Type type)
|
|
|
|
|
{
|
|
|
|
|
InspectorManager.Inspect(type);
|
|
|
|
|
}
|
2020-10-28 06:39:26 +11:00
|
|
|
|
}
|
|
|
|
|
}
|