コード例 #1
0
ファイル: DebugUtil.cs プロジェクト: zcxxv1213/Bullet
        // ------------------------------------------------------------------------
        // end: circle


        // cylinder
        // ------------------------------------------------------------------------


        public static void DrawCylinder(Vector3 center, Quaternion rotation, float height, float radius, int numSegments, Color color, bool depthTest = true)
        {
            Mesh mesh = PrimitiveMeshFactory.Cylinder(numSegments);

            if (mesh == null)
            {
                return;
            }

            Material material = GetMaterial(depthTest);
            MaterialPropertyBlock materialProperties = GetMaterialPropertyBlock();

            materialProperties.SetColor("_Color", color);
            materialProperties.SetVector("_Dimensions", new Vector4(radius, radius, radius, height));

            Graphics.DrawMesh(mesh, center, rotation, material, 0, null, 0, materialProperties, false, false, false);
        }