test
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,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d86368fa2dad24d53acbed4e9df50329
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -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,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 19496281535914fd8a7a96092a40fa01
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -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,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59a20dbcb66df4db5ae49b183017d4ec
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -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 Visual Scripting.", MessageType.Info);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 55b2c0b7bf4f34c8d957d908911e5f4f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -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 Visual Scripting.", MessageType.Info);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80dec885f050a4915a36ab2aeba5754f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 60210ddff070d4317a631c12b354cd23
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user