Hi again unity masters,
Im trying to get the Current Tracked Shaders as;
Edit, Project Settings, Graphics.
Scroll Down and there is a String that says:
Currently Tracked : X shaders X total variants.
Is there a way to access that ShaderVariantCollection.ShaderVariant by script?
I want to make the process of creating shaders variant easier. For example:
Play the Game in editor →
Start Scene, call some code like;
ShaderUtil.ClearCurrentTrackedVariants();
Finish the Scene, call some code like;
ShaderUitl.GetCurrentlyTrackedVariantList();
SaveAsset(AutoGeneratedVariants + “SceneID_” + SceneID);
Im trying to create my own code for it but I’m getting problems detecting the variants, It always add ALL the possible variants and IsKeywordEnabled always return True;
String[] keyWorlds = mr.material.shaderKeywords;
List<String> variantKey = new List<string>();
for (int j = 0; j < keyWorlds.Length; j++)
{
if(mr.material.IsKeywordEnabled(keyWorlds[j]) == true)
{
variantKey.Add(keyWorlds[j]);
}
}
So would be nice to use unity own function for that.
Regards
Fran.