7 [AddComponentMenu(
"UI/Effects/Extensions/UIScreenEffect")]
9 [RequireComponent(typeof(RectTransform))]
12 MaskableGraphic mGraphic;
22 mGraphic = this.GetComponent<MaskableGraphic>();
25 if (mGraphic.material ==
null || mGraphic.material.name ==
"Default UI Material")
28 mGraphic.material =
new Material(Shader.Find(
"UI Extensions/UIScreen"));
33 Debug.LogError(
"Please attach component to a Graphical UI component");
Credit Erdener Gonenc - @PixelEnvision.