Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created December 18, 2015 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/92dc6d7ab5a18c113b5f to your computer and use it in GitHub Desktop.
Save tsubaki/92dc6d7ab5a18c113b5f to your computer and use it in GitHub Desktop.
マルチディスプレイ、マウス座標とマウスのあるディスプレイ表示も
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