Hey, i am new to DOTS i'm currently making a graph system for a waypoint graph. I am implement a function to delete a connection between two nodes but i cannot figure out how to call delete component or delete entity... i only seem to have access to SystemAPI which has Gets but not Removes. This is my function so far:
//partial struct GraphSystem : ISystem
public void Disconnect(in Entity nodeA, in Entity nodeB)
{
if(!Is<Node>(nodeA))
throw new System.Exception("Node A component not found for entity in GraphSystem::Disconnect");
if(!Is<Node>(nodeB))
throw new System.Exception("Node B component not found for entity in GraphSystem::Disconnect");
//get the Connection:IBufferElementData buffer
var conns = SystemAPI.GetBuffer<Connection>(nodeA);
for(int i = 0; i < conns.Length; i++)
{
//for this connection to node A get the edge entity
var edge = SystemAPI.GetComponent<Edge>(conns[i].EdgeEntity);
//confirm this edge connects to nodeB that we are trying to disconnect from
if(edge.Node1 == nodeB || edge.Node2 == nodeB)
{
//SystemAPI..no delete options???
//delete the edge entity
//delete connection component from node entitys nodeA AND nodeB
break;
}
}
}
any one able to shed light on how i deleted the entity and components ?