Warning:
Assets/Scripts/MainMenu.cs(159,29): warning CS0472: The result of comparing value type `System.Collections.Generic.List<float>.this[int]' with null is `true'
Code:
what I want to achieve is:
void EventLogF(){
for (int i=EventMessages.Count-4; i<EventMessages.Count; i++) {
if (EventTimes *!= null){*
_ if (EventTimes > Time.time-SecondsToDisapear){_
_ GUILayout.Label( EventMessages );
* }
else {
EventMessages.RemoveAt(i);
EventTimes.RemoveAt(i);
}
}
}
}
and yes I do get null error because it returns true, … why is that?
my before code was:
void EventLogF(){
int num = 3;
for (int i=EventMessages.Count-1; i>=0; i–) {
num --;
if (EventTimes > Time.time-SecondsToDisapear){
GUILayout.Label( EventMessages );
}
else {
EventMessages.RemoveAt(i);
EventTimes.RemoveAt(i);
}*_
* if (num == 0){*
* break;*
* }*
* }*
* }*
but problem was the new messages were on top instead of bottom.