void Reset() { if (slider == null) { slider = GetComponent <InteractionSlider>(); } if (sliderGraphic == null) { sliderGraphic = slider.GetComponent <LeapGraphic>(); if (sliderGraphic == null) { sliderGraphic = slider.GetComponentInChildren <LeapGraphic>(); } } if (panelGraphic == null && slider.transform.parent != null) { panelGraphic = slider.transform.parent.GetComponentInParent <LeapGraphic>(); } panelGraphicColor = new Color(0.86F, 0.86F, 0.86F); panelDepressedColor = new Color(0.86F, 0.86F, 0.86F); panelDisabledColor = new Color(0.60F, 0.60F, 0.60F); panelTint = Color.white; sliderGraphicColor = new Color(1.00F, 1.00F, 1.00F); sliderDepressedColor = new Color(0.60F, 0.60F, 0.60F); sliderDisabledColor = new Color(0.80F, 0.80F, 0.80F); sliderTint = Color.white; }
protected virtual void Reset() { graphic = GetComponent <LeapGraphic>(); if (palette == null && s_lastPalette != null) { palette = s_lastPalette; } }
private RectTransform ensureGraphicHasRect(LeapGraphic graphic) { var rectTransform = graphic.GetComponent <RectTransform>(); if (rectTransform == null) { initRectTransform(graphic.gameObject); } return(rectTransform); }
void Start() { _intObj = GetComponent <InteractionBehaviour>(); #if LeapGraphicRenderer _graphic = GetComponent <LeapGraphic>(); if (!_graphic) { _graphic = GetComponentInChildren <LeapGraphic>(); } #endif }
private void setGraphicState(bool enabled, LeapGraphic graphic) { //var alpha = enabled ? 1F : 0F; graphic.enabled = enabled; //if (graphic is LeapTextGraphic) { // var text = graphic as LeapTextGraphic; // text.color = text.color.WithAlpha(alpha); //} //else { // //graphic.SetRuntimeTint(graphic.GetRuntimeTint().WithAlpha(alpha)); //} }
// Uncomment to enable the tool. //[MenuItem("One-Time/Convert LGPC to GPC")] //private static void Convert() { // List<LeapGraphicPaletteController> lgpcs = new List<LeapGraphicPaletteController>(); // foreach (var lgpcArr in EditorSceneManager // .GetActiveScene() // .GetRootGameObjects() // .Query() // .Select(g => g.GetComponentsInChildren<LeapGraphicPaletteController>(true))) { // foreach (var lgpc in lgpcArr) { // lgpcs.Add(lgpc); // } // }; // foreach (var lgpc in lgpcs) { // ConvertLGPC(lgpc); // } // Debug.Log("Converted!"); //} private static void ConvertLGPC(ZZOLD_LeapGraphicPaletteController lgpc) { GameObject obj = lgpc.gameObject; LeapGraphic graphic = lgpc.graphic; ColorPalette palette = lgpc.palette; int idx = lgpc.colorIndex; DestroyImmediate(lgpc); var gpc = obj.AddComponent <GraphicPaletteController>(); gpc.graphic = graphic; gpc.palette = palette; gpc.restingColorIdx = idx; }
public void setGraphicColor(Color color) { if (graphic == null) { graphic = GetComponent <LeapGraphic>(); if (graphic == null) { graphic = GetComponentInParent <LeapGraphic>(); } } if (graphicColor == null) { graphicColor = graphic.GetFeatureData <CustomVectorChannelData>(); } graphicColor.value = color.ToHSV(); }
void Reset() { if (button == null) { button = GetComponent <InteractionButton>(); } if (buttonGraphic == null) { buttonGraphic = button.GetComponent <LeapGraphic>(); if (buttonGraphic == null) { buttonGraphic = button.GetComponentInChildren <LeapGraphic>(); } } buttonGraphicColor = new Color(1.00F, 1.00F, 1.00F); buttonDepressedColor = new Color(0.60F, 0.60F, 0.60F); buttonDisabledColor = new Color(0.80F, 0.80F, 0.80F); buttonTint = Color.white; }
void Reset() { if (toggle == null) { toggle = GetComponent <InteractionToggle>(); } if (toggleGraphic == null) { toggleGraphic = toggle.GetComponent <LeapGraphic>(); if (toggleGraphic == null) { toggleGraphic = toggle.GetComponentInChildren <LeapGraphic>(); } } untoggledColor = new Color(1.00F, 1.00F, 1.00F); depressedColor = new Color(0.60F, 0.60F, 0.60F); toggledColor = new Color(0.75F, 0.75F, 0.75F); disabledColor = new Color(0.80F, 0.80F, 0.80F); toggleTint = Color.white; }
private void deleteMeshGraphic(LeapGraphic graphic) { Destroy(graphic.gameObject); }
public static GraphicCallbackInfo.GraphicInfo OnStart(this LeapGraphic graphic) { return(graphic.GetComponent <GraphicCallbackInfo>().startInfo); }
public static GraphicCallbackInfo.GraphicInfo OnEnable(this LeapGraphic graphic) { return(graphic.GetComponent <GraphicCallbackInfo>().enableInfo); }
private void enableGraphic(LeapGraphic graphic) { setGraphicState(enabled: true, graphic: graphic); }
private void disableGraphic(LeapGraphic graphic) { setGraphicState(enabled: false, graphic: graphic); }
protected virtual void Reset() { button = GetComponent <InteractionButton>(); graphic = GetComponent <LeapGraphic>(); }
private void Reset() { graphic = GetComponent <LeapGraphic>(); }