Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. // in ButtonGame.cs
  2. void Start () {
  3.         Vector3 position;
  4.         for (int i = 1; i < 5; i++) {
  5.             position = new Vector3(Screen.width * 0.2f * i, 100, camera2d.nearClipPlane + 1);
  6.             Instantiate(consoleButton, camera2d.ScreenToWorldPoint(position), Quaternion.identity);
  7.         }
  8.     }
  9.  
  10. // then in ButtonTest.cs
  11.     void OnMouseDown()
  12.     {
  13.         Debug.Log("button on mouse down");
  14.         redButton.gameObject.SetActive(false);
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement