コード例 #1
0
        public static ShapeRenderer UpdateShapeProperty(ShapeRenderer renderer, ShapeProperty property)
        {
            switch (property.shapeType)
            {
            case ShapeType.Circle:
                ((CircleRenderer)renderer).property = (CircleProperty)property;
                break;

            case ShapeType.Line:
                ((LineRenderer)renderer).property = (LineProperty)property;
                break;

            case ShapeType.Rect:
                ((RectRenderer)renderer).property = (RectProperty)property;
                break;

            default:
                break;
            }
            return(renderer);
        }
コード例 #2
0
        public static ShapeRenderer InstantiateShape(ShapeProperty property)
        {
            ShapeRenderer shape = null;

            switch (property.shapeType)
            {
            case ShapeType.Circle:
                shape = InstantiateCircle((CircleProperty)property);
                break;

            case ShapeType.Line:
                shape = InstantiateLine((LineProperty)property);
                break;

            case ShapeType.Rect:
                shape = InstantiateRect((RectProperty)property);
                break;

            default:
                break;
            }
            return(shape);
        }