void Update(){ var mousePos = Input.mousePosition; var p = new Vector3( (float)mousePos.x / Screen.width-0.5f, (float)mousePos.y / Screen.height-0.5f, 0 ); hoge.localPosition = new Vector3( p.x*1125,//canvasの大きさ p.y*2436, 0 ); }
void Update(){ var mousePos = Input.mousePosition; var p = new Vector3( (float)mousePos.x / Screen.width-0.5f, (float)mousePos.y / Screen.height-0.5f, 0 ); hoge.localPosition = new Vector3( p.x*1125,//canvasの大きさ p.y*2436, 0 ); }