void Prepare() { state = protocolState.PREPARE; StartCoroutine(downloadXml(m_xmlExpList, "ExpInfo.xml")); StartCoroutine(downloadXml(m_xmlMonsterInfoList , "MonsterInfoList.xml")); StartCoroutine(downloadXml(m_xmlCharacterInfoList , "CharacterInfoList.xml")); StartCoroutine(downloadXml(m_xmlSettingList , "GameSetting.xml")); StartCoroutine(downloadXml(m_xmlMapContentList , "MapContentList.xml")); StartCoroutine(downloadXml(m_xmlKnowedBlockList, "KnowedBlockList.xml")); }
// Update is called once per frame void Update() { switch (state) { case protocolState.PREPARE: if (checkFinishDownloads == 6) { loadMonsterInfo(); loadExpInfo(); loadCharacterInfo(); state = protocolState.READY; } break; case protocolState.READY: break; default: break; } }
public void Init() { state = protocolState.INIT; m_xmlMonsterInfoList = new XmlDocument(); m_xmlCharacterInfoList = new XmlDocument(); m_xmlMapContentList = new XmlDocument(); m_xmlKnowedBlockList = new XmlDocument(); m_xmlExpList = new XmlDocument(); m_xmlSettingList = new XmlDocument(); checkFinishDownloads = 0; Prepare(); }