コード例 #1
0
    public void Onclick()
    {
        bool isOnTeam;

        if (controller.pos != 3)
        {
            isOnTeam = TeamModel.CheckIsOnTeamByHeroId(heroInfo);
        }
        else
        {
            isOnTeam = TeamModel.CheckIsOnTeamByPID(heroInfo);
        }
        if (isOnTeam)
        {
            //Instantiate(Resources.Load<GameObject>("Prefab/WarringMessage"),GameObject.Find("Canvas").transform);
            PrefabsTwo.Alert("该英雄在编队中,无法选中", null);
            return;
        }
        controller.selectHeroInfo = heroInfo;
        controller.SelectNum.text = "1";
        for (int i = 0; i < transform.parent.childCount; i++)
        {
            if (transform.parent.GetChild(i).name.Substring(0, 9) == "LevelTeam")
            {
                continue;
            }
            transform.parent.GetChild(i).Find("Selected").gameObject.SetActive(false);
        }
        transform.Find("Selected").gameObject.SetActive(true);
    }