mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-22 08:08:51 -05:00
Add Chainable add
This commit is contained in:
parent
03e02ea0f5
commit
4d37afff63
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user