protected GameObject Panel(GameObject parent, string name) { PanelContainerProfile profile = Defaults.GetProfile(panelContainerProfile); PanelContainerFactory factory = Undoable.AddComponent <PanelContainerFactory>(disposable); factory.parent = parent; factory.containerName = name; factory.panelContainerProfile = profile; GameObject panel = factory.Generate(); PanelProfile subPanelProfile = CreateSubPanelProfile(panel); StandardPanel standardPanel = Undoable.AddComponent <StandardPanel>(panel); standardPanel.panelProfile = subPanelProfile; standardPanel.grabTarget = keyboard.transform; #if VRTK CreateThis_VRTK_Interactable interactable = Undoable.AddComponent <CreateThis_VRTK_Interactable>(panel); CreateThis_VRTK_GrabAttach grabAttach = Undoable.AddComponent <CreateThis_VRTK_GrabAttach>(panel); interactable.isGrabbable = true; interactable.grabAttachMechanicScript = grabAttach; #endif Rigidbody rigidbody = Undoable.AddComponent <Rigidbody>(panel); rigidbody.useGravity = false; rigidbody.isKinematic = true; return(panel); }
protected GameObject Panel(GameObject parent, string name) { PanelContainerProfile profile = Defaults.GetProfile(panelContainerProfile); FilePanelProfile fpProfile = Defaults.GetProfile(filePanelProfile); PanelContainerFactory factory = Undoable.AddComponent <PanelContainerFactory>(disposable); factory.parent = parent; factory.containerName = name; factory.panelContainerProfile = profile; GameObject panel = factory.Generate(); filePanel = AddFilePanel(panel); filePanel.grabTarget = filePanelContainerInstance.transform; filePanel.folderPrefab = fpProfile.folderPrefab; filePanel.kineticScrollItemPrefab = kineticScrollerItem; filePanel.height = fpProfile.scrollerHeight; filePanel.searchPattern = fpProfile.searchPattern; filePanel.panelProfile = panelProfile; #if VRTK CreateThis_VRTK_Interactable interactable = Undoable.AddComponent <CreateThis_VRTK_Interactable>(panel); CreateThis_VRTK_GrabAttach grabAttach = Undoable.AddComponent <CreateThis_VRTK_GrabAttach>(panel); interactable.isGrabbable = true; interactable.grabAttachMechanicScript = grabAttach; #endif drives = Undoable.AddComponent <Drives>(panel); Rigidbody rigidbody = Undoable.AddComponent <Rigidbody>(panel); rigidbody.useGravity = false; rigidbody.isKinematic = true; return(panel); }