Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
マルチディスプレイ、マウス座標とマウスのあるディスプレイ表示も
using UnityEngine;
using System.Collections;
public class StartMultiDisplay : MonoBehaviour {
void Start ()
{
int maxDisplayCount = 2;
for (int i=0; i<maxDisplayCount && i<Display.displays.Length; i++) {
Display.displays[i].Activate();
}
}
void OnGUI()
{
var mousePos = Display.RelativeMouseAt (Input.mousePosition);
GUILayout.Label ("mouse position:" + ((Vector2)mousePos).ToString());
GUILayout.Label("display id:" + mousePos.z);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.