Esempio n. 1
0
        public BundleConfigurer AddSource(BundleSource source)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            Bundle.Sources.Add(source);
            return(this);
        }
        protected virtual IBundleSourceModel CreateSourceModel(BundleSource bundleSource)
        {
            var result =
                _modelFactories.Select(f => f.CreateSource(bundleSource)).FirstOrDefault(m => m != null) ??
                throw ErrorHelper.ModelFactoryNotAvailable(bundleSource.GetType());

            result.Changed += SourceChanged;

            return(result);
        }
Esempio n. 3
0
        void OnGUI()
        {
            if (!Application.isPlaying)
            {
                EditorGUILayout.LabelField("RuntimeWindow must run player.....");
                m_bundleLocal = null;
                return;
            }
#if !DEVELOPMENT
            Initialize();
#endif
            if (m_bundleLocal == null)
            {
                return;
            }
            if (m_instance == null)
            {
                Close();
                Init();
                return;
            }
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
            {
                //if (GUILayout.Button("Build", EditorStyles.toolbarButton))
                //{
                //    Close();
                //    Init();
                //    EditorGUILayout.EndHorizontal();
                //    return;
                //}
                GUILayout.FlexibleSpace();

                GUILayout.Space(8);
                if (GUILayout.Button("Settings", EditorStyles.toolbarButton))
                {
                }
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            {
                EditorGUILayout.BeginVertical();
                {
                    RenderSourceData(m_bundleLocal.waitLoadSources);
                    GUILayout.Label("", EditorStyles.textField, GUILayout.Height(1));
                    RenderCommand();
                }
                EditorGUILayout.EndVertical();
                GUILayout.Label("", EditorStyles.textField, GUILayout.Width(1), GUILayout.Height(position.height));
                //GUI.Label(new Rect(position.width - 300 + 1, 20, 1, position.height - 180 + 5), "", EditorStyles.textField);
                RenderParam();
            }
            EditorGUILayout.EndHorizontal();
            GUILayout.Label("", GUILayout.Height(position.height));
            //GUI.Label(new Rect(0, position.height - 198 + 40, 400, 1), "", EditorStyles.textField);
        }
Esempio n. 4
0
        void Initialize()
        {
#if !DEVELOPMENT
            if (m_bundleLocal == null && ResourcesManager.source != null)
            {
                m_bundleLocal = ResourcesManager.source as BundleSource;
                m_bundleLocal.loadEventHandler      += OnLoad;
                m_bundleLocal.unLoadEventHandler    += OnUnload;
                m_bundleLocal.destroyEventHandler   += ONDestroy;
                m_bundleLocal.addToLoadEventHandler += OnAddToLoad;
                m_bundleLocal.loadedEventHandler    += OnLoaded;
            }
#endif
        }
Esempio n. 5
0
        public IBundleSourceModel CreateSource(BundleSource bundleSource)
        {
            if (bundleSource == null)
            {
                throw new ArgumentNullException(nameof(bundleSource));
            }

            if (bundleSource is FileBundleSource fileBundleSource)
            {
                return(_appLifetime.ScheduleDisposeForShutdown(new FileBundleSourceModel(fileBundleSource, _enableChangeDetection)));
            }

            if (bundleSource is DynamicBundleSource dynamicBundleSource)
            {
                return(_appLifetime.ScheduleDisposeForShutdown(new DynamicBundleSourceModel(dynamicBundleSource, _enableChangeDetection)));
            }

            return(null);
        }
Esempio n. 6
0
        public IBundleSourceModel CreateSource(BundleSource bundleSource)
        {
            if (bundleSource == null)
            {
                throw new ArgumentNullException(nameof(bundleSource));
            }

            if (bundleSource is FileBundleSource fileBundleSource)
            {
                return(new FileBundleSourceModel(fileBundleSource));
            }

            if (bundleSource is DynamicBundleSource dynamicBundleSource)
            {
                return(new DynamicBundleSourceModel(dynamicBundleSource));
            }

            return(null);
        }