public void ActiveFood(int index, slFoodProperties foodProperties, slFoodPresentation foodPresentation, Vector3 position, Color color, float power) { m_Index = index; m_State = State.Idle; gameObject.SetActive(true); m_Properties = foodProperties; m_RemainLifeTime = hwmRandom.RandFloat(m_Properties.MinLifeTime, m_Properties.MaxLifeTime); m_Presentation = foodPresentation; SetPosition(position); OwnerQuadtree = slWorld.GetInstance().GetFoodSystem().GetQuadtree(); AABB = hwmBox2D.BuildAABB(transform.localPosition, new Vector2(m_Properties.Radius, m_Properties.Radius)); OwnerQuadtree.UpdateElement(this); m_Power = power; }
public void UpdateQuadtree() { Box = hwmBox2D.BuildAABB(m_Position, Extent); AABB = m_Rotation * Box; OwnerQuadtree.UpdateElement(this); }
protected virtual void UpdateQuadtree() { AABB = hwmBox2D.BuildAABB(m_Position, new Vector2(Radius, Radius)); OwnerQuadtree.UpdateElement(this); }