Ejemplo n.º 1
0
    private void OnMatchStateChange(MatchingType type, bool isShow)
    {
        string name = "";

        switch (type)
        {
        case MatchingType.Trial:
            name = NAME_TRIAL;
            break;

        case MatchingType.Gold:
            name = NAME_GOLD;
            break;
        }
        for (int i = 0; i < buttons.Count; i++)
        {
            string btnName = buttons[i].name;
            btnName = btnName.TrimStart("1234567890".ToCharArray());
            if (btnName == name)
            {
                MatchStateChange item = buttons[i].GetComponent <MatchStateChange>();
                if (item != null)
                {
                    item.SetState(isShow);
                    break;
                }
            }
        }
    }
Ejemplo n.º 2
0
    private void OnMatchStateChange(MatchingType type, bool isShow)
    {
        string btnName = "";

        switch (type)
        {
        case MatchingType.Gold:
        case MatchingType.Trial:
            btnName = "Entrance-Trial";
            break;

        case MatchingType.PVP:
            btnName = "Entrance-Match";
            break;
        }
        for (int index = 0; index < buttons.Length; ++index)
        {
            if (buttons[index] != null && buttons[index].name == btnName)
            {
                MatchStateChange item = buttons[index].GetComponent <MatchStateChange>();
                if (item != null)
                {
                    item.SetState(isShow);
                    break;
                }
            }
        }
    }