Hi. I would like to ask if anyone has ever had a problem with a custom node working in Unity Visual Scripting?
There is no more information about it in the documentation. I seem to have done everything correctly.
In the editor everything works as it should. When I do a build for the android platform, there is a problem with the deserialization of the custom node.
Logcat shows a warning:
2023.05.04 22:26:00.122 29842 29941 Warn Unity [Deserialization] Type definition for 'WaitForFinishCoroutine' is missing.
2023.05.04 22:26:00.122 29842 29941 Warn Unity Converted 'WaitForFinishCoroutine' unit to 'Unity.VisualScripting.MissingType'. Did you delete the type's script file?
2023.05.04 22:26:00.122 29842 29941 Warn Unity Unity.VisualScripting.Serialization:HandleResult(String, fsResult, Object)
2023.05.04 22:26:00.122 29842 29941 Warn Unity Unity.VisualScripting.Serialization:smile:eserializeJson(fsSerializer, String, Object&, Boolean)
2023.05.04 22:26:00.122 29842 29941 Warn Unity Unity.VisualScripting.Serialization:smile:eserializeInto(SerializationData, Object&, Boolean)
2023.05.04 22:26:00.122 29842 29941 Warn Unity Unity.VisualScripting.LudiqScriptableObject:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize()
Here is node code:
[UnitCategory("Time")]
public class WaitForFinishCoroutine : WaitUnit
{
[DoNotSerialize]
public ValueInput Input { get; set; }
[DoNotSerialize]
[PortLabelHidden]
[NullMeansSelf]
public ValueInput InputMonoBehaviour { get; set; }
protected override void Definition()
{
base.Definition();
Input = ValueInput<IEnumerator>(nameof(Input));
InputMonoBehaviour = ValueInput<MonoBehaviour>(nameof(InputMonoBehaviour), null).NullMeansSelf();
}
protected override IEnumerator Await(Flow flow)
{
yield return flow.GetValue<MonoBehaviour>(this.InputMonoBehaviour).StartCoroutine(flow.GetValue<IEnumerator>(this.Input));
yield return this.exit;
}
}