// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player"); player_script = player.GetComponent <Scr_PlayerControl>(); spawndata = GameObject.FindGameObjectWithTag("Locdata").GetComponent <spawnlocationdata>(); ms = GameObject.FindGameObjectWithTag("MasterScript").GetComponent <master_script>(); continuebt.onClick.AddListener(GoContinue); backtovillagebt.onClick.AddListener(GoJelly); mainmenubt.onClick.AddListener(GoMainMenu); }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player"); player_script = player.GetComponent <Scr_PlayerControl>(); spawndata = GameObject.FindGameObjectWithTag("Locdata").GetComponent <spawnlocationdata>(); ms = GameObject.FindGameObjectWithTag("MasterScript").GetComponent <master_script>(); for (int i = 0; i < levellist.Length; i++) { if (ms.checkpoints[sceneid][i] == 0) { levellist[i].SetActive(false); } else { levellist[i].SetActive(true); } buttonlist[i].onClick.AddListener(GoToLevel); //buttonlist[i].onClick.AddListener(() => GoToLevel(i)); } }