This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mode out color out alpha | |
| -------------- -------------- ----------- | |
| layer/over: ( sc+(1-sa)*dc , sa+da-sa*da ) | |
| multiply: ( sc*dc , sa+da-sa*da ) | |
| screen: ( sa*da - (da-dc)*(sa-sc) , sa+da-sa*da ) | |
| lighten: ( max(sa*dc,sc*da) , sa+da-sa*da ) | |
| darken: ( min(sa*dc,sc*da) , sa+da-sa*da ) | |
| add: ( min(dc+sc,1) , min(sa+da,1) ) | |
| subtract: ( max(dc-sc,0) , min(sa+da,1) ) | |
| difference: ( abs(sa*dc-sc*da) , sa+da-sa*da ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using UnityEngine.UI; | |
| using System.Collections.Generic; | |
| [RequireComponent(typeof(CanvasRenderer))] | |
| public class SimpleGraphic : MaskableGraphic //could extend Graphic if you don't need it maskable | |
| { | |
| public Texture texture; | |
| public override Texture mainTexture |