using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Texture2d : MonoBehaviour {
private Texture2D texture;
[SerializeField]
private RawImage image_Map;
private int miniMapWidth = (CommonConfig.MINIMAP_MINX);
private int miniMapHeight = (CommonConfig.MINIMAP_MINY);
void Start () {
Color32[] colors = new Color32[miniMapWidth * miniMapHeight];
for (int i = 0; i < miniMapWidth * miniMapHeight; i++)
{
if (i == 453)
{
colors[i] = Color.red;
}
else if (i == 4520)
{
colors[i] = Color.blue;
}
else if (i == 5550)
{
colors[i] = Color.grey;
}
else if (i == 6650)
{
colors[i] = Color.blue;
}
else if (i == 880)
{
colors[i] = Color.red;
}
else if (i == 6540)
{
colors[i] = Color.grey;
}
else
{
colors[i] = Color.green;
}
}
texture = new Texture2D(miniMapWidth, miniMapHeight, TextureFormat.RGBA32, false);
texture.wrapMode = TextureWrapMode.Clamp;
texture.SetPixels32(colors);
texture.Apply();
image_Map.texture = texture;
}
}