Example #1
0
    public void AnalyseHeroBornAndReviveAge(ref ActorPreloadTab loadInfo, int configID)
    {
        ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((uint)configID);

        if (dataByKey != null)
        {
            AssetLoadBase item = new AssetLoadBase {
                assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szBorn_Age)
            };
            string checkerKey = this.GetCheckerKey(item.assetPath, loadInfo.MarkID);
            if (!this.ageCheckerSet.ContainsKey(checkerKey))
            {
                loadInfo.ageActions.Add(item);
                this.ageCheckerSet.Add(checkerKey, true);
            }
            AssetLoadBase base3 = new AssetLoadBase {
                assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szRevive_Age)
            };
            string key = this.GetCheckerKey(base3.assetPath, loadInfo.MarkID);
            if (!this.ageCheckerSet.ContainsKey(key))
            {
                loadInfo.ageActions.Add(base3);
                this.ageCheckerSet.Add(key, true);
            }
        }
    }
Example #2
0
 public void AnalyseSoundBanks(ref ActorPreloadTab loadInfo, ref CActorInfo charInfo, ref ActorServerData serverData)
 {
     if (charInfo.SoundBanks != null && charInfo.SoundBanks.Length > 0)
     {
         for (int i = 0; i < charInfo.SoundBanks.Length; i++)
         {
             AssetLoadBase assetLoadBase = default(AssetLoadBase);
             assetLoadBase.assetPath = charInfo.SoundBanks[i];
             loadInfo.soundBanks.Add(assetLoadBase);
         }
     }
     if (serverData.SkinId != 0u)
     {
         ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin((uint)loadInfo.theActor.ConfigId, serverData.SkinId);
         if (heroSkin != null && !string.IsNullOrEmpty(heroSkin.szSkinSoundResPack))
         {
             AssetLoadBase assetLoadBase2 = default(AssetLoadBase);
             assetLoadBase2.assetPath = heroSkin.szSkinSoundResPack + "_SFX";
             loadInfo.soundBanks.Add(assetLoadBase2);
             assetLoadBase2           = default(AssetLoadBase);
             assetLoadBase2.assetPath = heroSkin.szSkinSoundResPack + "_VO";
             loadInfo.soundBanks.Add(assetLoadBase2);
         }
     }
 }
Example #3
0
 public void BuildActionHelper(ref ActorPreloadTab loadInfo)
 {
     ActionHelper[] array = Object.FindObjectsOfType <ActionHelper>();
     if (array == null || array.Length == 0)
     {
         return;
     }
     for (int i = 0; i < array.Length; i++)
     {
         ActionHelper actionHelper = array[i];
         for (int j = 0; j < actionHelper.actionHelpers.Length; j++)
         {
             ActionHelperStorage actionHelperStorage = actionHelper.actionHelpers[j];
             DebugHelper.Assert(actionHelperStorage != null && actionHelperStorage.actionName != null, "storage is null or action name is null. storage = {0}, storage.actionName={1}", new object[]
             {
                 (actionHelperStorage != null && actionHelperStorage.helperName != null) ? actionHelperStorage.helperName : "null",
                 (actionHelperStorage != null && actionHelperStorage.actionName != null) ? actionHelperStorage.actionName : "null"
             });
             if (actionHelperStorage != null && !string.IsNullOrEmpty(actionHelperStorage.actionName) && !this.ageCheckerSet.ContainsKey(actionHelperStorage.actionName))
             {
                 AssetLoadBase assetLoadBase = default(AssetLoadBase);
                 assetLoadBase.assetPath = actionHelperStorage.actionName;
                 loadInfo.ageActions.Add(assetLoadBase);
                 this.ageCheckerSet.Add(actionHelperStorage.actionName, true);
             }
         }
     }
 }
Example #4
0
 public void BuildActionHelper(ref ActorPreloadTab loadInfo)
 {
     ActionHelper[] helperArray = UnityEngine.Object.FindObjectsOfType <ActionHelper>();
     if ((helperArray != null) && (helperArray.Length != 0))
     {
         for (int i = 0; i < helperArray.Length; i++)
         {
             ActionHelper helper = helperArray[i];
             for (int j = 0; j < helper.actionHelpers.Length; j++)
             {
                 ActionHelperStorage storage      = helper.actionHelpers[j];
                 object[]            inParameters = new object[] { ((storage == null) || (storage.helperName == null)) ? "null" : storage.helperName, ((storage == null) || (storage.actionName == null)) ? "null" : storage.actionName };
                 DebugHelper.Assert((storage != null) && (storage.actionName != null), "storage is null or action name is null. storage = {0}, storage.actionName={1}", inParameters);
                 if (((storage != null) && !string.IsNullOrEmpty(storage.actionName)) && !this.ageCheckerSet.ContainsKey(storage.actionName))
                 {
                     AssetLoadBase item = new AssetLoadBase {
                         assetPath = storage.actionName
                     };
                     loadInfo.ageActions.Add(item);
                     this.ageCheckerSet.Add(storage.actionName, true);
                 }
             }
         }
     }
 }
Example #5
0
 public void AnalyseSoundBanks(ref ActorPreloadTab loadInfo, ref CActorInfo charInfo, ref ActorServerData serverData)
 {
     if ((charInfo.SoundBanks != null) && (charInfo.SoundBanks.Length > 0))
     {
         for (int i = 0; i < charInfo.SoundBanks.Length; i++)
         {
             AssetLoadBase item = new AssetLoadBase {
                 assetPath = charInfo.SoundBanks[i]
             };
             loadInfo.soundBanks.Add(item);
         }
     }
     if (serverData.SkinId != 0)
     {
         ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin((uint)loadInfo.theActor.ConfigId, serverData.SkinId);
         if ((heroSkin != null) && !string.IsNullOrEmpty(heroSkin.szSkinSoundResPack))
         {
             AssetLoadBase base3 = new AssetLoadBase {
                 assetPath = heroSkin.szSkinSoundResPack + "_SFX"
             };
             loadInfo.soundBanks.Add(base3);
             base3 = new AssetLoadBase {
                 assetPath = heroSkin.szSkinSoundResPack + "_VO"
             };
             loadInfo.soundBanks.Add(base3);
         }
     }
 }
Example #6
0
 public void PreLoadResource(ref ActorPreloadTab loadInfo, LoaderHelper loadHelper)
 {
     if (this.SpawnType == ESpawnObjectType.Tailsman)
     {
         CharmLib dataByKey = GameDataMgr.charmLib.GetDataByKey((long)this.ConfigId);
         if (dataByKey != null)
         {
             for (int i = 0; i < 10; i++)
             {
                 if (dataByKey.astCharmId[i].iParam == 0)
                 {
                     break;
                 }
                 int        iParam = dataByKey.astCharmId[i].iParam;
                 ShenFuInfo info   = GameDataMgr.shenfuBin.GetDataByKey((long)iParam);
                 if (info != null)
                 {
                     AssetLoadBase item = new AssetLoadBase {
                         assetPath = StringHelper.UTF8BytesToString(ref info.szShenFuResPath)
                     };
                     loadInfo.mesPrefabs.Add(item);
                     loadHelper.AnalyseSkillCombine(ref loadInfo, info.iBufId);
                 }
             }
         }
     }
 }
Example #7
0
    public void AddSprite(string path)
    {
        AssetLoadBase item = new AssetLoadBase {
            assetPath = path
        };

        this.spritePrefabs.Add(item);
    }
Example #8
0
    public void AddParticle(string path)
    {
        AssetLoadBase item = new AssetLoadBase {
            assetPath = path
        };

        this.parPrefabs.Add(item);
    }
Example #9
0
    public void AddMesh(string path)
    {
        AssetLoadBase item = new AssetLoadBase {
            assetPath = path
        };

        this.mesPrefabs.Add(item);
    }
Example #10
0
    public void AddAction(string path)
    {
        AssetLoadBase item = new AssetLoadBase {
            assetPath = path
        };

        this.ageActions.Add(item);
    }
Example #11
0
    public void AnalyseSkill(ref ActorPreloadTab loadInfo, int skillID)
    {
        if (skillID <= 0)
        {
            return;
        }
        ResSkillCfgInfo dataByKey = GameDataMgr.skillDatabin.GetDataByKey((long)skillID);

        if (dataByKey == null)
        {
            return;
        }
        if (!this.skillIdList.Contains((long)skillID))
        {
            this.skillIdList.Add((long)skillID);
        }
        AssetLoadBase assetLoadBase = default(AssetLoadBase);

        assetLoadBase.assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szPrefab);
        string checkerKey = this.GetCheckerKey(assetLoadBase.assetPath, loadInfo.MarkID);

        if (this.ageCheckerSet.ContainsKey(checkerKey))
        {
            return;
        }
        loadInfo.ageActions.Add(assetLoadBase);
        this.ageCheckerSet.Add(checkerKey, true);
        string text = StringHelper.UTF8BytesToString(ref dataByKey.szGuidePrefab);

        if (!string.IsNullOrEmpty(text))
        {
            assetLoadBase.assetPath    = text;
            assetLoadBase.nInstantiate = 1;
            loadInfo.parPrefabs.Add(assetLoadBase);
        }
        text = StringHelper.UTF8BytesToString(ref dataByKey.szGuideWarnPrefab);
        if (!string.IsNullOrEmpty(text))
        {
            assetLoadBase.assetPath    = text;
            assetLoadBase.nInstantiate = 1;
            loadInfo.parPrefabs.Add(assetLoadBase);
        }
        text = StringHelper.UTF8BytesToString(ref dataByKey.szEffectPrefab);
        if (!string.IsNullOrEmpty(text))
        {
            assetLoadBase.assetPath    = text;
            assetLoadBase.nInstantiate = 1;
            loadInfo.parPrefabs.Add(assetLoadBase);
        }
        text = StringHelper.UTF8BytesToString(ref dataByKey.szEffectWarnPrefab);
        if (!string.IsNullOrEmpty(text))
        {
            assetLoadBase.assetPath    = text;
            assetLoadBase.nInstantiate = 1;
            loadInfo.parPrefabs.Add(assetLoadBase);
        }
    }
Example #12
0
 public void AnalyseSkillMarkParticleSkin(ref ActorPreloadTab loadInfo, string _resName)
 {
     for (int i = 0; i < 3; i++)
     {
         AssetLoadBase assetLoadBase = default(AssetLoadBase);
         assetLoadBase.assetPath    = SkinResourceHelper.GetSkinResourceName(loadInfo.theActor.ConfigId, loadInfo.MarkID, _resName, i);
         assetLoadBase.nInstantiate = 1;
         loadInfo.parPrefabs.Add(assetLoadBase);
     }
 }
Example #13
0
 public void AnalyseSkillMarkParticleSkin(ref ActorPreloadTab loadInfo, string _resName)
 {
     for (int i = 0; i < 3; i++)
     {
         AssetLoadBase item = new AssetLoadBase {
             assetPath    = SkinResourceHelper.GetSkinResourceName(loadInfo.theActor.ConfigId, loadInfo.MarkID, _resName, i),
             nInstantiate = 1
         };
         loadInfo.parPrefabs.Add(item);
     }
 }
Example #14
0
    public void AnalyseSkillMarkParticle(ref ActorPreloadTab loadInfo, string _resName)
    {
        AssetLoadBase assetLoadBase = default(AssetLoadBase);
        string        text          = StringHelper.UTF8BytesToString(ref _resName);

        if (!string.IsNullOrEmpty(text))
        {
            assetLoadBase.assetPath    = text;
            assetLoadBase.nInstantiate = 1;
            loadInfo.parPrefabs.Add(assetLoadBase);
            this.AnalyseSkillMarkParticleSkin(ref loadInfo, text);
        }
    }
Example #15
0
    public void AnalyseSkillMarkParticle(ref ActorPreloadTab loadInfo, string _resName)
    {
        AssetLoadBase item = new AssetLoadBase();
        string        str  = StringHelper.UTF8BytesToString(ref _resName);

        if (!string.IsNullOrEmpty(str))
        {
            item.assetPath    = str;
            item.nInstantiate = 1;
            loadInfo.parPrefabs.Add(item);
            this.AnalyseSkillMarkParticleSkin(ref loadInfo, str);
        }
    }
Example #16
0
 public void AnalyseSkillCombine(ref ActorPreloadTab loadInfo, int combineId)
 {
     if (combineId > 0)
     {
         ResSkillCombineCfgInfo dataByKey = GameDataMgr.skillCombineDatabin.GetDataByKey(combineId);
         if (dataByKey != null)
         {
             AssetLoadBase item = new AssetLoadBase {
                 assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szPrefab)
             };
             string checkerKey = this.GetCheckerKey(item.assetPath, loadInfo.MarkID);
             if (!this.ageCheckerSet.ContainsKey(checkerKey))
             {
                 loadInfo.ageActions.Add(item);
                 this.ageCheckerSet.Add(checkerKey, true);
             }
             if ((dataByKey.astSkillFuncInfo != null) && (dataByKey.astSkillFuncInfo.Length > 0))
             {
                 for (int i = 0; i < dataByKey.astSkillFuncInfo.Length; i++)
                 {
                     ResDT_SkillFunc func = dataByKey.astSkillFuncInfo[i];
                     if (((((func.dwSkillFuncType == 0x1c) || (func.dwSkillFuncType == 0x21)) || ((func.dwSkillFuncType == 0x36) || (func.dwSkillFuncType == 0x37))) && (((func.astSkillFuncParam != null) && (func.astSkillFuncParam.Length != 0)) && (func.astSkillFuncParam[0] != null))) && (func.astSkillFuncParam[0].iParam > 0))
                     {
                         int iParam = func.astSkillFuncParam[0].iParam;
                         if (func.dwSkillFuncType == 0x1c)
                         {
                             this.AnalyseSkillMark(ref loadInfo, iParam);
                         }
                         else if (func.dwSkillFuncType == 0x21)
                         {
                             if (combineId != iParam)
                             {
                                 this.AnalyseSkillCombine(ref loadInfo, iParam);
                             }
                         }
                         else if (func.dwSkillFuncType == 0x36)
                         {
                             this.AnalyseSkillCombine(ref loadInfo, iParam);
                         }
                         else if (func.dwSkillFuncType == 0x37)
                         {
                             this.AnalyseSkill(ref loadInfo, iParam);
                         }
                     }
                 }
             }
         }
     }
 }
Example #17
0
 public void PreLoadResource(TriggerActionWrapper triggerActionWrapper, ref ActorPreloadTab loadInfo, LoaderHelper loadHelper)
 {
     if (triggerActionWrapper != null)
     {
         ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey((long)triggerActionWrapper.UpdateUniqueId);
         if (dataByKey != null)
         {
             AssetLoadBase item = new AssetLoadBase {
                 assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szShenFuResPath)
             };
             loadInfo.mesPrefabs.Add(item);
             loadHelper.AnalyseSkillCombine(ref loadInfo, dataByKey.iBufId);
         }
     }
 }
Example #18
0
    public void AnalysePassiveSkill(ref ActorPreloadTab loadInfo, int passiveSkillID)
    {
        if (passiveSkillID <= 0)
        {
            return;
        }
        ResSkillPassiveCfgInfo dataByKey = GameDataMgr.skillPassiveDatabin.GetDataByKey((long)passiveSkillID);

        if (dataByKey == null)
        {
            return;
        }
        if (!this.passiveSkillList.Contains((long)passiveSkillID))
        {
            this.passiveSkillList.Add((long)passiveSkillID);
        }
        AssetLoadBase assetLoadBase = default(AssetLoadBase);

        assetLoadBase.assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szActionName);
        string checkerKey = this.GetCheckerKey(assetLoadBase.assetPath, loadInfo.MarkID);

        if (!this.ageCheckerSet.ContainsKey(checkerKey))
        {
            loadInfo.ageActions.Add(assetLoadBase);
            this.ageCheckerSet.Add(checkerKey, true);
        }
        if (dataByKey.dwPassiveEventType == 8u)
        {
            this.AnalyseSkillCombine(ref loadInfo, dataByKey.iPassiveEventParam4);
        }
        else if (dataByKey.dwPassiveEventType == 3u || dataByKey.dwPassiveEventType == 7u)
        {
            this.AnalyseSkillCombine(ref loadInfo, dataByKey.iPassiveEventParam1);
            this.AnalyseSkillCombine(ref loadInfo, dataByKey.iPassiveEventParam2);
        }
        else if (dataByKey.dwPassiveEventType == 9u)
        {
            this.AnalyseSkillCombine(ref loadInfo, dataByKey.iPassiveEventParam3);
            this.AnalyseSkillCombine(ref loadInfo, dataByKey.iPassiveEventParam4);
            this.AnalyseSkillCombine(ref loadInfo, dataByKey.iPassiveEventParam5);
        }
        else if (dataByKey.dwPassiveEventType == 10u)
        {
            this.AnalyseSkillCombine(ref loadInfo, dataByKey.iPassiveEventParam3);
            this.AnalyseSkillCombine(ref loadInfo, dataByKey.iPassiveEventParam4);
            this.AnalyseSkillCombine(ref loadInfo, dataByKey.iPassiveEventParam5);
        }
    }
Example #19
0
        public static void PreLoadShenfuResource(int shenfuId, ref ActorPreloadTab loadInfo, LoaderHelper loadHelper)
        {
            ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey((long)shenfuId);

            if (dataByKey == null)
            {
                return;
            }
            AssetLoadBase assetLoadBase = new AssetLoadBase
            {
                assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szShenFuResPath)
            };

            loadInfo.mesPrefabs.Add(assetLoadBase);
            loadHelper.AnalyseSkillCombine(ref loadInfo, dataByKey.iBufId);
        }
Example #20
0
 public void AnalyseSkill(ref ActorPreloadTab loadInfo, int skillID)
 {
     if (skillID > 0)
     {
         ResSkillCfgInfo dataByKey = GameDataMgr.skillDatabin.GetDataByKey(skillID);
         if (dataByKey != null)
         {
             AssetLoadBase item = new AssetLoadBase {
                 assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szPrefab)
             };
             string checkerKey = this.GetCheckerKey(item.assetPath, loadInfo.MarkID);
             if (!this.ageCheckerSet.ContainsKey(checkerKey))
             {
                 loadInfo.ageActions.Add(item);
                 this.ageCheckerSet.Add(checkerKey, true);
                 string str2 = StringHelper.UTF8BytesToString(ref dataByKey.szGuidePrefab);
                 if (!string.IsNullOrEmpty(str2))
                 {
                     item.assetPath    = str2;
                     item.nInstantiate = 1;
                     loadInfo.parPrefabs.Add(item);
                 }
                 str2 = StringHelper.UTF8BytesToString(ref dataByKey.szGuideWarnPrefab);
                 if (!string.IsNullOrEmpty(str2))
                 {
                     item.assetPath    = str2;
                     item.nInstantiate = 1;
                     loadInfo.parPrefabs.Add(item);
                 }
                 str2 = StringHelper.UTF8BytesToString(ref dataByKey.szEffectPrefab);
                 if (!string.IsNullOrEmpty(str2))
                 {
                     item.assetPath    = str2;
                     item.nInstantiate = 1;
                     loadInfo.parPrefabs.Add(item);
                 }
                 str2 = StringHelper.UTF8BytesToString(ref dataByKey.szEffectWarnPrefab);
                 if (!string.IsNullOrEmpty(str2))
                 {
                     item.assetPath    = str2;
                     item.nInstantiate = 1;
                     loadInfo.parPrefabs.Add(item);
                 }
             }
         }
     }
 }
Example #21
0
 public void AnalyseSkillMark(ref ActorPreloadTab loadInfo, int markId)
 {
     if (markId > 0)
     {
         ResSkillMarkCfgInfo dataByKey = GameDataMgr.skillMarkDatabin.GetDataByKey(markId);
         if (dataByKey != null)
         {
             AssetLoadBase item = new AssetLoadBase {
                 assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szActionName)
             };
             string checkerKey = this.GetCheckerKey(item.assetPath, loadInfo.MarkID);
             if (!this.ageCheckerSet.ContainsKey(checkerKey))
             {
                 loadInfo.ageActions.Add(item);
                 this.ageCheckerSet.Add(checkerKey, true);
             }
         }
     }
 }
Example #22
0
 public void AnalysePassiveSkill(ref ActorPreloadTab loadInfo, int passiveSkillID)
 {
     if (passiveSkillID > 0)
     {
         ResSkillPassiveCfgInfo dataByKey = GameDataMgr.skillPassiveDatabin.GetDataByKey((long)passiveSkillID);
         if (dataByKey != null)
         {
             AssetLoadBase item = new AssetLoadBase {
                 assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szActionName)
             };
             string checkerKey = this.GetCheckerKey(item.assetPath, loadInfo.MarkID);
             if (!this.ageCheckerSet.ContainsKey(checkerKey))
             {
                 loadInfo.ageActions.Add(item);
                 this.ageCheckerSet.Add(checkerKey, true);
             }
             if (dataByKey.dwPassiveEventType == 8)
             {
                 this.AnalyseSkillCombine(ref loadInfo, dataByKey.iPassiveEventParam4);
             }
         }
     }
 }
Example #23
0
 public void AnalyseSkillMark(ref ActorPreloadTab loadInfo, int markId)
 {
     if (markId > 0)
     {
         ResSkillMarkCfgInfo dataByKey = GameDataMgr.skillMarkDatabin.GetDataByKey((long)markId);
         if (dataByKey != null)
         {
             AssetLoadBase assetLoadBase = default(AssetLoadBase);
             assetLoadBase.assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szActionName);
             string checkerKey = this.GetCheckerKey(assetLoadBase.assetPath, loadInfo.MarkID);
             if (!this.ageCheckerSet.ContainsKey(checkerKey))
             {
                 loadInfo.ageActions.Add(assetLoadBase);
                 this.ageCheckerSet.Add(checkerKey, true);
             }
             this.AnalyseSkillMarkParticle(ref loadInfo, dataByKey.szLayerEffectName1);
             this.AnalyseSkillMarkParticle(ref loadInfo, dataByKey.szLayerEffectName2);
             this.AnalyseSkillMarkParticle(ref loadInfo, dataByKey.szLayerEffectName3);
             this.AnalyseSkillMarkParticle(ref loadInfo, dataByKey.szLayerEffectName4);
             this.AnalyseSkillMarkParticle(ref loadInfo, dataByKey.szLayerEffectName5);
         }
     }
 }
Example #24
0
 public void PreLoadResource(ref ActorPreloadTab loadInfo, Dictionary <string, bool> ageCheckerSet, LoaderHelper loadHelper)
 {
     if (this.TimingActionsInter != null)
     {
         int num = this.TimingActionsInter.Length;
         for (int i = 0; i < num; i++)
         {
             if (!string.IsNullOrEmpty(this.TimingActionsInter[i].ActionName) && !ageCheckerSet.ContainsKey(this.TimingActionsInter[i].ActionName))
             {
                 AssetLoadBase assetLoadBase = default(AssetLoadBase);
                 assetLoadBase.assetPath = this.TimingActionsInter[i].ActionName;
                 loadInfo.ageActions.Add(assetLoadBase);
                 ageCheckerSet.Add(this.TimingActionsInter[i].ActionName, true);
             }
         }
     }
     if (this.TriggerType == EGlobalTriggerAct.TriggerBuff)
     {
         loadHelper.AnalyseSkillCombine(ref loadInfo, this.EnterUniqueId);
         loadHelper.AnalyseSkillCombine(ref loadInfo, this.LeaveUniqueId);
         loadHelper.AnalyseSkillCombine(ref loadInfo, this.UpdateUniqueId);
     }
 }
Example #25
0
 public void PreLoadAdvanceSkin(List <AssetLoadBase> mesPrefabs, uint skinId, int inLOD = -1)
 {
     if (mesPrefabs != null)
     {
         int modelLOD = 0;
         if ((inLOD < 0) || (inLOD > 2))
         {
             modelLOD = GameSettings.ModelLOD;
         }
         else
         {
             modelLOD = inLOD;
         }
         if ((Singleton <BattleLogic> .GetInstance().GetCurLvelContext() != null) && !Singleton <BattleLogic> .GetInstance().GetCurLvelContext().IsMobaMode())
         {
             modelLOD--;
         }
         modelLOD = Mathf.Clamp(modelLOD, 0, 2);
         if ((skinId >= 1) && (skinId <= this.SkinPrefab.Length))
         {
             SkinElement element = this.SkinPrefab[(int)((IntPtr)(skinId - 1))];
             if (element != null)
             {
                 for (int i = 0; i < element.AdvanceSkin.Length; i++)
                 {
                     if ((element.AdvanceSkin[i] != null) && !string.IsNullOrEmpty(element.AdvanceSkin[i].ArtSkinPrefabLOD[modelLOD]))
                     {
                         AssetLoadBase item = new AssetLoadBase {
                             assetPath = element.AdvanceSkin[i].ArtSkinPrefabLOD[modelLOD]
                         };
                         mesPrefabs.Add(item);
                     }
                 }
             }
         }
     }
 }
Example #26
0
    public void AnalyseHeroBornAndReviveAge(ref ActorPreloadTab loadInfo, int configID)
    {
        ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((uint)configID);

        if (dataByKey != null)
        {
            AssetLoadBase assetLoadBase = default(AssetLoadBase);
            assetLoadBase.assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szBorn_Age);
            string checkerKey = this.GetCheckerKey(assetLoadBase.assetPath, loadInfo.MarkID);
            if (!this.ageCheckerSet.ContainsKey(checkerKey))
            {
                loadInfo.ageActions.Add(assetLoadBase);
                this.ageCheckerSet.Add(checkerKey, true);
            }
            AssetLoadBase assetLoadBase2 = default(AssetLoadBase);
            assetLoadBase2.assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szRevive_Age);
            string checkerKey2 = this.GetCheckerKey(assetLoadBase2.assetPath, loadInfo.MarkID);
            if (!this.ageCheckerSet.ContainsKey(checkerKey2))
            {
                loadInfo.ageActions.Add(assetLoadBase2);
                this.ageCheckerSet.Add(checkerKey2, true);
            }
        }
    }
Example #27
0
 public void BuildActionTrigger(ref ActorPreloadTab loadInfo)
 {
     AreaEventTrigger[] triggerArray = UnityEngine.Object.FindObjectsOfType <AreaEventTrigger>();
     if ((triggerArray != null) && (triggerArray.Length > 0))
     {
         for (int i = 0; i < triggerArray.Length; i++)
         {
             AreaEventTrigger trigger = triggerArray[i];
             for (int j = 0; j < trigger.TriggerActions.Length; j++)
             {
                 TriggerActionWrapper triggerActionWrapper = trigger.TriggerActions[j];
                 if ((triggerActionWrapper != null) && (triggerActionWrapper.TimingActionsInter != null))
                 {
                     for (int k = 0; k < triggerActionWrapper.TimingActionsInter.Length; k++)
                     {
                         if (!string.IsNullOrEmpty(triggerActionWrapper.TimingActionsInter[k].ActionName) && !this.ageCheckerSet.ContainsKey(triggerActionWrapper.TimingActionsInter[k].ActionName))
                         {
                             AssetLoadBase item = new AssetLoadBase {
                                 assetPath = triggerActionWrapper.TimingActionsInter[k].ActionName
                             };
                             loadInfo.ageActions.Add(item);
                             this.ageCheckerSet.Add(triggerActionWrapper.TimingActionsInter[k].ActionName, true);
                         }
                     }
                 }
                 if ((triggerActionWrapper != null) && (triggerActionWrapper.TriggerType == EGlobalTriggerAct.TriggerShenFu))
                 {
                     Singleton <ShenFuSystem> .instance.PreLoadResource(triggerActionWrapper, ref loadInfo, this);
                 }
             }
             if ((trigger.PresetActWrapper != null) && (trigger.PresetActWrapper.TimingActionsInter != null))
             {
                 for (int m = 0; m < trigger.PresetActWrapper.TimingActionsInter.Length; m++)
                 {
                     if (!string.IsNullOrEmpty(trigger.PresetActWrapper.TimingActionsInter[m].ActionName) && !this.ageCheckerSet.ContainsKey(trigger.PresetActWrapper.TimingActionsInter[m].ActionName))
                     {
                         AssetLoadBase base3 = new AssetLoadBase {
                             assetPath = trigger.PresetActWrapper.TimingActionsInter[m].ActionName
                         };
                         loadInfo.ageActions.Add(base3);
                         this.ageCheckerSet.Add(trigger.PresetActWrapper.TimingActionsInter[m].ActionName, true);
                     }
                 }
             }
         }
     }
     GlobalTrigger[] triggerArray2 = UnityEngine.Object.FindObjectsOfType <GlobalTrigger>();
     if ((triggerArray2 != null) && (triggerArray2.Length > 0))
     {
         for (int n = 0; n < triggerArray2.Length; n++)
         {
             GlobalTrigger trigger2 = triggerArray2[n];
             if ((trigger2.TriggerMatches != null) && (trigger2.TriggerMatches.Length > 0))
             {
                 for (int num6 = 0; num6 < trigger2.TriggerMatches.Length; num6++)
                 {
                     CTriggerMatch match = trigger2.TriggerMatches[num6];
                     if (((match != null) && (match.ActionList != null)) && (match.ActionList.Length > 0))
                     {
                         for (int num7 = 0; num7 < match.ActionList.Length; num7++)
                         {
                             TriggerActionWrapper wrapper2 = match.ActionList[num7];
                             if ((wrapper2 != null) && (wrapper2.TimingActionsInter != null))
                             {
                                 for (int num8 = 0; num8 < wrapper2.TimingActionsInter.Length; num8++)
                                 {
                                     if (!string.IsNullOrEmpty(wrapper2.TimingActionsInter[num8].ActionName) && !this.ageCheckerSet.ContainsKey(wrapper2.TimingActionsInter[num8].ActionName))
                                     {
                                         AssetLoadBase base4 = new AssetLoadBase {
                                             assetPath = wrapper2.TimingActionsInter[num8].ActionName
                                         };
                                         loadInfo.ageActions.Add(base4);
                                         this.ageCheckerSet.Add(wrapper2.TimingActionsInter[num8].ActionName, true);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             if ((trigger2.ActionList != null) && (trigger2.ActionList.Length > 0))
             {
                 for (int num9 = 0; num9 < trigger2.ActionList.Length; num9++)
                 {
                     TriggerActionWrapper wrapper3 = trigger2.ActionList[num9];
                     if ((wrapper3 != null) && (wrapper3.TimingActionsInter != null))
                     {
                         for (int num10 = 0; num10 < wrapper3.TimingActionsInter.Length; num10++)
                         {
                             if (!string.IsNullOrEmpty(wrapper3.TimingActionsInter[num10].ActionName) && !this.ageCheckerSet.ContainsKey(wrapper3.TimingActionsInter[num10].ActionName))
                             {
                                 AssetLoadBase base5 = new AssetLoadBase {
                                     assetPath = wrapper3.TimingActionsInter[num10].ActionName
                                 };
                                 loadInfo.ageActions.Add(base5);
                                 this.ageCheckerSet.Add(wrapper3.TimingActionsInter[num10].ActionName, true);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Example #28
0
    public void AddPreloadActor(ref List <ActorPreloadTab> list, ref ActorMeta actorMeta, float spawnCnt, int ownerSkinID = 0)
    {
        for (int i = 0; i < list.Count; i++)
        {
            ActorPreloadTab tab = list[i];
            if (tab.theActor.ConfigId != actorMeta.ConfigId)
            {
                continue;
            }
            if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
            {
                if (this.GetActorMarkID(actorMeta) == tab.MarkID)
                {
                    goto Label_0085;
                }
                continue;
            }
            if ((actorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) && (spawnCnt > 0f))
            {
                tab.spawnCnt += spawnCnt;
                list[i]       = tab;
            }
Label_0085:
            retCnt++;
            return;
        }
        ActorStaticData        actorData         = new ActorStaticData();
        IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider);

        actorDataProvider.GetActorStaticData(ref actorMeta, ref actorData);
        ActorServerData data2 = new ActorServerData();

        Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider).GetActorServerData(ref actorMeta, ref data2);

        CActorInfo actorInfo = CActorInfo.GetActorInfo(actorData.TheResInfo.ResPath, enResourceType.BattleScene);

        if (actorInfo != null)
        {
            ActorPreloadTab loadInfo = new ActorPreloadTab {
                theActor = actorMeta
            };
            loadInfo.modelPrefab.assetPath    = actorInfo.GetArtPrefabName((ownerSkinID == 0) ? ((int)data2.SkinId) : ownerSkinID, -1);
            loadInfo.modelPrefab.nInstantiate = 1;
            loadInfo.spawnCnt      = spawnCnt;
            loadInfo.MarkID        = this.GetActorMarkID(actorMeta);
            loadInfo.ageActions    = new List <AssetLoadBase>();
            loadInfo.parPrefabs    = new List <AssetLoadBase>();
            loadInfo.mesPrefabs    = new List <AssetLoadBase>();
            loadInfo.spritePrefabs = new List <AssetLoadBase>();
            loadInfo.soundBanks    = new List <AssetLoadBase>();
            loadInfo.behaviorXml   = new List <AssetLoadBase>();
            ActorStaticSkillData skillData = new ActorStaticSkillData();
            for (int j = 0; j < 7; j++)
            {
                actorDataProvider.GetActorStaticSkillData(ref actorMeta, (ActorSkillSlot)j, ref skillData);
                if (skillData.SkillId != 0)
                {
                    this.AnalyseSkill(ref loadInfo, skillData.SkillId);
                    this.AnalysePassiveSkill(ref loadInfo, skillData.PassiveSkillId);
                }
            }
            if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
            {
                ResTalentHero dataByKey = GameDataMgr.talentHero.GetDataByKey((uint)actorMeta.ConfigId);
                if (dataByKey != null)
                {
                    this.AnalyseHeroTalent(ref loadInfo, dataByKey);
                }
            }
            else if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
            {
                ActorStaticData data4 = new ActorStaticData();
                Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider).GetActorStaticData(ref actorMeta, ref data4);

                int randomPassiveSkillRule = data4.TheBaseAttribute.RandomPassiveSkillRule;
                if ((randomPassiveSkillRule > 0) && !this.randomSkillCheckerSet.ContainsKey(randomPassiveSkillRule))
                {
                    this.randomSkillCheckerSet.Add(randomPassiveSkillRule, true);
                    ResRandomSkillPassiveRule rule = GameDataMgr.randomSkillPassiveDatabin.GetDataByKey(randomPassiveSkillRule);
                    if ((rule.astRandomSkillPassiveID1 != null) && (rule.astRandomSkillPassiveID1.Length > 0))
                    {
                        for (int k = 0; k < rule.astRandomSkillPassiveID1.Length; k++)
                        {
                            this.AnalysePassiveSkill(ref loadInfo, rule.astRandomSkillPassiveID1[k].iParam);
                        }
                    }
                    if ((rule.astRandomSkillPassiveID2 != null) && (rule.astRandomSkillPassiveID2.Length > 0))
                    {
                        for (int m = 0; m < rule.astRandomSkillPassiveID2.Length; m++)
                        {
                            this.AnalysePassiveSkill(ref loadInfo, rule.astRandomSkillPassiveID2[m].iParam);
                        }
                    }
                }
            }
            if (!string.IsNullOrEmpty(actorInfo.deadAgePath))
            {
                AssetLoadBase item = new AssetLoadBase {
                    assetPath = actorInfo.deadAgePath
                };
                loadInfo.ageActions.Add(item);
            }
            if (!string.IsNullOrEmpty(actorInfo.BtResourcePath) && !this.behaviorXmlSet.ContainsKey(actorInfo.BtResourcePath))
            {
                AssetLoadBase base3 = new AssetLoadBase {
                    assetPath = actorInfo.BtResourcePath
                };
                loadInfo.behaviorXml.Add(base3);
                this.behaviorXmlSet.Add(actorInfo.BtResourcePath, true);
            }
            loadInfo.soundBanks = new List <AssetLoadBase>();
            this.AnalyseSoundBanks(ref loadInfo, ref actorInfo, ref data2);
            list.Add(loadInfo);
            if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
            {
                this.CheckCallMonsterSkill(actorInfo, ref list, ref actorMeta, (int)data2.SkinId);
            }
        }
    }
Example #29
0
    public List <ActorPreloadTab> AnalyseAgeRefAssets(Dictionary <int, Dictionary <object, AssetRefType> > refAssetsDict)
    {
        List <ActorPreloadTab> list = new List <ActorPreloadTab>();

        Dictionary <int, Dictionary <object, AssetRefType> > .Enumerator enumerator = refAssetsDict.GetEnumerator();
        while (enumerator.MoveNext())
        {
            KeyValuePair <int, Dictionary <object, AssetRefType> > current = enumerator.Current;
            int key = current.Key;
            KeyValuePair <int, Dictionary <object, AssetRefType> > pair2 = enumerator.Current;
            Dictionary <object, AssetRefType> dictionary = pair2.Value;
            ActorPreloadTab item = new ActorPreloadTab {
                ageActions    = new List <AssetLoadBase>(),
                parPrefabs    = new List <AssetLoadBase>(),
                mesPrefabs    = new List <AssetLoadBase>(),
                spritePrefabs = new List <AssetLoadBase>(),
                soundBanks    = new List <AssetLoadBase>(),
                behaviorXml   = new List <AssetLoadBase>(),
                MarkID        = key
            };
            list.Add(item);
            Dictionary <object, AssetRefType> .Enumerator enumerator2 = dictionary.GetEnumerator();
            while (enumerator2.MoveNext())
            {
                KeyValuePair <object, AssetRefType> pair3 = enumerator2.Current;
                AssetRefType type = pair3.Value;
                KeyValuePair <object, AssetRefType> pair4 = enumerator2.Current;
                object obj2 = pair4.Key;
                switch (type)
                {
                case AssetRefType.Action:
                {
                    AssetLoadBase base2 = new AssetLoadBase {
                        assetPath = obj2 as string
                    };
                    string checkerKey = this.GetCheckerKey(base2.assetPath, key);
                    if (!this.ageCheckerSet.ContainsKey(checkerKey))
                    {
                        item.ageActions.Add(base2);
                        this.ageCheckerSet.Add(checkerKey, true);
                    }
                    break;
                }

                case AssetRefType.SkillID:
                {
                    KeyValuePair <object, AssetRefType> pair7 = enumerator2.Current;
                    int skillID = (int)pair7.Key;
                    this.AnalyseSkill(ref item, skillID);
                    break;
                }

                case AssetRefType.SkillCombine:
                {
                    KeyValuePair <object, AssetRefType> pair6 = enumerator2.Current;
                    int combineId = (int)pair6.Key;
                    this.AnalyseSkillCombine(ref item, combineId);
                    break;
                }

                case AssetRefType.Prefab:
                {
                    AssetLoadBase base3 = new AssetLoadBase {
                        assetPath = obj2 as string
                    };
                    item.mesPrefabs.Add(base3);
                    if (key != 0)
                    {
                        AssetLoadBase base4 = new AssetLoadBase {
                            assetPath = this.GetSkinResourceName(key, base3.assetPath)
                        };
                        item.mesPrefabs.Add(base4);
                    }
                    break;
                }

                case AssetRefType.Particle:
                {
                    AssetLoadBase base5 = new AssetLoadBase();
                    KeyValuePair <object, AssetRefType> pair5 = enumerator2.Current;
                    base5.assetPath = pair5.Key as string;
                    item.parPrefabs.Add(base5);
                    if (key != 0)
                    {
                        AssetLoadBase base6 = new AssetLoadBase {
                            assetPath = this.GetSkinResourceName(key, base5.assetPath)
                        };
                        item.parPrefabs.Add(base6);
                    }
                    break;
                }
                }
            }
        }
        return(list);
    }
Example #30
0
 public void AnalyseSkillCombine(ref ActorPreloadTab loadInfo, int combineId)
 {
     if (combineId > 0)
     {
         ResSkillCombineCfgInfo dataByKey = GameDataMgr.skillCombineDatabin.GetDataByKey((long)combineId);
         if (dataByKey != null)
         {
             AssetLoadBase item = new AssetLoadBase {
                 assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szPrefab)
             };
             string checkerKey = this.GetCheckerKey(item.assetPath, loadInfo.MarkID);
             if (!this.ageCheckerSet.ContainsKey(checkerKey))
             {
                 loadInfo.ageActions.Add(item);
                 this.ageCheckerSet.Add(checkerKey, true);
             }
             if ((dataByKey.bIsShowBuff == 1) && !string.IsNullOrEmpty(dataByKey.szIconPath))
             {
                 string path = CUIUtility.s_Sprite_Dynamic_Skill_Dir + dataByKey.szIconPath;
                 if (!loadInfo.IsExistsSprite(path))
                 {
                     loadInfo.AddSprite(path);
                 }
             }
             if ((dataByKey.astSkillFuncInfo != null) && (dataByKey.astSkillFuncInfo.Length > 0))
             {
                 for (int i = 0; i < dataByKey.astSkillFuncInfo.Length; i++)
                 {
                     ResDT_SkillFunc func = dataByKey.astSkillFuncInfo[i];
                     if (((((func.dwSkillFuncType == 0x1c) || (func.dwSkillFuncType == 0x21)) || (((func.dwSkillFuncType == 0x36) || (func.dwSkillFuncType == 0x37)) || (func.dwSkillFuncType == 0x1b))) && (func.astSkillFuncParam != null)) && (func.astSkillFuncParam.Length != 0))
                     {
                         int markId  = 0;
                         int skillID = 0;
                         int iParam  = 0;
                         if (func.astSkillFuncParam[0] != null)
                         {
                             markId = func.astSkillFuncParam[0].iParam;
                         }
                         if (func.astSkillFuncParam[1] != null)
                         {
                             skillID = func.astSkillFuncParam[1].iParam;
                         }
                         if (func.astSkillFuncParam[5] != null)
                         {
                             iParam = func.astSkillFuncParam[5].iParam;
                         }
                         if (func.dwSkillFuncType == 0x1c)
                         {
                             this.AnalyseSkillMark(ref loadInfo, markId);
                         }
                         else if (func.dwSkillFuncType == 0x21)
                         {
                             if (combineId != markId)
                             {
                                 this.AnalyseSkillCombine(ref loadInfo, markId);
                             }
                         }
                         else if (func.dwSkillFuncType == 0x36)
                         {
                             this.AnalyseSkillCombine(ref loadInfo, markId);
                         }
                         else if (func.dwSkillFuncType == 0x37)
                         {
                             this.AnalyseSkill(ref loadInfo, skillID);
                         }
                         else if (func.dwSkillFuncType == 0x1b)
                         {
                             this.AnalyseSkillCombine(ref loadInfo, iParam);
                         }
                     }
                 }
             }
         }
     }
 }