Add Chainable add

This commit is contained in:
Adam Ramberg 2019-03-29 13:23:17 +01:00
parent 03e02ea0f5
commit 4d37afff63

View File

@ -135,6 +135,12 @@ namespace UnityAtoms.Extensions
return false;
}
public static List<T> ChainableAdd<T>(this List<T> list, T item)
{
list.Add(item);
return list;
}
public static T GetOrInstantiate<T>(this List<T> list, UnityEngine.Object prefab, Vector3 position, Quaternion quaternion, Func<T, bool> condition) where T : UnityEngine.Component
{
var component = list.First(condition);
@ -174,4 +180,4 @@ namespace UnityAtoms.Extensions
return component;
}
}
}
}