**I want my function to pick texture and color of the same RawImage from the random array of RawImages. But i can’t seem to do that .
I have tried accessing both texture and color separately but due it i get color from another RawImage and texture from another . So please kindly help me.**
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class DisplayColor7 : MonoBehaviour {
public RawImage[] buttons;
public RawImage DeadPool;
public void Start () {
changeColor ();
}
public void changeColor() {
GetComponent<RawImage>().texture&Color = buttons [Random.Range (0, buttons.Length - 1)].texture&Color;
//DeadPool = this. buttons [Random.Range (0, buttons.Length - 1)];
//DeadPool = new RawImage(buttons [Random.Range (0, buttons.Length - 1)].mainTexture);
}
}