示例#1
0
        private void HandleBombSites()
        {
            SendTableParser.FindByName("CCSPlayerResource").OnNewEntity += (s1, newResource) => {
                newResource.Entity.FindProperty("m_bombsiteCenterA").VectorRecived += (s2, center) => {
                    bombsiteACenter = center.Value;
                };
                newResource.Entity.FindProperty("m_bombsiteCenterB").VectorRecived += (s3, center) => {
                    bombsiteBCenter = center.Value;
                };
            };

            SendTableParser.FindByName("CBaseTrigger").OnNewEntity += (s1, newResource) => {
                BoundingBoxInformation trigger = new BoundingBoxInformation(newResource.Entity.ID);
                triggers.Add(trigger);

                newResource.Entity.FindProperty("m_Collision.m_vecMins").VectorRecived += (s2, vector) => {
                    trigger.Min = vector.Value;
                };

                newResource.Entity.FindProperty("m_Collision.m_vecMaxs").VectorRecived += (s3, vector) => {
                    trigger.Max = vector.Value;
                };
            };
        }
示例#2
0
		private void HandleBombSites()
		{
			SendTableParser.FindByName("CCSPlayerResource").OnNewEntity += (s1, newResource) => {
				newResource.Entity.FindProperty("m_bombsiteCenterA").VectorRecived += (s2, center) => {
					bombsiteACenter = center.Value;
				};
				newResource.Entity.FindProperty("m_bombsiteCenterB").VectorRecived += (s3, center) => {
					bombsiteBCenter = center.Value;
				};
			};

			SendTableParser.FindByName("CBaseTrigger").OnNewEntity += (s1, newResource) => {

				BoundingBoxInformation trigger = new BoundingBoxInformation(newResource.Entity.ID);
				triggers.Add(trigger);

				newResource.Entity.FindProperty("m_Collision.m_vecMins").VectorRecived += (s2, vector) => {
					trigger.Min = vector.Value;
				};

				newResource.Entity.FindProperty("m_Collision.m_vecMaxs").VectorRecived += (s3, vector) => {
					trigger.Max = vector.Value;
				};
			};

		}