API
The following section describes the exposed properties of the shader. You can use those properties to dynamically change various shader options from your own scripts.
_MainTex
The main (albedo/color) texture used by the shader.
See Albedo Texture for more information.
Usage
With
material being the material of the object's sprite renderer,
and newTexture being the albedo texture you would like to apply to the object,
set the value like so:material.SetTexture("_MainTex", newTexture);
and read it like so:
Texture texture = material.GetTexture("_MainTex");
_BaseColor
The albedo color of the texture.
See Albedo Color for more information.
Usage
With
material being the material of the object's sprite renderer,
and newColor being the albedo color you would like to apply to the object,
set the value like so:material.SetColor("_BaseColor", newColor);
and read it like so:
Color color = material.GetColor("_BaseColor");
_Cutoff
The alpha cutoff value.
See Alpha Cutoff for more information.
Usage
With
material being the material of the object's sprite renderer,
and newCutoff being the cutoff value you would like to apply to the object,
set the value like so:material.SetFloat("_Cutoff", newCutoff);
and read it like so:
float cutoff = material.GetFloat("_Cutoff");
_EmissionColor
The color of the emission.
See Emission Color for more information.
Usage
With
material being the material of the object's sprite renderer,
and newColor being the emission color you would like to apply to the object,
set the value like so:material.SetColor("_EmissionColor", newColor);
and read it like so:
Color color = material.GetColor("_EmissionColor");
_EmissionExtraIntensity
An additional intensity value for finer control of the emission.
See Emission Extra Intensity for more information.
Usage
With
material being the material of the object's sprite renderer,
and newIntensity being the emission intensity value you would like to apply to the object,
set the value like so:material.SetFloat("_EmissionExtraIntensity", newIntensity);
and read it like so:
float intensity = material.GetFloat("_EmissionExtraIntensity");
_WaveController
The controller value for the wave effect.
See Wave Controller for more information.
Usage
With
material being the material of the object's sprite renderer,
and controller being the controller value you would like to apply to the object,
set the value like so:material.SetFloat("_WaveController", controller);
and read it like so:
float controller = material.GetFloat("_WaveController");
_WaveThickness
The thickness of the wave
See Wave Thickness for more information.
Usage
With
material being the material of the object's sprite renderer,
and thickness being the thickness value you would like to apply to the object,
set the value like so:material.SetFloat("_WaveThickness", thickness);
and read it like so:
float thickness = material.GetFloat("_WaveThickness");
_WaveStrength
The overall feel of the wave.
See Wave Strength for more information.
Usage
With
material being the material of the object's sprite renderer,
and strength being the strength value you would like to apply to the object,
set the value like so:material.SetFloat("_WaveStrength", strength);
and read it like so:
float strength = material.GetFloat("_WaveStrength");