Unstable 0.15.15.0 (and the one before it I forgor)
This commit is contained in:
@@ -72,6 +72,23 @@ namespace Barotrauma
|
||||
return prefabs.ContainsKey(identifier);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if a prefab with the identifier exists, false otherwise.
|
||||
/// </summary>
|
||||
/// <param name="identifier">Prefab identifier</param>
|
||||
/// <param name="prefab">The matching prefab (if one is found)</param>
|
||||
/// <returns>Whether a prefab with the identifier exists or not</returns>
|
||||
public bool TryGetValue(string identifier, out T prefab)
|
||||
{
|
||||
if (!ContainsKey(identifier))
|
||||
{
|
||||
prefab = default;
|
||||
return false;
|
||||
}
|
||||
prefab = this[identifier];
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a prefab to the collection.
|
||||
/// If not marked as an override, fail if a prefab with the same
|
||||
|
||||
Reference in New Issue
Block a user