internal void OnInspectorGui(BGCurvePointI point, int index, BGCurveSettings settings) { var mode2D = point.Curve.Mode2D; //point transform if (point.Curve.PointsMode != BGCurve.PointsModeEnum.Inlined && point.PointTransform != null) { var referenceToPoint = BGCurveReferenceToPoint.GetReferenceToPoint(point); if (referenceToPoint == null) { point.PointTransform.gameObject.AddComponent <BGCurveReferenceToPoint>().Point = point; } } BGEditorUtility.HorizontalBox(() => { if (editorSelection != null) { editorSelection.InspectorSelectionRect(point); } BGEditorUtility.VerticalBox(() => { BGEditorUtility.SwapLabelWidth(60, () => { if (!settings.ShowPointPosition && !settings.ShowPointControlType) { BGEditorUtility.Horizontal(() => { //nothing to show- only label EditorGUILayout.LabelField("Point " + index); PointButtons(point, index, settings); }); BGEditorUtility.StartIndent(1); } else { //control type if (settings.ShowPointControlType) { BGEditorUtility.Horizontal(() => { point.ControlType = (BGCurvePoint.ControlTypeEnum)EditorGUILayout.EnumPopup("Point " + index, point.ControlType); PointButtons(point, index, settings); }); BGEditorUtility.StartIndent(1); } //position if (settings.ShowPointPosition) { if (!settings.ShowPointControlType) { BGEditorUtility.Horizontal(() => { PositionField("Point " + index, point, mode2D, index); PointButtons(point, index, settings); }); BGEditorUtility.StartIndent(1); } else { PositionField("Pos", point, mode2D, index); } } } }); // control positions if (point.ControlType != BGCurvePoint.ControlTypeEnum.Absent && settings.ShowPointControlPositions) { // 1st ControlField(point, mode2D, 1); // 2nd ControlField(point, mode2D, 2); } //transform if (settings.ShowTransformField) { BGEditorUtility.ComponentField("Transform", point.PointTransform, transform => { if (transform != null) { Undo.RecordObject(transform, "Object moved"); if (point.Curve.PointsMode != BGCurve.PointsModeEnum.Inlined) { Undo.AddComponent <BGCurveReferenceToPoint>(transform.gameObject).Point = point; } } if (point.PointTransform != null) { var referenceToPoint = BGCurveReferenceToPoint.GetReferenceToPoint(point); if (referenceToPoint != null) { Undo.DestroyObjectImmediate(referenceToPoint); } } point.PointTransform = transform; }); } //fields if (point.Curve.FieldsCount > 0) { ShowFields(point); } BGEditorUtility.EndIndent(1); }); }); }