Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This scirpt just changes static variable in 2 scripts that tells 2 two scripts on which button you pressed
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class MenuButton : MonoBehaviour
- {
- private int whichButton;
- public SubMenuContent obj;
- void Start()
- {
- if(gameObject.transform.parent.name != "DefaultButton")
- whichButton = int.Parse(gameObject.transform.parent.name);
- }
- public void OnClick()
- {
- Debug.Log(whichButton);
- SubMenuContent.SetButton(gameObject.transform.parent.name);
- MenuContent.SetButton(whichButton);
- obj.UpdateList();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement