コード例 #1
0
    public void RemoveHero()
    {
        OnReturn();
        ChangeHeroInfo changeHeroInfo = new ChangeHeroInfo
        {
            battleHeroId = -1,
            teamPosition = mTeamPosition
        };

        GameObject.Find("FightScene").SendMessage("ChangeHero", changeHeroInfo);
    }
コード例 #2
0
    public void ChangeHero(ChangeHeroInfo changeHeroInfo)
    {
        fightPanel.SetActive(true);
        changeHeroPanel.gameObject.SetActive(false);
        Hero hero = DataManager.instance.GetHeroByTeamPosition(changeHeroInfo.teamPosition);

        if (hero != null)
        {
            hero.teamPosition = -1;
            //DataManager.instance.GetGameData().Heroes[hero.id] = hero;
        }
        Hero battlehero = DataManager.instance.GetHeroById(changeHeroInfo.battleHeroId);

        if (battlehero != null)
        {
            battlehero.teamPosition = changeHeroInfo.teamPosition;
        }
        teamListPanel.InitTeamList();
        InitFightingHero(false);
        DataManager.instance.SaveByBin();
    }