Example #1
0
    bool SliceIntesectEdges(List <Vector2D> slice)
    {
        foreach (ThinSliceEdge edge in ThinSliceEdge.GetList())
        {
            Polygon2D edgePolygon = Polygon2D.CreateFromCollider(edge.gameObject);
            if (Math2D.SliceIntersectSlice(slice, edgePolygon.ToWorldSpace(edge.transform).pointsList))
            {
                return(true);
            }
        }

        return(false);
    }
Example #2
0
    // Triggered On Every Successful Slice
    void AfterSlice(Slice2D sliceResult)
    {
        GameObject CutObject = GetCutGameObject(sliceResult);

        if (CutObject != null)
        {
            ExplodePolygon(CutObject);
        }

        // Destroy Edge If It Does Not Intersect With Level
        foreach (ThinSliceEdge edge in ThinSliceEdge.GetList())
        {
            if (edge.ItersectsWithMap() == false)
            {
                Destroy(edge.gameObject);
            }
        }

        ThinSliceGameManager.instance.UpdateText();
    }