//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public HoverkeyBuilderKeyInfo(KeyCode pDefaultKey, HoverkeyItemLabels.KeyActionType pActionType, string pDefaultLabel) { ID = "Hoverkey-" + pDefaultKey; ItemType = HoverItem.HoverItemType.Selector; ActionType = pActionType; DefaultKey = pDefaultKey; DefaultLabel = pDefaultLabel; HasShiftLabel = false; ShiftLabel = null; RelativeSizeX = 1; }
/*--------------------------------------------------------------------------------------------*/ private GameObject BuildRowItem(GameObject pRowGo, string pId, string pLabel, HoverItem.HoverItemType pType) { var itemGo = new GameObject("Item" + pLabel); itemGo.transform.SetParent(pRowGo.transform, false); HoverItemBuilder build = itemGo.AddComponent <HoverItemBuilder>(); build.ItemType = pType; build.ButtonRendererPrefab = ButtonRendererPrefab; build.SliderRendererPrefab = SliderRendererPrefab; build.PerformBuild(); itemGo.AddComponent <HoverShapeRect>(); HoverItemData data = itemGo.GetComponent <HoverItemData>(); data.Id = pId; data.Label = pLabel; return(itemGo); }
/*--------------------------------------------------------------------------------------------*/ private void TryRebuildWithItemType(HoverItem.HoverItemType pType) { if (pType == HoverItem.HoverItemType.Slider) { Controllers.Set(ButtonRendererName, this); Controllers.Unset(SliderRendererName, this); RendererUtil.DestroyRenderer(ButtonRenderer); ButtonRenderer = null; SliderRenderer = (SliderRenderer ?? FindOrBuildSlider()); IsButtonRendererType = false; } else { Controllers.Set(SliderRendererName, this); Controllers.Unset(ButtonRendererName, this); RendererUtil.DestroyRenderer(SliderRenderer); SliderRenderer = null; ButtonRenderer = (ButtonRenderer ?? FindOrBuildButton()); IsButtonRendererType = true; } }
/*--------------------------------------------------------------------------------------------*/ public HoverkeyBuilderKeyInfo Sticky() { ItemType = HoverItem.HoverItemType.Sticky; return(this); }
/*--------------------------------------------------------------------------------------------*/ public HoverkeyBuilderKeyInfo Checkbox() { ItemType = HoverItem.HoverItemType.Checkbox; return(this); }