add a bunch of gradients and set up the MNML vfx to use them

This commit is contained in:
ntr committed 2022-04-01 15:37:08 +11:00
1 parent 70ab364c08
commit 4e8d4eb8dc
20 files changed
+7289 -3912

No files matched your search

+5 -5
View File
@@ -8,23 +8,23 @@ using UnityEngine;
[AddComponentMenu("VFX/Property Binders/Kaiju - Theme Binder")]
[VFXBinder("Kaiju/Kaiju Theme Binder")]
public class ThemeVfxBinder : VFXBinderBase {
public ThemeSelector themeSelector;
public Preferences preferences;
[VFXPropertyBinding("UnityEngine.Gradient"), SerializeField]
protected ExposedProperty ThemeParameter = "Theme";
void Awake() {
if (themeSelector == null) Debug.Log("Theme VFX Binder needs theme selector.");
if (preferences == null) Debug.Log("Theme VFX Binder needs preferences.");
}
public override bool IsValid(VisualEffect component) {
return themeSelector != null
&& themeSelector.CurrentTheme() != null
return preferences != null
&& preferences.Theme() != null
&& component.HasGradient(ThemeParameter);
}
public override void UpdateBinding(VisualEffect component) {
component.SetGradient(ThemeParameter, themeSelector.CurrentTheme());
component.SetGradient(ThemeParameter, preferences.Theme());
}