コード例 #1
0
    public static ButtonsController FetchBouttonsControllerScript()
    {
        GameObject        buttonsControllerObject = GameObject.FindGameObjectWithTag(TagConstants.TAG_NAME_BOUTTONS_CONTROLLER);
        ButtonsController buttonsControllerScript = buttonsControllerObject.GetComponent <ButtonsController>();

        return(buttonsControllerScript);
    }
コード例 #2
0
    public void SwitchReloadGameMode()
    {
        shootButtonsParent.SetActive(false);
        reloadButton.SetActive(false);
        weaponChangeButton.SetActive(false);
        utilityChangeButton.SetActive(false);

        reloadGameButtonsParent.SetActive(true);

        // sichtbare Buttons switchen
        ButtonsController.GetInstance().SwitchReloadGameMode();
    }
コード例 #3
0
    // 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();
    }
コード例 #4
0
    // 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];
    }
コード例 #5
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
    }
コード例 #6
0
 private void Awake()
 {
     Instance = this;
 }
コード例 #7
0
 private void Awake()
 {
     instance = this;
     DontDestroyOnLoad(gameObject);
 }
コード例 #8
0
 private void Start()
 {
     buttonsController = FindObjectOfType <ButtonsController>();
 }
コード例 #9
0
    // 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);
        }
    }
コード例 #10
0
    private void ReturnToPreviousMenu()
    {
        ButtonsController buttonsControllerScript = GameUtils.FetchBouttonsControllerScript();

        buttonsControllerScript.ReturnToLocalModeMenu();
    }