The error is with how you are casting the object. It should be like this:
tmpRay = draw as DrawingTools.Ray;
That would be like the following:
private List<DrawingTools.Ray> drawings = new List<DrawingTools.Ray>();
protected override void OnBarUpdate()
{
if(someConditionl)
{
Ray myRay = Draw.Ray(....);
drawings.Add(myRay);
}
if(someOtherConditionl)
{
for(int i = 0; i <= drawings.Count - 1; i++)
{
DrawingTools.Ray ray = drawings[i];
//your conditions checking the objects anchors and times
RemoveDrawObject(ray.Tag);
drawings.RemoveAt(i);
}
}
}


Comment