Exemplo n.º 1
0
        private bool LinearSlice(Pair2D slice)
        {
            if (sliceJoints)
            {
                Slicer2D.Controller.Joints.LinearSliceJoints(slice);
            }

            List <Slice2D> results = Slicing.LinearSliceAll(slice, sliceLayer);
            bool           result  = false;

            foreach (Slice2D id in results)
            {
                if (id.GetGameObjects().Count > 0)
                {
                    result = true;
                }

                eventHandler.Perform(id);
            }

            if (addForce == true)
            {
                foreach (Slice2D id in results)
                {
                    AddForce.LinearSlice(id, addForceAmount);
                }
            }

            return(result);
        }
Exemplo n.º 2
0
    private bool LinearSlice(Pair2D slice)
    {
        if (sliceJoints)
        {
            LinearSliceJoints(slice);
        }

        List <Slice2D> results = Slicer2D.LinearSliceAll(slice, sliceLayer);
        bool           result  = false;

        foreach (Slice2D id in results)
        {
            if (id.gameObjects.Count > 0)
            {
                result = true;
            }

            if (sliceResultEvent != null)
            {
                sliceResultEvent(id);
            }
        }

        if (addForce == true)
        {
            foreach (Slice2D id in results)
            {
                AddForce.LinearSlice(id, addForceAmount);
            }
        }

        return(result);
    }