//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public void Awake() { vSetup = gameObject.GetComponent<HovercursorSetup>(); vFakeItem = new FakeItemState(); vFakeItem.ItemAutoId = 123; ActiveCursorTypes = new CursorType[0]; }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public void Awake() { vSetup = gameObject.GetComponent<HovercursorSetup>(); vFakeItem = new FakeItemState(); vFakeItem.ItemAutoId = 123; vActiveCursorTypes = new ReadList<CursorType>(); ActiveCursorTypes = vActiveCursorTypes.ReadOnly; vFakeInteractions = new ReadOnlyCollection<IBaseItemInteractionState>( new List<IBaseItemInteractionState>()); vFakePlanes = new ReadOnlyCollection<PlaneData>(new List<PlaneData>()); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public void Awake() { ItemHierarchy = UnityUtil.FindComponentOrFail(ItemHierarchy, Domain); Hovercursor = UnityUtil.FindComponentOrFail(Hovercursor, Domain); DefaultItemVisualSettings = UnityUtil.CreateComponent<HovercastItemVisualSettings, HovercastItemVisualSettingsStandard>(DefaultItemVisualSettings, gameObject, Domain); DefaultItemVisualSettings.IsDefaultSettingsComponent = true; InteractionSettings = UnityUtil.FindComponentOrCreate<HovercastInteractionSettings, HovercastInteractionSettings>(InteractionSettings, gameObject, Domain); Input = UnityUtil.FindComponentOrFail(Input, Domain); vState = new HovercastState(ItemHierarchy.GetRoot(), Hovercursor, InteractionSettings.GetSettings(), Input, gameObject.transform); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public HoverboardState(ItemPanel[] pItemPanels, HovercursorSetup pHovercusorSetup, InteractionSettings pInterSett, Transform pBaseTx) { vInteractSett = pInterSett; vHovercusorSetup = pHovercusorSetup; vBaseTx = pBaseTx; vProjectionMap = new ListMap<CursorType, ProjectionState>(EnumIntKeyComparer.CursorType); //// var panels = new List<PanelState>(); var allItems = new List<ItemTree>(); foreach ( ItemPanel itemPanel in pItemPanels ) { var panel = new PanelState(itemPanel, vInteractSett); panel.InteractionPlane = new PlaneData("Hoverboard.Panel-"+panels.Count, ((GameObject)panel.ItemPanel.DisplayContainer).transform, Vector3.up); panels.Add(panel); foreach ( LayoutState layout in panel.FullLayouts ) { layout.ItemLayout.SetRadioSiblingsFunc(GetRadioSiblings); foreach ( BaseItemState item in layout.FullItems ) { var tree = new ItemTree { Panel = panel, Layout = layout, Item = item }; allItems.Add(tree); } } } vAllItems = allItems.ToArray(); vActiveItems = new List<ItemTree>(); vActiveCursorInteractions = new ReadList<IBaseItemInteractionState>(); vActiveCursorPlanes = new ReadList<PlaneData>(); FullPanels = panels.ToArray(); Panels = new ReadOnlyCollection<IHoverboardPanelState>(FullPanels); ActiveCursorTypes = new ReadOnlyCollection<CursorType>(vInteractSett.Cursors); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public void Awake() { Panels = UnityUtil.FindComponentsOrFail(Panels, Domain); Hovercursor = UnityUtil.FindComponentOrFail(Hovercursor, Domain); DefaultItemVisualSettings = UnityUtil.CreateComponent<HoverboardItemVisualSettings, HoverboardItemVisualSettingsStandard>(DefaultItemVisualSettings, gameObject, Domain); DefaultItemVisualSettings.IsDefaultSettingsComponent = true; ProjectionVisualSettings = UnityUtil.FindComponentOrCreate< HoverboardProjectionVisualSettings, HoverboardProjectionVisualSettingsStandard>( ProjectionVisualSettings,gameObject,Domain); InteractionSettings = UnityUtil.FindComponentOrCreate<HoverboardInteractionSettings, HoverboardInteractionSettings>(InteractionSettings, gameObject, Domain); vState = new HoverboardState(Panels.Select(x => x.GetPanel()).ToArray(), Hovercursor, InteractionSettings.GetSettings(), gameObject.transform); vPrevActiveCursorTypes = new CursorType[0]; vProjMap = new Dictionary<CursorType, UiProjection>(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public HovercastState(IItemHierarchy pItemHierarchy, HovercursorSetup pHovercusorSetup, InteractionSettings pInterSett, IInput pInput, Transform pBaseTx) { vInteractSettings = pInterSett; vHovercursorSetup = pHovercusorSetup; vInput = pInput; BaseTransform = pBaseTx; FullMenu = new MenuState(pItemHierarchy, vInteractSettings); vActiveCursorInteractions = new ReadList<IBaseItemInteractionState>(); vMenuPlanes = new ReadList<PlaneData>(); vActiveCursorTypes = new ReadList<CursorType>(); ActiveCursorTypes = vActiveCursorTypes.ReadOnly; vLeftCursorConvertMap = new Dictionary<HovercastCursorType, CursorType>(HovercastCursorTypeComparer); vLeftCursorConvertMap.Add(HovercastCursorType.Palm, CursorType.LeftPalm); vLeftCursorConvertMap.Add(HovercastCursorType.Thumb, CursorType.LeftThumb); vLeftCursorConvertMap.Add(HovercastCursorType.Index, CursorType.LeftIndex); vLeftCursorConvertMap.Add(HovercastCursorType.Middle, CursorType.LeftMiddle); vLeftCursorConvertMap.Add(HovercastCursorType.Ring, CursorType.LeftRing); vLeftCursorConvertMap.Add(HovercastCursorType.Pinky, CursorType.LeftPinky); vLeftCursorConvertMap.Add(HovercastCursorType.Look, CursorType.Look); vRightCursorConvertMap = new Dictionary<HovercastCursorType, CursorType>(HovercastCursorTypeComparer); vRightCursorConvertMap.Add(HovercastCursorType.Palm, CursorType.RightPalm); vRightCursorConvertMap.Add(HovercastCursorType.Thumb, CursorType.RightThumb); vRightCursorConvertMap.Add(HovercastCursorType.Index, CursorType.RightIndex); vRightCursorConvertMap.Add(HovercastCursorType.Middle, CursorType.RightMiddle); vRightCursorConvertMap.Add(HovercastCursorType.Ring, CursorType.RightRing); vRightCursorConvertMap.Add(HovercastCursorType.Pinky, CursorType.RightPinky); vRightCursorConvertMap.Add(HovercastCursorType.Look, CursorType.Look); OnSideChange += (() => {}); }