public void OnValueChangeAttr(HoverItemDataSlider slider) { GameObject ForceDir = GameObject.Find("ForceDirectedGrapher"); ForceDirectedGraph ForceDirScript = ForceDir.GetComponent <ForceDirectedGraph>(); ForceDirScript.Pullspeed = slider.RangeValue; }
public void OnValueChange(HoverItemDataSlider slider) { GameObject Grapher = GameObject.Find("ForceDirectedGrapher"); ForceDirectedGraph GrapherScript = Grapher.GetComponent <ForceDirectedGraph>(); GrapherScript.IdealConnectedDistance = slider.RangeValue; }
public void OnValueChangeRadius(HoverItemDataSlider slider) { GameObject ForceDir = GameObject.Find("ForceDirectedGrapher"); ForceDirectedGraph ForceDirScript = ForceDir.GetComponent <ForceDirectedGraph>(); ForceDirScript.MaxRepelDistance = slider.RangeValue; }
public void updatePosition(HoverItemDataSlider slider) { float v = slider.Value; Debug.Log("updating slider, value: " + v); UpdateMeshTexture(v); //1.0 = 0.0%, 0.0 = 100.0%; }
/*--------------------------------------------------------------------------------------------*/ public void TreeUpdate() { HoverItemDataSlider slider = GetComponent <HoverItemDataSlider>(); Color col = DisplayUtil.HsvToColor(slider.RangeValue, 1, 0.666f); UpdateButtonsColor(col); UpdateTrackColor(col); }
/*--------------------------------------------------------------------------------------------*/ private void BuildRowSliderItem(GameObject pRowGo, string pId, string pLabel) { GameObject sliderItemGo = BuildRowItem(pRowGo, "Row2-ItemA", "BA", HoverItem.HoverItemType.Slider); HoverLayoutArcRelativeSizer sliderSizer = sliderItemGo.AddComponent <HoverLayoutArcRelativeSizer>(); sliderSizer.RelativeArcDegrees = 3; HoverItemDataSlider data = sliderItemGo.GetComponent <HoverItemDataSlider>(); data.Value = 0.825f; data.Ticks = 5; data.AllowJump = true; }
public void OnValueChangeNeg(HoverItemDataSlider slider) { GameObject DataImportObject = GameObject.Find("DataImportObject"); DataImporter DataImportScript = DataImportObject.GetComponent <DataImporter>(); GameObject ForceDir = GameObject.Find("ForceDirectedGrapher"); ForceDirectedGraph ForceDirScript = ForceDir.GetComponent <ForceDirectedGraph>(); Color NegCol = Color.HSVToRGB(slider.RangeValue, 1, 1); string[][] ParsedData = DataImportScript.ParsedData; float DEGvalue; List <GameObject> spheres = ForceDirScript.spheres; for (int i = 0; i < ParsedData.GetLength(0) - 1; i++) { float.TryParse(ParsedData[i + 1][3], out DEGvalue); if (DEGvalue < 0) { spheres[i].GetComponent <Renderer>().material.color = NegCol; } } }
/*--------------------------------------------------------------------------------------------*/ private void UpdateSliderSettings(HoverItem pHoverItem, HoverItemHighlightState pHighState) { HoverItemDataSlider data = (HoverItemDataSlider)pHoverItem.Data; HoverItemHighlightState.Highlight?high = pHighState.NearestHighlight; float highProg = pHighState.MaxHighlightProgress; bool isNearest = pHighState.IsNearestAcrossAllItemsForAnyCursor; SliderRenderer.Controllers.Set(HoverRendererSlider.JumpValueName, this); SliderRenderer.Controllers.Set(HoverRendererSlider.ShowButtonEdgesName, this); SliderRenderer.ShowButtonEdges = (isNearest && highProg > 0); if (high == null || highProg <= 0 || !isNearest) { data.HoverValue = null; SliderRenderer.JumpValue = -1; return; } float value = SliderRenderer.GetValueViaNearestWorldPosition(high.Value.NearestWorldPos); data.HoverValue = value; float snapValue = (float)data.SnappedHoverValue; //float easePower = (1-high.Value.Progress)*5+1; //gets "snappier" as you pull away float showValue = DisplayUtil.GetEasedValue(data.Snaps, value, snapValue, 3); SliderRenderer.JumpValue = showValue; if (data.IsStickySelected) { data.Value = value; SliderRenderer.Controllers.Set(HoverRendererSlider.HandleValueName, this); SliderRenderer.HandleValue = showValue; } }
/*--------------------------------------------------------------------------------------------*/ private void DrawMainItems() { EditorGUILayout.PropertyField(serializedObject.FindProperty("_Id"), new GUIContent("ID")); EditorGUILayout.PropertyField(serializedObject.FindProperty("_Label")); EditorGUILayout.PropertyField(serializedObject.FindProperty("_IsEnabled")); //// HoverItemDataSelector selectorData = (vData as HoverItemDataSelector); HoverItemDataCheckbox checkboxData = (vData as HoverItemDataCheckbox); HoverItemDataRadio radioData = (vData as HoverItemDataRadio); HoverItemDataSlider sliderData = (vData as HoverItemDataSlider); HoverItemDataSticky stickyData = (vData as HoverItemDataSticky); if (selectorData != null) { EditorGUILayout.PropertyField(serializedObject.FindProperty("_Action")); } else if (checkboxData != null) { EditorGUILayout.PropertyField(serializedObject.FindProperty("_Value"), new GUIContent("Checkbox Value")); } else if (radioData != null) { EditorGUILayout.PropertyField(serializedObject.FindProperty("_GroupId"), new GUIContent("Radio Group ID")); EditorGUILayout.PropertyField(serializedObject.FindProperty("_Value"), new GUIContent("Radio Value")); } else if (sliderData != null) { EditorGUILayout.PropertyField(serializedObject.FindProperty("_LabelFormat"), new GUIContent("Slider Label Format")); EditorGUILayout.PropertyField(serializedObject.FindProperty("_RangeMin"), new GUIContent("Slider Range Min")); EditorGUILayout.PropertyField(serializedObject.FindProperty("_RangeMax"), new GUIContent("Slider Range Max")); float rangeValue = Mathf.Lerp( sliderData.RangeMin, sliderData.RangeMax, sliderData.Value); rangeValue = EditorGUILayout.Slider( "Slider Range Value", rangeValue, sliderData.RangeMin, sliderData.RangeMax); serializedObject.FindProperty("_Value").floatValue = Mathf.InverseLerp(sliderData.RangeMin, sliderData.RangeMax, rangeValue); EditorGUILayout.PropertyField(serializedObject.FindProperty("_Ticks"), new GUIContent("Slider Ticks")); EditorGUILayout.PropertyField(serializedObject.FindProperty("_Snaps"), new GUIContent("Slider Snaps")); EditorGUILayout.PropertyField(serializedObject.FindProperty("_AllowJump"), new GUIContent("Slider Allow Jump")); EditorGUILayout.PropertyField(serializedObject.FindProperty("_FillStartingPoint"), new GUIContent("Slider Fill Starting-Point")); EditorGUILayout.PropertyField(serializedObject.FindProperty("_AllowIdleDeselection"), new GUIContent("Allow Idle Deselection")); } else if (stickyData != null) { EditorGUILayout.PropertyField(serializedObject.FindProperty("_AllowIdleDeselection"), new GUIContent("Allow Idle Deselection")); } }
// Use this for initialization void Start() { hoverItemDataSlider = slider.GetComponent <HoverItemDataSlider>(); samplePlayerController = headMountedRig.GetComponent <SamplePlayerController>(); ResetPlayerMovementSpeed(); }