Синтаксис:
Используется csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MiniMapGUI : MonoBehaviour {
public RenderTexture MiniMapTexture;
public Texture2D MiniMapHope;
public Material MiniMapMat;
public GameObject _cc;
float offset = 10;
float CamSize = 45f;
void Update ()
{
Vector3 pos = _cc.transform.position;
gameObject.transform.position = new Vector3 (pos.x, 40f, pos.z);
gameObject.GetComponent<Camera> ().orthographicSize = CamSize;
}
void OnGUI ()
{
if (Event.current.type == EventType.Repaint)
{
Graphics.DrawTexture(new Rect(Screen.width * 0.0025f, Screen.height - 260, 256, 256), MiniMapTexture, MiniMapMat);
Graphics.DrawTexture(new Rect(Screen.width * 0.0025f, Screen.height - 260, 256, 256), MiniMapHope);
}
}
}
using System.Collections.Generic;
using UnityEngine;
public class MiniMapGUI : MonoBehaviour {
public RenderTexture MiniMapTexture;
public Texture2D MiniMapHope;
public Material MiniMapMat;
public GameObject _cc;
float offset = 10;
float CamSize = 45f;
void Update ()
{
Vector3 pos = _cc.transform.position;
gameObject.transform.position = new Vector3 (pos.x, 40f, pos.z);
gameObject.GetComponent<Camera> ().orthographicSize = CamSize;
}
void OnGUI ()
{
if (Event.current.type == EventType.Repaint)
{
Graphics.DrawTexture(new Rect(Screen.width * 0.0025f, Screen.height - 260, 256, 256), MiniMapTexture, MiniMapMat);
Graphics.DrawTexture(new Rect(Screen.width * 0.0025f, Screen.height - 260, 256, 256), MiniMapHope);
}
}
}
Там еще шейдер используется, потом его скину если надо
_сс это игрок