/* 交換キャラクターを選択 */ public static IEnumerator Loop(ObtainChara obtainChara) { DrawParty(obtainChara); /* */ while (true) { if (haveCharaScript.touchId != -1) { joinCharaId = haveCharaScript.touchId; break; } yield return(0); } /* 次状態算出 */ if (joinCharaId == -2) { editPartyStatus = EDIT_PARTY_STATUS._CHANGE_CHARACTER; } if (joinCharaId == -3) { editPartyStatus = EDIT_PARTY_STATUS._DECIDED_JOIN_CHARACTER; } if (joinCharaId >= 0) { editPartyStatus = EDIT_PARTY_STATUS._DECIDED_JOIN_CHARACTER; } /* */ /* 削除 */ Destroy(partyObj); haveCharaScript = null; }
/* 交換キャラクターを選択 */ public static IEnumerator Loop(Party party) { /* パーティーを表示 */ DrawParty(party); /* 制御部分 */ while (true) { if (mPartyScript.touchId != -1) { changeCharaPartyId = mPartyScript.touchId; break; } yield return(0); } /* 次状態算出 */ if (changeCharaPartyId == -2) { editPartyStatus = EDIT_PARTY_STATUS._PARTY_SELECT; } if (changeCharaPartyId >= 0) { editPartyStatus = EDIT_PARTY_STATUS._JOIN_CHARACTER; } /* 削除 */ Destroy(partyObj); mPartyScript = null; }
public static IEnumerator Loop(SaveParty saveParty, string returnString, string describeString) { /* パーティーを表示 */ DrawParty(saveParty); SetReturnString(returnString); SetDescribeString(describeString); /* 制御部分 */ while (true) { if (decPartyObjScript.isDecided) { editPartyId = decPartyObjScript.touchedId; break; } yield return(0); } /* 次状態へ遷移 */ if (editPartyId >= 0) { editPartyStatus = EDIT_PARTY_STATUS._CHANGE_CHARACTER; } if (editPartyId == -2) { editPartyStatus = EDIT_PARTY_STATUS._END; } /* 削除 */ Destroy(decEditPartyObj); decPartyObjScript = null; }
/* * ================================================ * ゲームメインループ * ================================================ */ IEnumerator MainLoop() { /* 初期化処理 */ yield return(Init()); // セーブデータの読み込みにウェイトを挟む /* メインループ */ editPartyStatus = EDIT_PARTY_STATUS._CHANGE_CHARACTER; editPartyStatus = EDIT_PARTY_STATUS._PARTY_SELECT; changeCharaPartyId = -1; while (true) { switch (editPartyStatus) { // 編集するパーティの選択 case EDIT_PARTY_STATUS._PARTY_SELECT: yield return(DecideEditParty.Loop(saveData.GetSaveParty())); editPartyId = DecideEditParty.editPartyId; editPartyStatus = DecideEditParty.editPartyStatus; break; // 編成対象となるキャラクターの選択 case EDIT_PARTY_STATUS._CHANGE_CHARACTER: SetEditParty(); // editPartyId に応じて、パーティ情報を格納 yield return(DecideChangeCharacter.Loop(editParty)); changeCharaPartyId = DecideChangeCharacter.changeCharaPartyId; editPartyStatus = DecideChangeCharacter.editPartyStatus; break; // 誰を加入させるか選択 case EDIT_PARTY_STATUS._JOIN_CHARACTER: yield return(DecideJoinCharacter.Loop(saveData.GetObtainChara())); joinCharaId = DecideJoinCharacter.joinCharaId; editPartyStatus = DecideJoinCharacter.editPartyStatus; break; // 実際の入れ替え処理 case EDIT_PARTY_STATUS._DECIDED_JOIN_CHARACTER: ChangeMember(); SaveParty(); editPartyStatus = EDIT_PARTY_STATUS._CHANGE_CHARACTER; break; case EDIT_PARTY_STATUS._END: yield return(Utility._Scene.MoveScene("Base", "Images\\Background\\Black", 90)); break; default: break; } // フリーズを防止 yield return(0); } }