/// <summary> /// Hit Add button, so finished slicing /// </summary> /// <param name="g"></param> public void AddSlices(Graspable g) { controlKnob.callOnUpdate = null; controlKnob.clickUpAction = null; if (currrentSliceTarget) { addedItems[currrentSliceTarget.name] = currrentSliceTarget.SliceCount; if (dropInfo) { dropInfo.SetText("Added " + currrentSliceTarget.SliceCount + " slices"); dropInfo.ShowFor(1f); LeanTween.delayedCall(1f, () => { baguetteSlicesPrep.Show(); activeMenu = true; }); } currrentSliceTarget.Show(false); currrentSliceTarget = null; } else if (dropInfo) { dropInfo.Show(false); } controlKnob.Show(false); addSlicesButton.Show(false); activeMenu = false; }
public override void OnInspectorGUI() { base.OnInspectorGUI(); Sliceable sScript = (Sliceable)target; if (GUILayout.Button("Set begin slice range")) { sScript.SetStartSlicePos(); } else if (GUILayout.Button("Set end slice range")) { sScript.SetEndSlicePos(); } else if (GUILayout.Button("Create slices")) { sScript.EditorMarkSlices(); } if (sScript.chop) { if (GUILayout.Button("Set begin chop range")) { sScript.SetStartChopPos(); } else if (GUILayout.Button("Set end chop range")) { sScript.SetEndChopPos(); } } }
private void HandleProcessingOptions(Sliceable sliceable) { controlKnob.callOnUpdate = KnobControl; currrentSliceTarget = sliceable; controlKnob.Show(true); sliceable.PresentForSlicing(); if (dropInfo) { dropInfo.Show(true); } controlKnob.clickUpAction = KnobReleased; addSlicesButton.Show(true); activeMenu = true; }