public override void LoadTable(string _path) { try { if( (null != AssetbundleManager.Instance && true == AssetbundleManager.Instance.useAssetbundle) || true == AsTableManager.Instance.useReadBinary ) { // Ready Binary TextAsset textAsset = ResourceLoad.LoadTextAsset( _path); MemoryStream stream = new MemoryStream( textAsset.bytes); BinaryReader br = new BinaryReader( stream); int nCount = br.ReadInt32(); for( int i = 0; i < nCount; i++) { Tbl_PetScript_Record record = new Tbl_PetScript_Record( br); m_ResourceTable.Add(record.GroupID, record); } br.Close(); stream.Close(); } else { XmlElement root = GetXmlRootElement(_path); XmlNodeList nodes = root.ChildNodes; foreach(XmlNode node in nodes) { Tbl_PetScript_Record record = new Tbl_PetScript_Record((XmlElement)node); m_ResourceTable.Add(record.GroupID, record); } } } catch(System.Exception e) { Debug.LogError(e); } }
void SendScriptWord(Tbl_PetScript_Record.eType _type) { if(isPetExist == true) { Tbl_PetScript_Record scriptRec = AsTableManager.Instance.GetPetScriptRecord(m_PetInfo.nPersonality); string word = scriptRec.GetScriptString(_type); AsEntityManager.Instance.MessageToPlayer(new Msg_Pet_Script( word)); } }