YarnSpinnerTool / YarnSpinner-Unity

The official Unity integration for Yarn Spinner, the friendly dialogue tool.
MIT License
522 stars 91 forks source link

Can not access Nodes property #274

Open NSFriend opened 8 months ago

NSFriend commented 8 months ago

Can not access Nodes property as get the following error

CS0012: The type 'MapField<,>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Yarn.Google.Protobuf, Version=3.15.0.0, Culture=neutral, PublicKeyToken=null'.

I try to access as follows: runner.yarnProject.Program.Nodes

McJones commented 8 months ago

The nodes inside of the program (and all of the program class) are protobuf data types and are not really intended to be accessed directly.

Can I ask why you are trying to get access to them? Because we have wrapped the most common uses of the data without having to delve into the internals directly.

If you are after all nodes on the YarnProject class there is a NodeNames property which returns all node names. If you are after headers for a node again on YarnProject GetHeaders(nodeName) method will return all headers on a particular node. If you want initial values, the InitialValues property provides this. Finally if you want line IDs, the GetLineIDsForNodes method will let you get these.

NSFriend commented 8 months ago

Hello @McJones Thank you for explanation Actually I wanted to access all commands list inside each node somehow.

Like somehow to parse current node on its start and see what commands will this node call.