public bool checkStatus(Character chara, RoomInterface room, RoundController roundController) { bool winc = true; for (int i = 0; i < winConditions.Count; i++) { if (!winConditions[i].getConditionStatus(chara, room, roundController)) { winc = false; break; } } if (winc) { Kate kete = (Kate)roundController.getCharaByName(SystemConstant.P4_NAME); if (kete.isDead()) { this.endFlag = 0; } else { this.endFlag = 1; } } Debug.Log("检查好人胜利条件:" + winc); this.winResult = winc; return(winc); }
void Start() { demonApproachesAt = FindObjectOfType <Kate>(); if (PlayerPrefs.HasKey("HighScore")) { hiScoreCount = PlayerPrefs.GetFloat("HighScore"); } }
public bool getConditionStatus(Character chara, RoomInterface room, RoundController roundController) { Kate kete = (Kate)roundController.getCharaByName(SystemConstant.P4_NAME); BenMonster monster = (BenMonster)roundController.getCharaByName(SystemConstant.MONSTER1_NAME); if (monster.isDead() && (kete.isDead() || kete.getAbilityInfo()[3] >= 7)) { return(true); } else { return(false); } }
// Use this for initialization void Start() { roomContraller = FindObjectOfType <RoomContraller>(); eventController = FindObjectOfType <EventController>(); this.guangBoListener = FindObjectOfType <GuangBoListener>(); player = FindObjectOfType <Player>(); nolan = FindObjectOfType <Nolan>(); ben = FindObjectOfType <Ben>(); kate = FindObjectOfType <Kate>(); martin = FindObjectOfType <Martin>(); jessie = FindObjectOfType <Jessie>(); if (newOrLoad) { //目前是写死。。后面需要改为程序控制添加 游戏人数 setEndRound(player); setEndRound(nolan); setEndRound(ben); setEndRound(jessie); setEndRound(kate); setEndRound(martin); roundCount = 1; player.setActionPointrolled(true); } else { Debug.Log("laod this game round begin "); string datapath = Application.persistentDataPath + "/Save/SaveData0.sav"; SaveData data = (SaveData)IOHelper.GetData(datapath, typeof(SaveData)); // foreach (string name in data.CharaNames) // player.setActionPointrolled(data.P6.ActionPointrolled); setEndRound(player); setEndRound(nolan); Debug.Log("nolan is dead? " + nolan.isDead()); setEndRound(ben); setEndRound(jessie); setEndRound(kate); setEndRound(martin); roundCount = data.RoundCount; Debug.Log("laod this game round end "); } // Debug.Log(playChara.getName() + " round this game"); if (player.isPlayer()) { this.playerChara = player; } else if (nolan.isPlayer()) { this.playerChara = nolan; } else if (ben.isPlayer()) { this.playerChara = ben; } else if (kate.isPlayer()) { this.playerChara = kate; } else if (martin.isPlayer()) { this.playerChara = martin; } else if (jessie.isPlayer()) { this.playerChara = jessie; } isRoundEnd = false; playChara = this.getNextCharecter(); Debug.Log(playChara.getName() + " begin load round this game"); }