Пример #1
0
    void Start()
    {
        //GetComponent<MeshFilter>().sharedMesh.MarkDynamic();

        if (Mathf.Abs(cubeWidth) < 0.0001f)
        {
            cubeWidth = 0.0001f;
        }
        if (Mathf.Abs(cubeHeight) < 0.0001f)
        {
            cubeHeight = 0.0001f;
        }
        if (Mathf.Abs(cubeDepth) < 0.0001f)
        {
            cubeDepth = 0.0001f;
        }

        if (inputMesh != null)
        {
            shape = Shape.CreateShapeFromMesh(inputMesh);
        }
        else
        {
            shape = CubeShape.CreateCubeShape(1, false, new Vector3(cubeWidth, cubeHeight, cubeDepth));
        }


        output = new DestructionVertexData();
        output.prepareVertexData(numVertices);

        iterativeStack = new DestructionEffectIterative.AppendConsumeStack();
        iterativeStack.prepareStack(numVertices / 6);
    }