gradients init
This commit is contained in:
1 parent
cef7025a44
commit
af387b8490
11 files changed
+2439
-1702
No files matched your search
@@ -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());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user