Advertisement
Guest User

Untitled

a guest
May 29th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. protected override void OnGUI()
  2. {
  3. if(!_beenPressed)
  4. {
  5. float rx = Screen.width / _nativeWidth;
  6. float ry = Screen.height / _nativeHeight;
  7. GUI.matrix = Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.identity, new Vector3(rx, ry, 1));
  8.  
  9. if (GUI.Button(new Rect(_xPos * 100, _yPos * 100, 80, 32), _buttonTexture, GUIStyle.none))
  10. {
  11. //code
  12. }
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement