public void AddNode(Vector3 position, float width)
    {
        RiverNodeObject newRiverNodeObject = new RiverNodeObject();
        int nNodes;

        if(nodeObjects == null)
        {
            nodeObjects = new RiverNodeObject[0];
            nNodes = 1;
            newRiverNodeObject.position = position;
        }

        else
        {
            nNodes = nodeObjects.Length + 1;
            newRiverNodeObject.position = position;
        }

        RiverNodeObject[] newNodeObjects = new RiverNodeObject[nNodes];
        newRiverNodeObject.width = width;

        int n = newNodeObjects.Length;

        for (int i = 0; i < n; i++)
        {
            if (i != n - 1)
            {
                newNodeObjects[i] = nodeObjects[i];
            }

            else
            {
                newNodeObjects[i] = newRiverNodeObject;
            }
        }

        nodeObjects = newNodeObjects;
    }
 public void NewRiver()
 {
     nodeObjects = new RiverNodeObject[0];
     riverCollider = (MeshCollider)riverObject.AddComponent(typeof(MeshCollider));
 }