Advertisement
Guest User

MenuButton.cs

a guest
Aug 20th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. //This scirpt just changes static variable in 2 scripts that tells 2 two scripts on which button you pressed
  2.  
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using UnityEngine;
  6.  
  7. public class MenuButton : MonoBehaviour
  8. {
  9. private int whichButton;
  10. public SubMenuContent obj;
  11.  
  12. void Start()
  13. {
  14. if(gameObject.transform.parent.name != "DefaultButton")
  15. whichButton = int.Parse(gameObject.transform.parent.name);
  16. }
  17.  
  18. public void OnClick()
  19. {
  20. Debug.Log(whichButton);
  21. SubMenuContent.SetButton(gameObject.transform.parent.name);
  22. MenuContent.SetButton(whichButton);
  23. obj.UpdateList();
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement