Initial Commit
This commit is contained in:
parent
53eb92e9af
commit
270ab7d11f
15341 changed files with 700234 additions and 0 deletions
|
@ -0,0 +1,19 @@
|
|||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Descriptor(typeof(ForEach))]
|
||||
public class ForEachDescriptor : UnitDescriptor<ForEach>
|
||||
{
|
||||
public ForEachDescriptor(ForEach unit) : base(unit) { }
|
||||
|
||||
protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
|
||||
{
|
||||
base.DefinedPort(port, description);
|
||||
|
||||
if (unit.dictionary && port == unit.currentItem)
|
||||
{
|
||||
description.label = "Value";
|
||||
description.summary = "The value of the current item of the loop.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e391928ec26554bb6a8c432069d4d080
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
|
||||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Descriptor(typeof(SelectOnEnum))]
|
||||
public class SelectOnEnumDescriptor : UnitDescriptor<SelectOnEnum>
|
||||
{
|
||||
public SelectOnEnumDescriptor(SelectOnEnum unit) : base(unit) { }
|
||||
|
||||
protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
|
||||
{
|
||||
base.DefinedPort(port, description);
|
||||
|
||||
foreach (var branch in unit.branches)
|
||||
{
|
||||
if (branch.Value == port)
|
||||
{
|
||||
var enumValue = (Enum)branch.Key;
|
||||
|
||||
description.label = enumValue.DisplayName();
|
||||
description.summary = $"The value to return if the enum has the value '{enumValue}'.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5614a2afc93424562a0fb58331b6a01c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,34 @@
|
|||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Descriptor(typeof(SelectOnFlow))]
|
||||
public class SelectOnFlowDescriptor : UnitDescriptor<SelectOnFlow>
|
||||
{
|
||||
public SelectOnFlowDescriptor(SelectOnFlow unit) : base(unit) { }
|
||||
|
||||
protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
|
||||
{
|
||||
base.DefinedPort(port, description);
|
||||
|
||||
foreach (var branch in unit.branches)
|
||||
{
|
||||
if (port == branch.Key || port == branch.Value)
|
||||
{
|
||||
var index = int.Parse(port.key.PartAfter('_'));
|
||||
|
||||
var letter = ((char)('A' + index)).ToString();
|
||||
|
||||
description.label = letter;
|
||||
|
||||
if (port == branch.Key)
|
||||
{
|
||||
description.summary = $"Trigger to select the {letter} value.";
|
||||
}
|
||||
else if (port == branch.Value)
|
||||
{
|
||||
description.summary = $"The value to return if the {letter} control input is triggered.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b72ae9b40005d4cd7a962e49f92db497
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,13 @@
|
|||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Descriptor(typeof(SelectOnInteger))]
|
||||
public class SelectOnIntegerDescriptor : SelectUnitDescriptor<int>
|
||||
{
|
||||
public SelectOnIntegerDescriptor(SelectOnInteger unit) : base(unit) { }
|
||||
|
||||
protected override string GetLabelForOption(int option)
|
||||
{
|
||||
return option.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 219311327f63045b68b424f66c8738e5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,18 @@
|
|||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Descriptor(typeof(SelectOnString))]
|
||||
public class SelectOnStringDescriptor : SelectUnitDescriptor<string>
|
||||
{
|
||||
public SelectOnStringDescriptor(SelectOnString unit) : base(unit) { }
|
||||
|
||||
protected override string GetLabelForOption(string option)
|
||||
{
|
||||
if (string.IsNullOrEmpty(option))
|
||||
{
|
||||
return "Null / Empty";
|
||||
}
|
||||
|
||||
return $"\"{option}\"";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6694835c7830b4c9db815c971a6f014f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,28 @@
|
|||
namespace Unity.VisualScripting
|
||||
{
|
||||
public class SelectUnitDescriptor<T> : UnitDescriptor<SelectUnit<T>>
|
||||
{
|
||||
public SelectUnitDescriptor(SelectUnit<T> unit) : base(unit) { }
|
||||
|
||||
protected virtual string GetLabelForOption(T option)
|
||||
{
|
||||
return option.ToString();
|
||||
}
|
||||
|
||||
protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
|
||||
{
|
||||
base.DefinedPort(port, description);
|
||||
|
||||
foreach (var branch in unit.branches)
|
||||
{
|
||||
if (branch.Value == port)
|
||||
{
|
||||
var option = branch.Key;
|
||||
|
||||
description.label = GetLabelForOption(option);
|
||||
description.summary = $"The value to return if the enum has the value {GetLabelForOption(option)}.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 946af99fc6ca141dd8305988366f2969
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,23 @@
|
|||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Descriptor(typeof(Sequence))]
|
||||
public class SequenceDescriptor : UnitDescriptor<Sequence>
|
||||
{
|
||||
public SequenceDescriptor(Sequence unit) : base(unit) { }
|
||||
|
||||
protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
|
||||
{
|
||||
base.DefinedPort(port, description);
|
||||
|
||||
if (port is ControlOutput)
|
||||
{
|
||||
var index = unit.multiOutputs.IndexOf((ControlOutput)port);
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
description.label = index.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d6d39866c3a214bf18a1c85c0f926305
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,23 @@
|
|||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Descriptor(typeof(SwitchOnEnum))]
|
||||
public class SwitchOnEnumDescriptor : UnitDescriptor<SwitchOnEnum>
|
||||
{
|
||||
public SwitchOnEnumDescriptor(SwitchOnEnum unit) : base(unit) { }
|
||||
|
||||
protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
|
||||
{
|
||||
base.DefinedPort(port, description);
|
||||
|
||||
foreach (var branch in unit.branches)
|
||||
{
|
||||
if (branch.Value == port)
|
||||
{
|
||||
var enumValue = branch.Key;
|
||||
description.label = enumValue.DisplayName();
|
||||
description.summary = $"The action to execute if the enum has the value '{enumValue}'.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3691dc0753d9d43da89b6f14c3bc9e1b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,13 @@
|
|||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Descriptor(typeof(SwitchOnInteger))]
|
||||
public class SwitchOnIntegerDescriptor : SwitchUnitDescriptor<int>
|
||||
{
|
||||
public SwitchOnIntegerDescriptor(SwitchOnInteger unit) : base(unit) { }
|
||||
|
||||
protected override string GetLabelForOption(int option)
|
||||
{
|
||||
return option.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6aab8e864fb4d43b8a1e861ccca1bbe0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,18 @@
|
|||
namespace Unity.VisualScripting
|
||||
{
|
||||
[Descriptor(typeof(SwitchOnString))]
|
||||
public class SwitchOnStringDescriptor : SwitchUnitDescriptor<string>
|
||||
{
|
||||
public SwitchOnStringDescriptor(SwitchOnString unit) : base(unit) { }
|
||||
|
||||
protected override string GetLabelForOption(string option)
|
||||
{
|
||||
if (string.IsNullOrEmpty(option))
|
||||
{
|
||||
return "Null / Empty";
|
||||
}
|
||||
|
||||
return $"\"{option}\"";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 308bba4415a32497eac134cb5c638acc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,28 @@
|
|||
namespace Unity.VisualScripting
|
||||
{
|
||||
public class SwitchUnitDescriptor<T> : UnitDescriptor<SwitchUnit<T>>
|
||||
{
|
||||
public SwitchUnitDescriptor(SwitchUnit<T> unit) : base(unit) { }
|
||||
|
||||
protected virtual string GetLabelForOption(T option)
|
||||
{
|
||||
return option.ToString();
|
||||
}
|
||||
|
||||
protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
|
||||
{
|
||||
base.DefinedPort(port, description);
|
||||
|
||||
foreach (var branch in unit.branches)
|
||||
{
|
||||
if (branch.Value == port)
|
||||
{
|
||||
var option = branch.Key;
|
||||
|
||||
description.label = GetLabelForOption(option);
|
||||
description.summary = $"The action to execute if the selector has the value {GetLabelForOption(option)}.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7eb7fa2c8eaf44bdfa80d6353200c200
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue