public bool DuplicateGridNode() { int id, length; length = SelectedNode.Count; for (int i = 0; i < length; i++) { SelectedNode.Add(new GridNodeAsset(( GridNodeAsset )SelectedNode[i], SelectedNetwork)); id = 0; while ((( GridNetworkAsset )SelectedNetwork).Get((( GridNodeAsset )SelectedNode[length + i]).Name + "-" + (++id)) != null) { ; } (( GridNodeAsset )SelectedNode[length + i]).Name += "-" + id; (( GridNetworkAsset )SelectedNetwork).Add((( GridNodeAsset )SelectedNode[length + i])); } SelectedNode.RemoveRange(0, length); SaveCollection(); return(true); }
public bool CreateGridNode() { int id = 0; while ((( GridNetworkAsset )SelectedNetwork).Get("NewGridNode" + (++id)) != null) { ; } SelectedNode.Clear(); SelectedNode.Add((( GridNetworkAsset )SelectedNetwork).Add(new GridNodeAsset("NewGridNode" + id, ( GridNetworkAsset )SelectedNetwork, Collection))); SaveCollection(); if (Browser.Instance != null) { Browser.Instance.Editing = false; Browser.Instance.CurrentHighlight = Browser.ItemType.Node; Browser.Instance.Editing = true; } return(true); }
public bool CreateWaypoint() { int id = 0; while ((( WaypointNetworkAsset )SelectedNetwork).Get("NewWaypoint" + (++id)) != null) { ; } SelectedNode.Clear(); SelectedNode.Add((( WaypointNetworkAsset )SelectedNetwork).Add(new WaypointAsset("NewWaypoint" + id, Vector3.zero, 1.0f, ( WaypointNetworkAsset )SelectedNetwork, Collection))); SaveCollection(); if (Browser.Instance != null) { Browser.Instance.Editing = false; Browser.Instance.CurrentHighlight = Browser.ItemType.Node; Browser.Instance.Editing = true; } return(true); }