public void LoadBillboards(string pFile) { try { this.Billboards.Clear(); DataSet dataSet = new DataSet(); dataSet.ReadXml(pFile); DataTable dataTable = dataSet.Tables[0]; if (dataTable.Rows.Count > 0) { foreach (DataRow dataRow in dataTable.Rows) { string pName = (string)dataRow[0]; int index = Convert.ToInt32(dataRow[1]); float valueX = CHelper.myToSingle((string)dataRow[2]); float valueY = CHelper.myToSingle((string)dataRow[3]); float num = CHelper.myToSingle((string)dataRow[4]); float pAngleZ = CHelper.myToSingle((string)dataRow[5]); CBillboardMesh pBillboardMesh = this.m_BillboardMeshs[index]; Vector3 position = new Vector3(valueX, valueY, num); CBillboard cBillboard = new CBillboard(this.myTerrain, pName, this.device, pBillboardMesh, position, pAngleZ); if (num == 0f) { cBillboard.Z = this.myTerrain.getZ(cBillboard.Position.X, cBillboard.Position.Y); } this.Billboards.Add(cBillboard); } } } catch { } }
public void Load1Billboard(string pName, int pBillboardIndex, Vector3 pPos, float dHeading) { CBillboardMesh pBillboardMesh = this.m_BillboardMeshs[pBillboardIndex]; CBillboard cBillboard = new CBillboard(this.myTerrain, pName, this.device, pBillboardMesh, pPos, dHeading); cBillboard.Z = this.myTerrain.getZ(cBillboard.Position.X, cBillboard.Position.Y); this.Billboards.Add(cBillboard); }
public CSpinToBB(CThucHanh pThucHanh, string pName, CBillboard pObj, int start, int pduration, Vector3 ptopos, int pisound, bool loop) : base(pThucHanh) { this.Name = pName; this.Obj = pObj; this.StartTickCount = start; this.duration = pduration; this.StopTickCount = this.StartTickCount + this.duration; this.topos = ptopos; this.isound = pisound; this.soundloop = loop; }
public CBillboard GetBillboardByName(string name) { CBillboard result = null; if (this.Billboards.Count > 0) { for (int i = 0; i < this.Billboards.Count; i++) { if (this.Billboards[i].Name.Length == name.Length && this.Billboards[i].Name.ToUpper() == name.ToUpper()) { result = this.Billboards[i]; break; } } } return(result); }