コード例 #1
0
 public void DeleteEnemyCharacterInBattleList(GameObject deleteObj)
 {
     enemyCharacterInBattleList.Remove(deleteObj);
     if (enemyCharacterInBattleList.Count == 0)
     {
         ShowMessage("敵が全滅");
         battleIsOver = true;
         CharacterBattle characterBattleScript;
         foreach (var character in allCharacterList)
         {
             // 味方キャラクターの戦闘で増減したHPとMPを通常のステータスに反映させる
             characterBattleScript = character.GetComponent <CharacterBattle>();
             if (characterBattleScript.GetCharacterStatus() as AllyStatus != null)
             {
                 characterBattleScript.GetCharacterStatus().SetHp(characterBattleScript.GetHp());
                 characterBattleScript.GetCharacterStatus().SetMp(characterBattleScript.GetMp());
                 characterBattleScript.GetCharacterStatus().SetParalyze(characterBattleScript.IsNumbness());
                 characterBattleScript.GetCharacterStatus().SetPoisonState(characterBattleScript.IsPoison());
                 characterBattleScript.GetCharacterStatus().SetSilence(characterBattleScript.IsSilence());
             }
         }
         // 勝利時の結果表示
         battleResult.InitialProcessingOfVictoryResult(allCharacterList, allyCharacterInBattleList);
     }
 }
コード例 #2
0
    public void DeleteEnemyCharacterInBattleList(GameObject deleteObj)
    {
        enemyCharacterInBattleList.Remove(deleteObj);

        deleteObj.SetActive(false);
        if (enemyCharacterInBattleList.Count == 0)
        {
            Debug.Log("敵が全滅");
            ShowMessage("敵が全滅");
            battleIsOver = true;
            battleIsOver = true;
            playerUI.SetActive(false);
            CharacterBattleScript characterBattleScript;
            foreach (var character in allCharacterList)
            {
                // 味方キャラクターの戦闘で増減したHPとMPを通常のステータスに反映させる
                characterBattleScript = character.GetComponent <CharacterBattleScript>();
                if (characterBattleScript.GetCharacterStatus() as AllyStatus != null)
                {
                    characterBattleScript.GetCharacterStatus().SetHp(characterBattleScript.GetHp());
                    characterBattleScript.GetCharacterStatus().SetMp(characterBattleScript.GetMp());
                    characterBattleScript.GetCharacterStatus().SetNumbness(characterBattleScript.IsNumbness());
                    characterBattleScript.GetCharacterStatus().SetPoisonState(characterBattleScript.IsPoison());
                }
            }
            // 勝利時の結果表示
            battleResult.InitialProcessingOfVictoryResult(allCharacterList, allyCharacterInBattleList);
        }
        else
        {
            //選択対象のリセット
            foreach (GameObject allyCharacterInBattle in allyCharacterInBattleList)
            {
                CharacterStatus allyCharacterStatus = allyCharacterInBattle.GetComponent <CharacterBattleScript>().GetCharacterStatus();
                if (nextActs[allyCharacterStatus.GetCharacterName()].targetChara == deleteObj)
                {
                    nextActs[allyCharacterStatus.GetCharacterName()].targetChara = enemyCharacterInBattleList[0];
                }
            }
        }
    }