public PackageVersionService(IRunAsync powershell, ISourceService sourceService)
 {
     _powershellAsync = powershell;
     _sourceService = sourceService;
     _powershellAsync.OutputChanged += VersionHandler;
     _powershellAsync.RunFinished += RunFinished;
 }
示例#2
0
文件: BundleRes.cs 项目: ayuexs/C-
        /// <summary>
        /// 执行异步加载
        /// </summary>
        /// <param name="async"></param>
        public IEnumerator AsyncRun(IRunAsync async)
        {
            var url     = AssetBundlePath.GetFullPath(m_bundleName);
            var request = AssetBundle.LoadFromFileAsync(url);

            m_request = request;
            yield return(request);

            m_request = null;

            if (!request.isDone)
            {
                m_state = ResState.Failed;
                async.OnRunAsync();
                Notification(false);
                yield break;
            }

            m_assetBundle = request.assetBundle;

            if (m_assetBundle == null)
            {
                m_state = ResState.Failed;
                async.OnRunAsync();
                Notification(false);
                yield break;
            }

            m_state = ResState.Ready;
            async.OnRunAsync();
            Notification(true);
        }
示例#3
0
        /// <summary>
        /// 执行异步加载
        /// </summary>
        /// <param name="async"></param>
        public IEnumerator AsyncRun(IRunAsync async)
        {
            var request = m_assetBundle.LoadAssetAsync(m_assetName);

            m_request = request;
            yield return(request);

            m_request = null;

            if (!request.isDone)
            {
                m_state = ResState.Failed;
                async.OnRunAsync();
                Notification(false);
                yield break;
            }

            m_asset = request.asset;

            if (m_asset == null)
            {
                m_state = ResState.Failed;
                async.OnRunAsync();
                Notification(false);
                yield break;
            }

            m_state = ResState.Ready;
            async.OnRunAsync();
            Notification(true);
        }
 public PackageVersionService(IRunAsync powershell, ISourceService sourceService)
 {
     _powershellAsync = powershell;
     _sourceService   = sourceService;
     _powershellAsync.OutputChanged += VersionHandler;
     _powershellAsync.RunFinished   += RunFinished;
 }
 public AvailablePackagesService(IRunAsync powershell, ISourceService sourceService)
 {
     _lines           = new List <string>();
     _sourceService   = sourceService;
     _powershellAsync = powershell;
     _powershellAsync.OutputChanged += OutputChanged;
     _powershellAsync.RunFinished   += RunFinished;
 }
 public PackageService(IRunAsync powershell, ISourceService sourceService, ICommandExecuter commandExecuter)
 {
     _powershellAsync = powershell;
     _sourceService = sourceService;
     _commandExecuter = commandExecuter;
     _powershellAsync.OutputChanged += OnLineChanged;
     _powershellAsync.RunFinished += OnRunFinished;
 }
 public AvailablePackagesService(IRunAsync powershell, ISourceService sourceService)
 {
     _lines = new List<string>();
     _sourceService = sourceService;
     _powershellAsync = powershell;
     _powershellAsync.OutputChanged += OutputChanged;
     _powershellAsync.RunFinished += RunFinished;
 }
示例#8
0
 public PackageService(IRunAsync powershell, ISourceService sourceService, ICommandExecuter commandExecuter)
 {
     _powershellAsync = powershell;
     _sourceService   = sourceService;
     _commandExecuter = commandExecuter;
     _powershellAsync.OutputChanged += OnLineChanged;
     _powershellAsync.RunFinished   += OnRunFinished;
 }
 public PackagesService(IRunAsync powershell, ISourceService sourceService)
 {
     _lines = new List<string>();
     _sourceService = sourceService;
     _libDirHelper = new ChocolateyLibDirHelper();
     _powershellAsync = powershell;
     _powershellAsync.OutputChanged += OutputChanged;
     _powershellAsync.RunFinished += RunFinished;
 }