Created
December 18, 2015 14:42
-
-
Save tsubaki/92dc6d7ab5a18c113b5f to your computer and use it in GitHub Desktop.
マルチディスプレイ、マウス座標とマウスのあるディスプレイ表示も
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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