////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        public PanelState(ItemPanel pItemPanel, InteractionSettings pSettings)
        {
            ItemPanel = pItemPanel;
            vSettings = pSettings;
            DisplayStrength = 1;

            RefreshLayouts();
        }
		////////////////////////////////////////////////////////////////////////////////////////////////
		/*--------------------------------------------------------------------------------------------*/
		public ItemPanel GetPanel() {
			if ( vPanel == null ) {
				vPanel = new ItemPanel(GetChildLayouts);
				vPanel.DisplayContainer = gameObject;
				vPanel.IsEnabled = IsEnabled;
				vPanel.IsVisible = IsVisible;
			}

			return vPanel;
		}
		////////////////////////////////////////////////////////////////////////////////////////////////
		/*--------------------------------------------------------------------------------------------*/
		public void Awake() {
			Component = gameObject.GetComponent<HoverboardPanel>();

			if ( Component == null ) {
				throw new Exception("There must be a "+typeof(HoverboardPanel).Name+
					" component attached to this GameObject.");
			}

			Panel = Component.GetPanel();
		}
Beispiel #4
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        public ItemPanel GetPanel()
        {
            if (vPanel == null)
            {
                vPanel = new ItemPanel(GetChildLayouts);
                vPanel.DisplayContainer = gameObject;
                vPanel.IsEnabled        = IsEnabled;
                vPanel.IsVisible        = IsVisible;
            }

            return(vPanel);
        }
Beispiel #5
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        public void Awake()
        {
            Component = gameObject.GetComponent <HoverboardPanel>();

            if (Component == null)
            {
                throw new Exception("There must be a " + typeof(HoverboardPanel).Name +
                                    " component attached to this GameObject.");
            }

            Panel = Component.GetPanel();
        }
		////////////////////////////////////////////////////////////////////////////////////////////////
		/*--------------------------------------------------------------------------------------------*/
		public PanelState(ItemPanel pItemPanel, InteractionSettings pSettings) {
			ItemPanel = pItemPanel;
			vSettings = pSettings;
			DisplayStrength = 1;
			FullLayouts = new LayoutState[ItemPanel.Layouts.Length];

			for ( int i = 0 ; i < ItemPanel.Layouts.Length ; i++ ) {
				var layout = new LayoutState(ItemPanel.Layouts[i], vSettings);
				FullLayouts[i] = layout;
			}

			Layouts = new ReadOnlyCollection<IHoverboardLayoutState>(FullLayouts);
		}
		////////////////////////////////////////////////////////////////////////////////////////////////
		/*--------------------------------------------------------------------------------------------*/
		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);
		}