Added Ambient-Light

This commit is contained in:
Michel Fedde 2020-12-13 16:30:57 +01:00
parent e4e7db8dc0
commit 597a14743b
7 changed files with 40 additions and 10 deletions

View file

@ -66,10 +66,15 @@ namespace SM.Base.Scene
/// <typeparam name="T"></typeparam>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public virtual T GetExtension<T>()
public virtual T GetExtension<T>() where T : class
{
object ext = _extensions[typeof(T)];
if (ext == null) throw new Exception("[Error] Tried to get a extension, that doesn't exist.");
if (ext == null)
{
Log.Write(LogType.Warning, $"Tried to get the extension '{typeof(T).Name}', that doesn't exist in the scene.");
return null;
}
return (T)ext;
}

View file

@ -113,10 +113,10 @@ namespace SM.Base
{
_loading = false;
OnLoaded();
_actionsAfterLoading.ForEach(a => a());
_actionsAfterLoading = null;
OnLoaded();
}
}