testss
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Descriptor(typeof(CustomEvent))]
|
||||
public class CustomEventDescriptor : EventUnitDescriptor<CustomEvent>
|
||||
{
|
||||
public CustomEventDescriptor(CustomEvent @event) : base(@event) { }
|
||||
|
||||
protected override string DefinedSubtitle()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
|
||||
{
|
||||
base.DefinedPort(port, description);
|
||||
|
||||
var index = unit.argumentPorts.IndexOf(port as ValueOutput);
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
description.label = "Arg. " + index;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Descriptor(typeof(IEventUnit))]
|
||||
public class EventUnitDescriptor<TEvent> : UnitDescriptor<TEvent>
|
||||
where TEvent : class, IEventUnit
|
||||
{
|
||||
public EventUnitDescriptor(TEvent @event) : base(@event) { }
|
||||
|
||||
protected override string DefinedSubtitle()
|
||||
{
|
||||
return "Event";
|
||||
}
|
||||
|
||||
protected override IEnumerable<EditorTexture> DefinedIcons()
|
||||
{
|
||||
if (unit.coroutine)
|
||||
{
|
||||
yield return BoltFlow.Icons.coroutine;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Widget(typeof(IEventUnit))]
|
||||
public sealed class EventUnitWidget : UnitWidget<IEventUnit>
|
||||
{
|
||||
public EventUnitWidget(FlowCanvas canvas, IEventUnit unit) : base(canvas, unit) { }
|
||||
|
||||
protected override NodeColorMix baseColor => NodeColor.Green;
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
using UnityEditor;
|
||||
|
||||
namespace Unity.VisualScripting
|
||||
{
|
||||
[CustomEditor(typeof(GlobalMessageListener), true)]
|
||||
public class GlobalMessageListenerEditor : Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
EditorGUILayout.HelpBox("This component is automatically added to relay Unity messages to Bolt.", MessageType.Info);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
using UnityEditor;
|
||||
|
||||
namespace Unity.VisualScripting
|
||||
{
|
||||
[CustomEditor(typeof(MessageListener), true)]
|
||||
public class MessageListenerEditor : Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
EditorGUILayout.HelpBox("This component is automatically added to relay Unity messages to Bolt.", MessageType.Info);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Descriptor(typeof(TriggerCustomEvent))]
|
||||
public class TriggerCustomEventDescriptor : UnitDescriptor<TriggerCustomEvent>
|
||||
{
|
||||
public TriggerCustomEventDescriptor(TriggerCustomEvent trigger) : base(trigger) { }
|
||||
|
||||
protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
|
||||
{
|
||||
base.DefinedPort(port, description);
|
||||
|
||||
var index = unit.arguments.IndexOf(port as ValueInput);
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
description.label = "Arg. " + index;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user