SecuenceNode.clearChilds C# (CSharp) Method

clearChilds() public method

public clearChilds ( ) : void
return void
    public void clearChilds()
    {
        foreach (ScriptableObject node in childs)
            if(Application.isEditor)
                ScriptableObject.DestroyImmediate (node);
            else
                ScriptableObject.Destroy (node);
        childs.Clear();
    }

Usage Example

Example #1
0
 public void draw()
 {
     EditorGUILayout.HelpBox("Select a content for this node" +
                             "or leave it empty to finish the secuence here.", MessageType.Info);
     if (Event.current.type != EventType.layout)
     {
         if (node.Childs.Length != 0)
         {
             node.clearChilds();
         }
     }
 }