/// <summary> /// 获取出现详情 是否结婚 /// </summary> /// <param name="gameData"></param> /// <param name="conditionData"></param> /// <returns></returns> protected static ShowConditionBean GetConditionDetailsForIsMarry(GameDataBean gameData, ShowConditionBean conditionData) { FamilyDataBean familyData = gameData.GetFamilyData(); if (familyData.CheckMarry(gameData.gameTime)) { conditionData.isCondition = true; } else { conditionData.isCondition = false; } return(conditionData); }
/// <summary> /// 创建家族成员 /// </summary> /// <param name="characterForFamily"></param> public void CreateFamilyCharacter(CharacterForFamilyBean characterForFamily) { if (characterForFamily == null) { return; } FamilyTypeEnum familyType = characterForFamily.GetFamilyType(); GameDataBean gameData = GameDataHandler.Instance.manager.GetGameData(); FamilyDataBean familyData = gameData.GetFamilyData(); if (familyType == FamilyTypeEnum.Daughter || familyType == FamilyTypeEnum.Son) { //如果是女儿或者儿子 需要3年后才能移动 if (!characterForFamily.CheckIsGrowUp(gameData.gameTime)) { return; } } else if (familyType == FamilyTypeEnum.Mate) { //如果是伴侣需要结婚日之后才刷新 if (!familyData.CheckMarry(gameData.gameTime)) { return; } } //获取门的坐标 并在门周围生成NPC Vector3 doorPosition = InnHandler.Instance.GetRandomEntrancePosition(); //向下3个单位 doorPosition += new Vector3(0, -3f, 0); GameObject objFamily = BuildNpc(listHideNpc, objNormalModel, characterForFamily, doorPosition); if (objFamily == null) { return; } NpcAIFamilyCpt npcAIFamily = objFamily.GetComponent <NpcAIFamilyCpt>(); listFamilyCharacter.Add(npcAIFamily); }