private void AddReferencedAssets(DictionaryView <string, AGE.Action> actions, Dictionary <object, AssetRefType> actionAssets) { Dictionary <object, AssetRefType> .Enumerator enumerator = actionAssets.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <object, AssetRefType> current = enumerator.Current; AssetRefType type = current.Value; switch (type) { case AssetRefType.Action: { KeyValuePair <object, AssetRefType> pair2 = enumerator.Current; string key = pair2.Key as string; if (!this.actionDict.ContainsKey(key) && !actions.ContainsKey(key)) { actions.Add(key, null); } continue; } case AssetRefType.SkillID: { KeyValuePair <object, AssetRefType> pair5 = enumerator.Current; int skillID = (int)pair5.Key; this.AddActionsFromSkill(actions, skillID); continue; } case AssetRefType.SkillCombine: { KeyValuePair <object, AssetRefType> pair4 = enumerator.Current; int skillCombineID = (int)pair4.Key; this.AddActionsFromSkillCombine(actions, skillCombineID); continue; } case AssetRefType.Prefab: case AssetRefType.Particle: { KeyValuePair <object, AssetRefType> pair3 = enumerator.Current; string str2 = pair3.Key as string; if (!this.prefabDict.ContainsKey(str2)) { this.prefabDict.Add(str2, type == AssetRefType.Particle); } continue; } case AssetRefType.MonsterConfigId: { KeyValuePair <object, AssetRefType> pair6 = enumerator.Current; int num3 = (int)pair6.Key; this.AddActionsFromSoldier(actions, (uint)num3); continue; } } } }
public void SetRefType(AssetRefType refType) { if (refType == AssetRefType.Strong) { target = weakReference.Target as T; } else { target = null; } }
public void SetRefType(AssetRefType refType) { pool.SetRefType(refType); }
private void AddReferencedAssets(DictionaryView <string, Action> actions, Dictionary <object, AssetRefType> actionAssets) { Dictionary <object, AssetRefType> .Enumerator enumerator = actionAssets.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <object, AssetRefType> current = enumerator.get_Current(); AssetRefType value = current.get_Value(); switch (value) { case AssetRefType.Action: { KeyValuePair <object, AssetRefType> current2 = enumerator.get_Current(); string key = current2.get_Key() as string; if (!this.actionDict.ContainsKey(key) && !actions.ContainsKey(key)) { actions.Add(key, null); } break; } case AssetRefType.SkillID: { KeyValuePair <object, AssetRefType> current3 = enumerator.get_Current(); ulong num = (ulong)current3.get_Key(); int skillID = (int)(num & (ulong)-1); this.AddActionsFromSkill(actions, skillID); break; } case AssetRefType.SkillCombine: { KeyValuePair <object, AssetRefType> current4 = enumerator.get_Current(); ulong num2 = (ulong)current4.get_Key(); int skillCombineID = (int)(num2 & (ulong)-1); this.AddActionsFromSkillCombine(actions, skillCombineID); break; } case AssetRefType.Prefab: case AssetRefType.Particle: { KeyValuePair <object, AssetRefType> current5 = enumerator.get_Current(); string text = current5.get_Key() as string; if (!this.prefabDict.ContainsKey(text)) { this.prefabDict.Add(text, value == AssetRefType.Particle); } break; } case AssetRefType.MonsterConfigId: { KeyValuePair <object, AssetRefType> current6 = enumerator.get_Current(); ulong num3 = (ulong)current6.get_Key(); uint soldierID = (uint)(num3 & (ulong)-1); this.AddActionsFromSoldier(actions, soldierID); break; } } } }
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); }
public List <ActorPreloadTab> AnalyseAgeRefAssets(Dictionary <long, Dictionary <object, AssetRefType> > refAssetsDict) { List <ActorPreloadTab> list = new List <ActorPreloadTab>(); Dictionary <long, Dictionary <object, AssetRefType> > .Enumerator enumerator = refAssetsDict.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <long, Dictionary <object, AssetRefType> > current = enumerator.Current; long key = current.Key; int markID = (int)(key >> 0x20); int configID = (int)(((ulong)key) & 0xffffffffL); KeyValuePair <long, 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 = markID }; item.theActor.ConfigId = configID; list.Add(item); Dictionary <object, AssetRefType> .Enumerator enumerator2 = dictionary.GetEnumerator(); while (enumerator2.MoveNext()) { AssetLoadBase base3; int num4; AssetLoadBase base4; AssetLoadBase base5; int num5; AssetLoadBase base6; 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, markID); if (!this.ageCheckerSet.ContainsKey(checkerKey)) { item.ageActions.Add(base2); this.ageCheckerSet.Add(checkerKey, true); } continue; } case AssetRefType.SkillID: { KeyValuePair <object, AssetRefType> pair7 = enumerator2.Current; int skillID = (int)pair7.Key; this.AnalyseSkill(ref item, skillID); continue; } case AssetRefType.SkillCombine: { KeyValuePair <object, AssetRefType> pair6 = enumerator2.Current; int combineId = (int)pair6.Key; this.AnalyseSkillCombine(ref item, combineId); continue; } case AssetRefType.Prefab: base3 = new AssetLoadBase { assetPath = obj2 as string }; item.mesPrefabs.Add(base3); if (markID == 0) { continue; } num4 = 0; goto Label_01CC; case AssetRefType.Particle: { base5 = new AssetLoadBase(); KeyValuePair <object, AssetRefType> pair5 = enumerator2.Current; base5.assetPath = pair5.Key as string; item.parPrefabs.Add(base5); if (markID == 0) { continue; } num5 = 0; goto Label_024D; } case AssetRefType.Sound: { continue; } case AssetRefType.MonsterConfigId: { KeyValuePair <object, AssetRefType> pair8 = enumerator2.Current; int num8 = (int)pair8.Key; ActorMeta actorMeta = new ActorMeta { ActorType = ActorTypeDef.Actor_Type_Monster, ConfigId = num8, ActorCamp = COM_PLAYERCAMP.COM_PLAYERCAMP_MID }; this.AddPreloadActor(ref list, ref actorMeta, 0f, 0); continue; } default: { continue; } } Label_0198: base4 = new AssetLoadBase(); base4.assetPath = SkinResourceHelper.GetSkinResourceName(configID, markID, base3.assetPath, num4); item.mesPrefabs.Add(base4); num4++; Label_01CC: if (num4 < 3) { goto Label_0198; } continue; Label_0219: base6 = new AssetLoadBase(); base6.assetPath = SkinResourceHelper.GetSkinResourceName(configID, markID, base5.assetPath, num5); item.parPrefabs.Add(base6); num5++; Label_024D: if (num5 < 3) { goto Label_0219; } } } return(list); }
public AssetReference(AssetRefType refType) { this.RefType = refType; }
public void SetRefType(AssetRefType refType) { this.refType = refType; dict.Values.ForEach((x) => x.SetRefType(refType)); }
public List <ActorPreloadTab> AnalyseAgeRefAssets(Dictionary <long, Dictionary <object, AssetRefType> > refAssetsDict) { List <ActorPreloadTab> list = new List <ActorPreloadTab>(); Dictionary <long, Dictionary <object, AssetRefType> > .Enumerator enumerator = refAssetsDict.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <long, Dictionary <object, AssetRefType> > current = enumerator.get_Current(); long key = current.get_Key(); int num = (int)(key >> 32); int num2 = (int)(key & (long)((ulong)-1)); KeyValuePair <long, Dictionary <object, AssetRefType> > current2 = enumerator.get_Current(); Dictionary <object, AssetRefType> value = current2.get_Value(); ActorPreloadTab actorPreloadTab = new ActorPreloadTab(); actorPreloadTab.ageActions = new List <AssetLoadBase>(); actorPreloadTab.parPrefabs = new List <AssetLoadBase>(); actorPreloadTab.mesPrefabs = new List <AssetLoadBase>(); actorPreloadTab.spritePrefabs = new List <AssetLoadBase>(); actorPreloadTab.soundBanks = new List <AssetLoadBase>(); actorPreloadTab.behaviorXml = new List <AssetLoadBase>(); actorPreloadTab.MarkID = num; actorPreloadTab.theActor.ConfigId = num2; list.Add(actorPreloadTab); Dictionary <object, AssetRefType> .Enumerator enumerator2 = value.GetEnumerator(); while (enumerator2.MoveNext()) { KeyValuePair <object, AssetRefType> current3 = enumerator2.get_Current(); AssetRefType value2 = current3.get_Value(); KeyValuePair <object, AssetRefType> current4 = enumerator2.get_Current(); object key2 = current4.get_Key(); switch (value2) { case AssetRefType.Action: { AssetLoadBase assetLoadBase = default(AssetLoadBase); assetLoadBase.assetPath = (key2 as string); string checkerKey = this.GetCheckerKey(assetLoadBase.assetPath, num); if (!this.ageCheckerSet.ContainsKey(checkerKey)) { actorPreloadTab.ageActions.Add(assetLoadBase); this.ageCheckerSet.Add(checkerKey, true); } break; } case AssetRefType.SkillID: { KeyValuePair <object, AssetRefType> current5 = enumerator2.get_Current(); ulong num3 = (ulong)current5.get_Key(); int skillID = (int)(num3 & (ulong)-1); this.AnalyseSkill(ref actorPreloadTab, skillID); break; } case AssetRefType.SkillCombine: { KeyValuePair <object, AssetRefType> current6 = enumerator2.get_Current(); ulong num4 = (ulong)current6.get_Key(); int combineId = (int)(num4 & (ulong)-1); this.AnalyseSkillCombine(ref actorPreloadTab, combineId); break; } case AssetRefType.Prefab: { AssetLoadBase assetLoadBase2 = default(AssetLoadBase); assetLoadBase2.assetPath = (key2 as string); actorPreloadTab.mesPrefabs.Add(assetLoadBase2); if (num != 0) { for (int i = 0; i < 3; i++) { AssetLoadBase assetLoadBase3 = default(AssetLoadBase); assetLoadBase3.assetPath = SkinResourceHelper.GetSkinResourceName(num2, num, assetLoadBase2.assetPath, i); actorPreloadTab.mesPrefabs.Add(assetLoadBase3); } } break; } case AssetRefType.Particle: { AssetLoadBase assetLoadBase4 = default(AssetLoadBase); KeyValuePair <object, AssetRefType> current7 = enumerator2.get_Current(); assetLoadBase4.assetPath = (current7.get_Key() as string); actorPreloadTab.parPrefabs.Add(assetLoadBase4); if (num != 0) { for (int j = 0; j < 3; j++) { AssetLoadBase assetLoadBase5 = default(AssetLoadBase); assetLoadBase5.assetPath = SkinResourceHelper.GetSkinResourceName(num2, num, assetLoadBase4.assetPath, j); actorPreloadTab.parPrefabs.Add(assetLoadBase5); } } break; } case AssetRefType.MonsterConfigId: { KeyValuePair <object, AssetRefType> current8 = enumerator2.get_Current(); ulong num5 = (ulong)current8.get_Key(); int configId = (int)(num5 & (ulong)-1); ActorMeta actorMeta = default(ActorMeta); actorMeta.ActorType = ActorTypeDef.Actor_Type_Monster; actorMeta.ConfigId = configId; actorMeta.ActorCamp = COM_PLAYERCAMP.COM_PLAYERCAMP_MID; this.AddPreloadActor(ref list, ref actorMeta, 0f, 0); break; } case AssetRefType.CallActorConfigId: { KeyValuePair <object, AssetRefType> current9 = enumerator2.get_Current(); ulong num6 = (ulong)current9.get_Key(); int configId2 = (int)(num6 & (ulong)-1); ActorMeta actorMeta2 = default(ActorMeta); actorMeta2.ActorType = ActorTypeDef.Actor_Type_Hero; actorMeta2.ConfigId = configId2; actorMeta2.ActorCamp = COM_PLAYERCAMP.COM_PLAYERCAMP_MID; this.AddPreloadActor(ref list, ref actorMeta2, 0f, 0); break; } } } } return(list); }