gradients init

This commit is contained in:
ntr committed 2022-03-31 00:12:47 +11:00
1 parent cef7025a44
commit af387b8490
11 files changed
+2439 -1702

No files matched your search

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