Exemplo n.º 1
0
    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;
    }
Exemplo n.º 2
0
 public void UpdateQuadtree()
 {
     Box  = hwmBox2D.BuildAABB(m_Position, Extent);
     AABB = m_Rotation * Box;
     OwnerQuadtree.UpdateElement(this);
 }
Exemplo n.º 3
0
 protected virtual void UpdateQuadtree()
 {
     AABB = hwmBox2D.BuildAABB(m_Position, new Vector2(Radius, Radius));
     OwnerQuadtree.UpdateElement(this);
 }