public override void UpdateShapeList(BaseShapeDataPasser shape, bool remove) { UpdateShapes(shape, remove); if (shapes != null && intersections.Length != shapes.Length) { intersections = new IntersectionType[Mathf.Max(shapes.Length, 0)]; } UpdateScene(); }
public override void UpdateShapeList(BaseShapeDataPasser shape, bool remove) { UpdateShapes(shape, remove); if (shapes != null && modifiers.Length != shapes.Length) { modifiers = new Modifier[Mathf.Max(shapes.Length, 0)]; } UpdateScene(); }
public override void UpdateShapeList(BaseShapeDataPasser shape, bool remove) { UpdateShapes(shape, remove); if (shapes != null && intersections.Length != shapes.Length) { intersections = new IntersectionRayMarchingMaster.IntersectionType[Mathf.Max(shapes.Length, 0)]; } if (shapes != null && modifiers.Length != shapes.Length) { modifiers = new Modifier[Mathf.Max(shapes.Length, 0)]; } UpdateScene(); }
protected void UpdateShapes(BaseShapeDataPasser shape, bool remove) { if (shapes == null) { shapes = new BaseShapeDataPasser[0]; } int shapeIndex = -1; for (int i = 0; i < shapes.Length; i++) { if (shapes[i] == shape) { shapeIndex = i; break; } } if (remove) { if (shapes.Length > 0) { if (shapeIndex != -1) { BaseShapeDataPasser[] copyList = shapes; shapes = new BaseShapeDataPasser[copyList.Length - 1]; int index = 0; for (int i = 0; i < copyList.Length - 1; i++) { if (i == shapeIndex) { index++; } shapes[i] = copyList[index]; index++; } } } } else { if (shapeIndex != -1) { BaseShapeDataPasser[] copyList = shapes; shapes = new BaseShapeDataPasser[copyList.Length + 1]; copyList.CopyTo(shapes, 0); shapes[copyList.Length] = shape; } } }
public virtual void UpdateShapeList(BaseShapeDataPasser shape, bool remove) { UpdateShapes(shape, remove); UpdateScene(); }