hey
@andy.dys are you using a substance from Substance source? if yes, which one? This should work with 2020 and 2.5.2.
The code to use IsProcessing() function is something like this:
using UnityEngine;
using Substance.Game;
using UnityEngine.UI;
public class Testing : MonoBehaviour
{
// USE: ceramic_porcelain_cracked.sbsar
public Substance.Game.SubstanceGraph graph; // MUST BE ASSIGNED BY THE USER (in the GameObject's script section)
static int c = 1; // fraction of a color's scale
static int dc = 1; // step of a color's scale (from 0 to 10)
static Color color;
void Start()
{
UpdateColor();
}
void Update()
{
if (Substance.Game.Substance.IsProcessing())
{
Debug.Log("BUSY!");
return;
}
Debug.Log("Changing color...");
UpdateColor();
}
void UpdateColor()
{
// ...............................................
if (c >= 10)
dc = -1;
else if (c <= 0)
dc = 1;
c += dc;
// -----------------------------------------------------
color = new Color(0.1f, c / 10.0f, 0.1f, 1.0f);
graph.SetInputColor("porcelain_color", color);
graph.QueueForRender();
Substance.Game.Substance.RenderSubstancesAsync();
}
}