Example #1
0
    // 得到物体变幻形状
    public SceneShape GetTransformShape(Vector2 pos, float radians)
    {
        if (mShapeParam == null)
        {
            mShapeParam       = new SceneShapeParam();
            mShapeParam.mType = ShapeType.ShapeType_Round;
            mShapeParam.mParams.Add(GetRadius());
        }

        if (mTransformShape == null)
        {
            mTransformShape = SceneShapeUtilities.Create(mShapeParam, pos, radians);
        }
        else
        {
            mTransformShape = SceneShapeUtilities.refresh(ref mTransformShape, mShapeParam, pos, radians);
        }

        return(mTransformShape);
    }
Example #2
0
    // 得到物体形状
    public SceneShape GetShape()
    {
        if (mShapeParam == null)
        {
            mShapeParam       = new SceneShapeParam();
            mShapeParam.mType = ShapeType.ShapeType_Round;
            mShapeParam.mParams.Add(GetRadius());
        }

        if (mShape == null)
        {
            mShape = SceneShapeUtilities.Create(mShapeParam, new Vector2(GetPosition().x, GetPosition().z), GetDirection());
        }
        else if (!typeof(BuildObj).IsAssignableFrom(GetType()))
        {
            mShape = SceneShapeUtilities.refresh(ref mShape, mShapeParam, new Vector2(GetPosition().x, GetPosition().z), GetDirection());
        }

        return(mShape);
    }