I am trying to remove and destroy transform objects from the front of a linked list. When I get the object that I want to destroy and try and destroy it, I get this error : Cannot implicitly convert type System.Collections.Generic.LinkedListNode’ to 'UnityEngine.Transform
I have tried casting it to Transform, but I get this error: Cannot convert type System.Collections.Generic.LinkedListNode’ to `UnityEngine.Transform’
Any help would be greatly appreciated.
private static LinkedList<Transform> PlatLR = new LinkedList<Transform> ();
if (PlatLR.Count != 0) {
Transform P = PlatLR.First;
PlatLR.RemoveFirst ();
Destroy(P);
}