Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #151: exception spew when a template is missing #153

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Source/Waterfall/Effects/WaterfallEffectTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public void Load(ConfigNode node)

template = WaterfallTemplates.GetTemplate(templateName);
allFX.Clear();

if (template == null) return;

foreach (var fx in template.allFX)
allFX.Add(new(fx, this));
}
Expand Down
1 change: 1 addition & 0 deletions Source/Waterfall/WaterfallParticles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public static void LoadAssetBundleAtPath(string bundlePath)
{
Utils.Log($"[Particles]: Loading {Path.GetFileNameWithoutExtension(bundlePath)}", LogType.Loading);
var bundle = AssetBundle.LoadFromFile(bundlePath);
if (bundle == null) return;
var systems = bundle.LoadAllAssets<GameObject>();

foreach (var sys in systems)
Expand Down
1 change: 1 addition & 0 deletions Source/Waterfall/WaterfallShaders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public static void LoadAssetBundleAtPath(string bundlePath)
{
Utils.Log($"[Shaders]: Loading shaders from {Path.GetFileNameWithoutExtension(bundlePath)}", LogType.Loading);
var bundle = AssetBundle.LoadFromFile(bundlePath);
if (bundle == null) return;
var shaders = bundle.LoadAllAssets<Shader>();
foreach (var shader in shaders)
{
Expand Down