private void InitElement() { if (!string.IsNullOrEmpty(this.assetBundle.name)) { this.element.Q <Foldout>("AssetBundleItem").text = this.assetBundle.name; } this.element.Q <Foldout>("AssetBundleItem").value = false; #if !UNITY_2019_1_OR_NEWER && !UNITY_2019_OR_NEWER this.element.Q <Foldout>("AssetBundleItem").style.minWidth = 400; #endif var loadObjectBody = this.element.Q <VisualElement>("LoadObjectBody"); foreach (var abObject in assetBundleObjects) { #if UNITY_2019_1_OR_NEWER || UNITY_2019_OR_NEWER var field = new ObjectField(abObject.name); #else var field = new ObjectField(); #endif field.allowSceneObjects = true; loadObjectBody.Add(field); field.objectType = abObject.GetType(); field.value = abObject; } // instanciate... var instanciateBody = this.element.Q <VisualElement>("MaterialChangeBody"); instanciateObjects = new List <InstanciateGameObjectFromAb>(); foreach (var abObject in assetBundleObjects) { var prefab = abObject as GameObject; if (prefab == null) { continue; } var instanciateObject = new InstanciateGameObjectFromAb(prefab); instanciateObjects.Add(instanciateObject); var instanceUI = new InstanciateGameObjectUI(instanciateObject); instanceUI.AddToParent(instanciateBody); } // advanced advancedFold = this.element.Q <Foldout>("Advanced"); var advancedBody = new IMGUIContainer(OnAdvancedGUI); advancedFold.Add(advancedBody); // Close Btn #if !UNITY_2019_1_OR_NEWER && !UNITY_2019_OR_NEWER #endif this.element.Q <Button>("CloseBtn").clickable.clicked += OnClickClose; }
internal InstanciateGameObjectUI(InstanciateGameObjectFromAb inst) { this.instanciateGameObject = inst; }