I am using a gui.box, with a custom guistyle, but when I change resolutions the gui is all off position, and scaled differently, sometimes it even dissappears on different resolutions. Any help would be greaty appreciated.
using UnityEngine;
using System.Collections;
public class Inventorygui : MonoBehaviour {
bool render;
public bool use;
public GUIStyle inventory;
// Use this for initialization
void Start () {
}
void OnGUI()
{
if(render){
GUI.Box(new Rect(Screen.height / 2, Screen.width / 2,Screen.width / 2, Screen.height / 2),“”,inventory);
}
}
void ToggleWindow()
{
render = !render;
}
void Update()
{
if (Input.GetKeyDown(KeyCode.I))
{
ToggleWindow();
}
}