Esempio n. 1
0
 public void SetMaterial()
 {
     mGraphic = this.GetComponent<MaskableGraphic>();
     if (mGraphic != null)
     {
         if (mGraphic.material == null || mGraphic.material.name == "Default UI Material")
         {
             //Applying default material with UI Image Crop shader
             mGraphic.material = new Material(Shader.Find("UI Extensions/UILinearDodge"));
         }
     }
     else
     {
         Debug.LogError("Please attach component to a Graphical UI component");
     }
 }
Esempio n. 2
0
 protected virtual void Start()
 {
     _graphic = GetComponent <MaskableGraphic>();
 }
Esempio n. 3
0
 /*
  * SetOpacity - only changes the alpha of a given color
  * Params:
  *  - MaskableGraphic UIElement: the object to have its opacity changes
  *  - float alpha: the new transparency value, range 0-1
  * Returns: Color for the object
  */
 private Color SetOpacity(MaskableGraphic UIElement, float alpha)
 {
     return(new Color(UIElement.color.r, UIElement.color.g, UIElement.color.b, alpha));
 }
Esempio n. 4
0
 // Use this for initialization
 void Awake()
 {
     graphic       = GetComponent <MaskableGraphic>();
     rectTransform = graphic.rectTransform;
 }
Esempio n. 5
0
 protected abstract void ApplyAnimation(MaskableGraphic target, float delta);