static void Init() { ResourceChecker window = (ResourceChecker)EditorWindow.GetWindow(typeof(ResourceChecker)); window.CheckResources(); window.minSize = new Vector2(MinWidth, 300); }
/// <summary> /// 使用可更新模式并检查资源。 /// </summary> /// <param name="checkResourcesCompleteCallback">使用可更新模式并检查资源完成的回调函数。</param> public void CheckResources(CheckResourcesCompleteCallback checkResourcesCompleteCallback) { if (checkResourcesCompleteCallback == null) { throw new GameFrameworkException("Check resources complete callback is invalid."); } if (m_ResourceMode == ResourceMode.Unspecified) { throw new GameFrameworkException("You must set resource mode first."); } if (m_ResourceMode != ResourceMode.Updatable) { throw new GameFrameworkException("You can not use CheckResources without updatable resource mode."); } if (m_ResourceChecker == null) { throw new GameFrameworkException("You can not use CheckResources at this time."); } m_RefuseSetCurrentVariant = true; m_CheckResourcesCompleteCallback = checkResourcesCompleteCallback; m_ResourceChecker.CheckResources(m_CurrentVariant); }
/// <summary> /// 使用可更新模式并检查资源。 /// </summary> public void CheckResources() { if (m_ResourceMode == ResourceMode.Unspecified) { throw new AshException("You must set resource mode first."); } if (m_ResourceMode != ResourceMode.Updatable) { throw new AshException("You can not use InitResources without updatable resource mode."); } if (m_ResourceChecker == null) { throw new AshException("You can not use CheckResources at this time."); } m_RefuseSetCurrentVariant = true; m_ResourceChecker.CheckResources(m_CurrentVariant); }