コード例 #1
0
		////////////////////////////////////////////////////////////////////////////////////////////////
		/*--------------------------------------------------------------------------------------------*/
		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);
		}
コード例 #2
0
		////////////////////////////////////////////////////////////////////////////////////////////////
		/*--------------------------------------------------------------------------------------------*/
		public void Awake() {
			vHoverHierarchy = gameObject.AddComponent<HovercastItemHierarchy>();
			vHoverHierarchy.Title = "Hovercast VR";

			vHoverItems = new HovercastItem[4];

			for ( int i = 0 ; i < vHoverItems.Length ; ++i ) {
				var itemObj = new GameObject("Item "+i);
				itemObj.transform.SetParent(gameObject.transform, false);

				HovercastItem hoverItem = itemObj.AddComponent<HovercastItem>();
				hoverItem.Label = "Item "+i;
				hoverItem.Type = HovercastItem.HovercastItemType.Radio;
				hoverItem.RadioValue = (i == 0);
				vHoverItems[i] = hoverItem;

				IRadioItem radioItem = (IRadioItem)hoverItem.GetItem();
				radioItem.OnSelected += HandleRadioItemSelected;
			}
		}
コード例 #3
0
 /*--------------------------------------------------------------------------------------------*/
 private IBaseItem[] GetChildItems()
 {
     return(HovercastItemHierarchy.GetChildItemsFromGameObject(gameObject));
 }