window mode and botany wip

This commit is contained in:
ntr committed 2022-05-31 15:39:24 +10:00
1 parent f0aa6495c7
commit 0f9576a67b
68 files changed
+8224 -1311

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
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 Preferences preferences;
[VFXPropertyBinding("UnityEngine.Gradient"), SerializeField]
protected ExposedProperty ThemeParameter = "Theme";
void Awake() {
if (preferences == null) Debug.Log("Theme VFX Binder needs preferences.");
}
public override bool IsValid(VisualEffect component) {
return preferences != null
&& preferences.Theme() != null
&& component.HasGradient(ThemeParameter);
}
public override void UpdateBinding(VisualEffect component) {
component.SetGradient(ThemeParameter, preferences.Theme());
}
// have to override these to prevent NRE
protected override void OnEnable() {
// Debug.Log("OnEnable");
}
protected override void OnDisable() {
// Debug.Log("OnDisable");
}
}