示例#1
0
	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_Pet_Record record = new Tbl_Pet_Record( br);
					m_ResourceTable.Add(record.Index, record);
				}
				
				br.Close();
				stream.Close();
			}
			else
			{
				XmlElement root = GetXmlRootElement(_path);
				XmlNodeList nodes = root.ChildNodes;
				
				foreach(XmlNode node in nodes)
				{
					Tbl_Pet_Record record = new Tbl_Pet_Record((XmlElement)node);
					m_ResourceTable.Add(record.Index, record);
				}
			}
		}
		catch(System.Exception e)
		{
			Debug.LogError(e);
		}
	}
示例#2
0
	public PetListElement(body2_SC_PET_LIST _list)
	{
		m_PetTableIdx = _list.nPetTableIdx;
		m_PetSlot = _list.nPetSlot;
		m_PetName = AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString(_list.szPetName));
		m_Level = _list.nLevel;

		if(m_PetTableIdx > 0)
			m_PetRecord = AsTableManager.Instance.GetPetRecord(m_PetTableIdx);
	}
示例#3
0
	public void ChangeElement(body_SC_PET_SLOT_CHANGE _change)
	{
		m_PetTableIdx = _change.nPetTableIdx;
		m_PetSlot = _change.nPetSlot;
		m_PetName = AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString(_change.szPetName));
		m_Level = _change.nLevel;

		if(m_PetTableIdx > 0)
			m_PetRecord = AsTableManager.Instance.GetPetRecord(m_PetTableIdx);
	}
示例#4
0
	public void Clear()
	{
		nPetUniqSlot = 0;
		nPetTableIdx = 0;
		nPersonality = 0;
		szPetName = new byte[0];
		nLevel = 0;
		nExp = 0;
		
		sSkill = new sPETSKILL[(int)ePET_SKILL_TYPE.ePET_SKILL_TYPE_MAX];
		itemView.nItemTableIdx = 0;
		itemView.nStrengthenCount = 0;
		
		m_PetRecord = null;
	}