C# combining Two Textures

Hi everyone, is it possible to combine two textures? I have two textures, one that is an item and the other that is a selector . I want to make it so when the GUI.Button is clicked it combines the selector’s and the item’s textures together so that the item looks like it has been selected. I have tried itemTex+selectorTex but the console gives me an error saying that I can’t use the plus like that.

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
    public Texture itemTex;
    public Texture selectorTex;
    void OnGUI() {

        if (GUI.Button(new Rect(10, 10, 50, 50), itemTex)){
        //itemTex = itemTex+selectorTex
    }
}

I didn’t even knew textures could be combined as robertbu said, but I also agree probably, in your case, the best option is provide two textures ready to simply switch.

I also don’t know why nobody mentioned using the built-in Decal shader. You can assign 2 textures there, which will be combined. It’s exactly what it’s made for, and it can have its usage when you have lots of different combinations.

Textures can be combined, but it is an expensive and a bit ugly operation. You would have to make them both a Texture2D, they would have to be read/write enabled, you would need to pull the data out from both of them, combine the data by cycling through all the pixles, and then insert that data either back into an existing texture or a new one. And if they are a different size, you would need to do some not nice index calculations.

It would be better if you provided two forms of your itemTex, one selected and one with no selection. At runtime, you would switch between the two.

A simpler method to achieve your desired effect is to just render the section texture about your item texture, that is what most games use. You can also try render it behind the item for a different effect.