Browse Source

Move Character Portrait nulls to end of list

master
shalliwell 5 years ago
parent
commit
3681fb094d
  1. 3
      Assets/Fungus/Scripts/Components/Character.cs
  2. 4
      Assets/Fungus/Scripts/Utils/PortraitUtils.cs

3
Assets/Fungus/Scripts/Components/Character.cs

@ -183,8 +183,11 @@ namespace Fungus
#endregion
protected virtual void OnValidate()
{
if (portraits != null && portraits.Count > 1)
{
portraits.Sort(PortraitUtil.PortraitCompareTo);
}
}
}
}

4
Assets/Fungus/Scripts/Utils/PortraitUtils.cs

@ -189,9 +189,9 @@ namespace Fungus
if (x == y)
return 0;
if (y == null)
return 1;
if (x == null)
return -1;
if (x == null)
return 1;
return x.name.CompareTo(y.name);
}

Loading…
Cancel
Save