示例#1
0
    void Start()
    {
        /* Get and set the cube mesh instance that will be used as the base mesh */
        /* A single mesh used for all cylinders to not break instancing */
        Mesh       mesh       = CubeCreator.Instance.GetCubeMesh();
        MeshFilter meshFilter = gameObject.AddComponent <MeshFilter>();

        meshFilter.mesh = mesh;

        /* Initialize the material property block */
        material_block_ = GetComponent <MaterialBlockCylinder>();

        /* Set radius and height */
        SetRadius(radius_);
        SetHeight(height_);
    }