public static GameObject[] SliceInstantiate(this GameObject obj, Vector3 position, Vector3 direction, TextureRegion cuttingRegion, Material crossSectionMaterial = null) { SliceFramework.Plane cuttingPlane = new SliceFramework.Plane(); Vector3 refUp = obj.transform.InverseTransformDirection(direction); Vector3 refPt = obj.transform.InverseTransformPoint(position); cuttingPlane.Compute(refPt, refUp); return(SliceInstantiate(obj, cuttingPlane, cuttingRegion, crossSectionMaterial)); }
public void OnDrawGizmos() { SliceFramework.Plane cuttingPlane = new SliceFramework.Plane(); cuttingPlane.Compute(transform); cuttingPlane.OnDebugDraw(); }