Exemplo n.º 1
0
        public AbsGuid CreateExpireGuid(GuidEnum guidEnum, int keyID, long rootID, long curID)
        {
            AbsGuid absGuid = CreateGuid(guidEnum);

            absGuid.InitGuidInfo(keyID, curID, rootID);
            absGuid.GetNextRootID();
            return(absGuid);
        }
Exemplo n.º 2
0
        public AbsGuid CreateGuidByID(GuidEnum guidEnum, int keyID, long rootID, long curID)
        {
            AbsGuid absGuid = CreateGuid(guidEnum);

            absGuid.InitGuidInfo(keyID, curID, rootID);
            absGuid.StartAuto();
            return(absGuid);
        }
Exemplo n.º 3
0
 private AbsGuid CreateGuid(GuidEnum guidEnum)
 {
     if (guidTypes.ContainsKey(guidEnum))
     {
         Type    guidType = guidTypes[guidEnum];
         AbsGuid baseGuid = Activator.CreateInstance(guidType) as AbsGuid;
         return(baseGuid);
     }
     return(null);
 }
Exemplo n.º 4
0
        public void StartGuidByID(long id)
        {
            AbsGuid absGuid = GuidFactory.Instance.GetRootGuidByID(id);

            if (absGuid == null)
            {
                Debug.LogError("guid id is not exist:" + id);
                return;
            }
            absGuid.StartGuid();
        }
Exemplo n.º 5
0
        private void StartCartoonNext()
        {
            GuidManager.Instance.SetProgressByIndex(m_keyID);
            if (m_CurConf.nextId <= 0)
            {
                EndGuid();
            }
            AbsGuid absGuid = GuidFactory.Instance.GetRootGuidByID(m_CurConf.nextId);

            if (absGuid == null)
            {
                EndGuid();
            }
            InitGuidInfo(absGuid.GetKeyID(), absGuid.GetCurID(), absGuid.GetRootID());
        }
Exemplo n.º 6
0
        //初始化加载Guid数据
        public void LoadGuid()
        {
            GuidFactory.Instance.ClearGuid();
            m_ExpireGuid.Clear();
            Debug.Log("Init Guid");
            GetCurrentProgress();

            if (m_isFinish)
            {
                Debug.Log("Guid Finish");
                return;
            }

            ModuleMgr.Instance.AddModule <GuidModule>((byte)GameModuleTypes.GUID_MODULE, true);
            List <ConfGuid> guidArray = ConfGuid.array;

            for (int i = 0; i < guidArray.Count; i++)
            {
                ConfGuid confGuid = guidArray[i];
                if (confGuid.isMain)
                {
                    bool progressStatus = GetProgressByIndex(i);
                    if (!progressStatus)
                    {
                        if (!GuidFactory.Instance.RootGuid.ContainsKey(confGuid.id))
                        {
                            AbsGuid guid = GuidFactory.Instance.CreateGuidByID((GuidEnum)confGuid.type, i, confGuid.id, confGuid.id);
                            GuidFactory.Instance.RootGuid.Add(confGuid.id, guid);
                        }
                    }
                    else
                    {
                        AbsGuid guid = GuidFactory.Instance.CreateExpireGuid((GuidEnum)confGuid.type, i, confGuid.id, confGuid.id);
                        m_ExpireGuid.Add(confGuid.id, guid);
                    }
                }
            }
            foreach (var kv in m_ExpireGuid)
            {
                GuidFactory.Instance.StartCacheGuid(kv.Value.GetNextRootID());
            }
            m_ExpireGuid.Clear();
        }