- Home /
Question by
hephaestus_sc2 · Jun 02, 2013 at 09:10 PM ·
listlists
Why does list.Last() not exist?
If I have
public var blocks : List.<GameObject> = new List.<GameObject>();
I can't do
blocks.Last();
Like I could in many other programming languages that have lists.
I have to do something crude like
blocks[block.Count - 1];
instead.
Why?
Comment
Best Answer
Answer by Eric5h5 · Jun 02, 2013 at 09:30 PM
It does exist, but it's an extension method, so you'd have to import System.Linq.
Can you do that in UnityScript?
import System.Linq
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Grab a specific item from a list 3 Answers
Start function on a listed non mono script? 2 Answers
Public list are not reflecting in inspector. 1 Answer
List in prefab instantiated object not saving after Awake 0 Answers