LogicEditor | Node-Check for specific components not working as intended
Summary
Some nodes in our LogicEditor only work on specific figments, e.g. the Simple Video
node should only work on Logic Objects that contain a VideoPlayer
. Furthermore, we show managed messages when nodes are setup incorrectly. The method to check for needed components in a given logic object does not seem to work as intended. For example the Simple Video
node does not show a message when no VideoPlayer
is found, same for v0.4.2's Simple Text
node.
Steps to reproduce
Build a simple setup as shown in the screenshot below.
What is the current bug behavior?
In this figure ChangeThisText
is a LogicObject with a text component, Figment_Sphere
is not.
What is the expected correct behavior?
The Simple Text
node should show a manage message regarding the missing component.
Version
Tested in v0.4.2 [unreleased]
Build Target
N/A
Mode
In the LogicEditor
Relevant logs and/or screenshots
Relevant code snippet for the example of the Simple Video
node:
protected override void AddManagedMessages()
{
RemoveAllManagedMessages();
if(!HasGameObject())
return;
var t = n.LogicObjectPackageInProp?.GameObject?.transform ?? null;
if (!HasRequiredComponentsChildren(t, typeof(VideoPlayer))) // This check does not generate a managed message
return;
}
Possible fixes
Check the viability of our method to check components of gameobjects in logicobjects.