示例#1
0
    public void Authorize(string cellName)
    {
        m_bIsAuthorizing = true;

        cellNameText.text = cellName;
        authorizePanel.gameObject.SetActive(true);

        yesBtn.onClick.AddListener(() => {
            GameObject cell = gridMaker.GetGridCellByTag(cellName);
            if (cell != null)
            {
                cell.GetComponent <SpriteRenderer>().color = Color.green;
            }
            authorizePanel.gameObject.SetActive(false);

            yesBtn.onClick.RemoveAllListeners();

            m_bIsAuthorizing = false;
        });

        noBtn.onClick.AddListener(() =>
        {
            authorizePanel.gameObject.SetActive(false);
            m_bIsAuthorizing = false;
            noBtn.onClick.RemoveAllListeners();
        });
    }
示例#2
0
    private bool TestString(string testString)
    {
        string[] cutUpText = testString.Split(' ');
        int      num       = SearchForNumber(cutUpText);
        char     c         = SearchForLetter(cutUpText);

        string tag = c + num.ToString();

        if (gridMaker.GetGridCellByTag(tag) != null)
        {
            authorizeSelection.Authorize(tag);
            return(true);
        }
        return(false);
    }