My game default resolution is 800x500 in the webplayer. I want this resolution to be fixed, in case of changing resolution, the game load other scene. How can I do this?
error CS0030: Cannot convert type UnityEngine.Vector2' to
int’
using UnityEngine;
using System.Collections;
public class Resolution : MonoBehaviour {
Vector2 targetResolution;
void Start()
{
targetResolution = new Vector2(800, 500);
}
void Update ()
{
if(Screen.width != (int)targetResolution || Screen.height != (int)targetResolution)
{
Application.LoadLevel("MainMenu");
}
}
}