public static ButtonsController FetchBouttonsControllerScript() { GameObject buttonsControllerObject = GameObject.FindGameObjectWithTag(TagConstants.TAG_NAME_BOUTTONS_CONTROLLER); ButtonsController buttonsControllerScript = buttonsControllerObject.GetComponent <ButtonsController>(); return(buttonsControllerScript); }
public void SwitchReloadGameMode() { shootButtonsParent.SetActive(false); reloadButton.SetActive(false); weaponChangeButton.SetActive(false); utilityChangeButton.SetActive(false); reloadGameButtonsParent.SetActive(true); // sichtbare Buttons switchen ButtonsController.GetInstance().SwitchReloadGameMode(); }
// Use this for initialization void Start() { if (mybtn == null) { if (GetComponentInChildren <Button>() != null) { mybtn = GetComponentInChildren <Button>(); } } mybtn.onClick.AddListener(TaskOnClick); master = ((ButtonsController)GameObject.FindGameObjectWithTag("MainCanvas").GetComponent(typeof(ButtonsController))).getInstance(); }
// Use this for initialization void Start() { btnsCtrl = ((ButtonsController)GameObject.FindGameObjectWithTag("MainCanvas").GetComponent(typeof(ButtonsController))).getInstance(); Order orderP11 = new Order(1, new OrdersElement("Interruptor", btnsCtrl.getButtons(2)[2], 1)); Order orderP12 = new Order(1, new OrdersElement("Interruptor", btnsCtrl.getButtons(1)[2], 1)); Order orderP21 = new Order(1, new OrdersElement("Interruptor", btnsCtrl.getButtons(1)[2], 1)); Order orderP22 = new Order(1, new OrdersElement("Interruptor", btnsCtrl.getButtons(2)[2], 1)); ordersP1.Add(orderP11); ordersP1.Add(orderP12); ordersP2.Add(orderP21); ordersP2.Add(orderP22); currP1 = ordersP1[0]; currP2 = ordersP2[0]; }
public void CheckEndGame(Player jug) { ButtonsController disableAll = GameObject.Find("NetworkManager").GetComponent <ButtonsController> (); if (jug.Health <= 0 && jug.NamePlayer != jug1.NamePlayer) { result.SetActive(true); Image sol = result.GetComponent <Image>(); sol.sprite = Win; disableAll.disableAllButtons(); } else if (jug.Health <= 0 && jug.NamePlayer == jug1.NamePlayer) { result.SetActive(true); Image sol = result.GetComponent <Image>(); sol.sprite = Lose; disableAll.disableAllButtons(); } //MOSTRAR PANTALLAS Y PARAR JUEGO }
private void Awake() { Instance = this; }
private void Awake() { instance = this; DontDestroyOnLoad(gameObject); }
private void Start() { buttonsController = FindObjectOfType <ButtonsController>(); }
// Use this for initialization void Start() { instance = this; GameObject canvasObject = GameObject.FindGameObjectWithTag("MainCanvas"); Transform user1 = canvasObject.transform.Find("user1"); Transform user2 = canvasObject.transform.Find("user2"); Transform[] userZone1 = { canvasObject.transform.Find("zonePlayer11"), canvasObject.transform.Find("zonePlayer12"), canvasObject.transform.Find("zonePlayer13"), canvasObject.transform.Find("zonePlayer14") }; Transform[] userZone2 = { canvasObject.transform.Find("zonePlayer21"), canvasObject.transform.Find("zonePlayer22"), canvasObject.transform.Find("zonePlayer23"), canvasObject.transform.Find("zonePlayer24") }; for (int i = 0; i < 8; i++) { if (i < 4) { if (userZone1[i].transform.GetChild(0) != null) { if (userZone1[i].transform.GetChild(0).GetComponent(typeof(Interruptor)) != null) { btnlist.Add((Interruptor)userZone1[i].transform.GetChild(0).GetComponent(typeof(Interruptor))); } else if (userZone1[i].transform.GetChild(0).GetComponent(typeof(Slider)) != null) { slidlist.Add((Slider)userZone1[i].transform.GetChild(0).GetComponent(typeof(Slider))); } else { Debug.Log("Button missing player 1 zone " + i.ToString()); } } } else { if (userZone2[i].transform.GetChild(0) != null) { if (userZone2[i].transform.GetChild(0).GetComponent(typeof(Interruptor)) != null) { btnlist.Add((Interruptor)userZone2[i].transform.GetChild(0).GetComponent(typeof(Interruptor))); } else if (userZone2[i].transform.GetChild(0).GetComponent(typeof(Slider)) != null) { slidlist.Add((Slider)userZone2[i].transform.GetChild(0).GetComponent(typeof(Slider))); } else { Debug.Log("Button missing player 1 zone " + i.ToString()); } } } } foreach (Interruptor btn in btnlist) { dicBtnsP1.Add(btn, false); dicBtnsP2.Add(btn, false); } foreach (Slider sld in slidlist) { dicSldP1.Add(sld, 0); dicSldP2.Add(sld, 0); } }
private void ReturnToPreviousMenu() { ButtonsController buttonsControllerScript = GameUtils.FetchBouttonsControllerScript(); buttonsControllerScript.ReturnToLocalModeMenu(); }