Hey there,
I am trying to access the HarmonyRenderer. It is a component created when you Import a 2d asset from Harmony Toon-Boom, which replaces the regular Renderer. However it does not seem to be accessible in exactly the same way.
basically I am trying to fade out 1 object by turning down the alpha on the harmony renderer. Sound easy enough right? And I can do it…
IEnumerator FadeOut()
{
float alpha = HarmonyRenderer.color.a;
while (alpha > 0) {
alpha -= Time.deltaTime;
Color NewColor = new Color (1, 1, 1, alpha);
HarmonyRenderer.color = NewColor;
yield return null;
}
}
but I seem to be accessing ALL HarmonyRenderers attached to every gameObject in the scene. they all fade at once.
However when I try to specify by something like this
IEnumerator FadeOut()
{
float alpha = gameObject.GetComponent< HarmonyRenderer >().color.a;
while (alpha > 0) {
alpha -= Time.deltaTime;
Color NewColor = new Color (1, 1, 1, alpha);
HarmonyRenderer.color = NewColor;
yield return null;
}
}
I Get this error: static member “HarmonyRenderer.color” cannot be accessed with an instance reference, qualify it with a type name instead.
Im sure someone out there knows how I can properly access just one single instance of the harmony renderer so that I can fade out just one object.