Skip to main content
Version: 🚧 Work in Progress

Deleting Nodes

Jungle has strict rules for deleting node scripts due to limitations with the Unity asset database system. In Jungle, node instances are stored as sub-objects of tree instances. If a node’s script file is deleted outside Unity, the database won’t detect the change, leaving the node instances without valid script references.

This issue doesn’t cause functional problems but clutters the tree’s asset file, and Unity won’t let you remove the broken nodes. To address this, Jungle’s cleanup systems archive the node’s metadata, allowing recovery if the script file is reimported.

To avoid future headaches and confusion, it’s recommended to use the following methods.


There are two options for deleting node scripts.

  1. The easiest but most destructive method is to delete the script file via the Unity Editor’s Assets window.
  2. A safer, non-destructive alternative is to deprecate the node by setting the deprecated flag in the node options.

The best method for you is totally up to you. In cases where multiple people work on the same project, option two is likely best.

Delete via Unity Assets Window​

If you delete the node script file

Easiest but most destructive.

Deprecate Node Scripts​

Safest and most recommended approach.

Jungle is very strict about deleting node scripts. This is due to limitations with the Unity Asset Database and how it handles sub-assets. Jungle has safeguards in place to prevent nodes from losing metadata and serialized data when nodes go missing or are deleted via the file system.

NEVER DELETE NODE SCRIPTS VIA THE FILE SYSTEM

If you delete a node script from your file system, Jungle cannot detect the change and will not be able to perform important cleanup on your trees. This can create a ton of issues and is NEVER recommended.

There are two options for deleting nodes:

  1. Mark the node as deprecated
  2. Delete the node via the Assets window

Marking the Node as Deprecated​

The NodeProperties attribute has a Deprecated property that can be set to true. This will mark the node as deprecated and will remove it from the explorer and mark all instances of the node in the validator.

Steps

  1. Open the node script in your code editor.
  2. Add the Deprecated property to the NodeProperties attribute and set it to true.
using Jungle;

[NodeProperties(
Title = "My Node",
// ↓↓↓↓↓↓↓↓↓↓ ↓↓↓↓
Deprecated = true
)]
public class MyNode : IdentityNode
...

Deleting the Node via Assets Window​

Nodes can also be deleted like any other asset in Unity. This method is safe but is irreversible. If any instances of the node being deleted are found in any trees, Jungle will display a warning dialog to confirm the deletion.

Steps

  1. Locate the node script in the Assets window.
  2. Then you can either:
    • Press the Delete key on your keyboard while the node script is selected.
    • Right-click the node script and select Delete from the context menu.
warning

This method is IRREVERSIBLE and will permanently remove all instances of the deleted node from all trees. All connections, metadata, and serialized data will be lost.