Tanoda
UILinearDodgeEffect.cs
Go to the documentation of this file.
1
3
4
6{
7 [AddComponentMenu("UI/Effects/Extensions/UILinearDodgeEffect")]
8 [ExecuteInEditMode]
9 [RequireComponent(typeof(RectTransform))]
10 public class UILinearDodgeEffect : MonoBehaviour
11 {
12 MaskableGraphic mGraphic;
13
14 // Use this for initialization
15 void Start()
16 {
18 }
19
20 public void SetMaterial()
21 {
22 mGraphic = this.GetComponent<MaskableGraphic>();
23 if (mGraphic != null)
24 {
25 if (mGraphic.material == null || mGraphic.material.name == "Default UI Material")
26 {
27 //Applying default material with UI Image Crop shader
28 mGraphic.material = new Material(Shader.Find("UI Extensions/UILinearDodge"));
29 }
30 }
31 else
32 {
33 Debug.LogError("Please attach component to a Graphical UI component");
34 }
35 }
36 public void OnValidate()
37 {
39 }
40 }
41}
UnityEngine.Debug Debug
Definition: TanodaServer.cs:19
Credit Erdener Gonenc - @PixelEnvision.