Example #1
0
    private IEnumerator _DoCheckUpdate(IUpdateSysDelegate del, IUpdateFilter filter, MonoBehaviour mono, UpdateContext updateContext)
    {
        SetState(State.CheckUpgrade);

        //set context

        m_context.BaseVersion    = updateContext.BaseVersion;
        m_context.ResVersion     = updateContext.ResVersion;
        m_context.PackageVersion = updateContext.PackageVersion;

        m_context.BasePlatform = updateContext.BasePlatform;
        m_context.Platform     = updateContext.Platform;


        Debug.LogError(" App.version:" + m_context.BaseVersion + " Res.Version:" + m_context.ResVersion + "  pack.Version:" + m_context.PackageVersion + " baseplatform:" + m_context.BasePlatform + " platform:" + m_context.Platform);
        //do check
        //bool checkFinish = false;

        UpdateChecker checker = new UpdateChecker(m_context, filter);

        checker.StartCheck((result) =>
        {
            SetState(State.Idle);

            //checkFinish = true;

            if (!result.Success)
            {
                //notify error
                if (del != null)
                {
                    del.OnCheckUpdateError(result.ErrorCode);
                }
            }
            else
            {
                if (del != null)
                {
                    del.OnCheckUpdateSuccess(result);
                }
            }
        }, mono);

        //while (!checkFinish)
        //{

        //}
        yield return(null);
    }
Example #2
0
    public void CheckUpdate(IUpdateSysDelegate del, IUpdateFilter filter, MonoBehaviour mono, UpdateContext updateContext)
    {
        if (m_state != State.Idle)
        {
            return;
        }

        if (mono != null)
        {
            if (m_checkUpdateCor != null)
            {
                mono.StopCoroutine(m_checkUpdateCor);
            }

            m_checkUpdateCor = mono.StartCoroutine(_DoCheckUpdate(del, filter, mono, updateContext));
        }
    }
Example #3
0
 public UpdateChecker(GameUpdateSys.UpdateContext context, IUpdateFilter filter)
 {
     m_context = context;
     m_filter  = filter;
     UpdateInfo info = new UpdateInfo();
 }