public DragPointsInspectorHelper(IMainRenderableComponent mainComponent, IDragPointsInspector dragPointsInspector) { _mb = mainComponent as MonoBehaviour; _mainComponent = mainComponent; _dragPointsInspector = dragPointsInspector; _playfieldComponent = mainComponent.gameObject.GetComponentInParent <PlayfieldComponent>();; DragPointsHandler = new DragPointsHandler(mainComponent, _dragPointsInspector); }
public void UpdateDragPoint(IDragPointsInspector editable, Transform transform) { var dragpointPos = transform.worldToLocalMatrix.MultiplyPoint(WorldPos); dragpointPos -= editable.EditableOffset; dragpointPos -= editable.GetDragPointOffset(IndexRatio); DragPoint.Center = dragpointPos.ToVertex3D(); }
/// <summary> /// Every DragPointsInspector instantiates this to manage its curve handling. /// </summary> /// <param name="mainComponent">The renderable main component, to retrieve IsLocked.</param> /// <param name="dragPointsInspector"></param> /// <exception cref="ArgumentException"></exception> public DragPointsHandler(IMainRenderableComponent mainComponent, IDragPointsInspector dragPointsInspector) { MainComponent = mainComponent; DragPointInspector = dragPointsInspector; Transform = mainComponent.gameObject.transform; _sceneViewHandler = new DragPointsSceneViewHandler(this) { CurveWidth = 10.0f, CurveColor = Color.blue, CurveSlingShotColor = Color.red, ControlPointsSizeRatio = 1.0f, CurveTravellerSizeRatio = 0.75f }; }
private static DragPointData RetrieveDragPoint(IDragPointsInspector inspector, int controlId) { return(inspector?.DragPointsHelper.GetDragPoint(controlId)); }