using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GUITest : MonoBehaviour
{
public Transform other;
public GUIStyle style;
void OnGUI()
{
if (other)
{
float dist = Vector3.Distance(other.position, transform.position);
if(dist < 15 )
{
GUI.Button(new Rect(600, 100, 100, 100), "NO", style);
GUI.Button(new Rect(800, 100, 100, 100),"YES", style);
GUI.TextArea(new Rect (600, 250, 300, 100), "Do You Want To Open This Crate?", style);
}
}
}
}
You can modify the GUIStyle variable comfortably in the inspector.