public static KeyValuePair <TypedAssetContentKey <EquipmentViewDefinition>, Action <EquipmentViewDefinition> > CreatePartContent(AvatarModel model, ViewPart partView, AvatarModel.Part modelPart, EquipmentModelDefinition.Part eqPart) { AvatarView.__c__DisplayClass1 __c__DisplayClass = new AvatarView.__c__DisplayClass1(); __c__DisplayClass.partView = partView; TypedAssetContentKey <EquipmentViewDefinition> key = model.Definition.CreatePartKey(modelPart.Equipment, eqPart, model.LodLevel); return(new KeyValuePair <TypedAssetContentKey <EquipmentViewDefinition>, Action <EquipmentViewDefinition> >(key, new Action <EquipmentViewDefinition>(__c__DisplayClass._CreatePartContent_b__0))); }
public static KeyValuePair <TypedAssetContentKey <EquipmentViewDefinition>, Action <EquipmentViewDefinition> > CreatePartContent(AvatarModel model, ViewPart partView, AvatarModel.Part modelPart, EquipmentModelDefinition.Part eqPart) { TypedAssetContentKey <EquipmentViewDefinition> key = model.Definition.CreatePartKey(modelPart.Equipment, eqPart, model.LodLevel); return(new KeyValuePair <TypedAssetContentKey <EquipmentViewDefinition>, Action <EquipmentViewDefinition> >(key, delegate(EquipmentViewDefinition eq) { onPartDefinitionLoaded(partView, eq); })); }
public void Unload <T>(Request <T> request) where T : UnityEngine.Object { for (int i = 0; i < request.Loaded.Count; i++) { TypedAssetContentKey <T> typedAssetContentKey = request.Loaded[i]; if (typedAssetContentKey != null) { request.Cache.Release(typedAssetContentKey); request.Loaded[i] = null; } } request.Finished = false; }
public static void CreateDecalContent(ViewPart partView, AvatarModel.Part modelPart, List <KeyValuePair <TypedAssetContentKey <Texture2D>, Action <Texture2D> > > decalContent) { partView.InitDecalProps(modelPart.Decals.Length); for (int i = 0; i < modelPart.Decals.Length; i++) { AvatarView.__c__DisplayClass4 __c__DisplayClass = new AvatarView.__c__DisplayClass4(); DCustomEquipmentDecal decal = modelPart.Decals[i]; __c__DisplayClass.decalMatProp = new DecalMaterialProperties(decal.Index); __c__DisplayClass.decalMatProp.Import(decal, null); partView.SetDecalProps(i, __c__DisplayClass.decalMatProp); TypedAssetContentKey <Texture2D> key = AvatarView.CreateDecalKey(decal); decalContent.Add(new KeyValuePair <TypedAssetContentKey <Texture2D>, Action <Texture2D> >(key, new Action <Texture2D>(__c__DisplayClass._CreateDecalContent_b__3))); } }
public static void CreateDecalContent(ViewPart partView, AvatarModel.Part modelPart, List <KeyValuePair <TypedAssetContentKey <Texture2D>, Action <Texture2D> > > decalContent) { partView.InitDecalProps(modelPart.Decals.Length); for (int i = 0; i < modelPart.Decals.Length; i++) { DCustomEquipmentDecal decal = modelPart.Decals[i]; DecalMaterialProperties decalMatProp = new DecalMaterialProperties(decal.Index); decalMatProp.Import(decal); partView.SetDecalProps(i, decalMatProp); TypedAssetContentKey <Texture2D> key = CreateDecalKey(decal); decalContent.Add(new KeyValuePair <TypedAssetContentKey <Texture2D>, Action <Texture2D> >(key, delegate(Texture2D decalTex) { decalMatProp.Texture = decalTex; })); } }
public Request <T> Load <T>(IEnumerable <KeyValuePair <TypedAssetContentKey <T>, Action <T> > > content, ContentCache <T> cache, Action <Request <T> > onFinished = null) where T : UnityEngine.Object { Request <T> request = new Request <T>(cache); foreach (KeyValuePair <TypedAssetContentKey <T>, Action <T> > item in content) { TypedAssetContentKey <T> key = item.Key; Action <T> handler = item.Value; request.Loaded.Add(key); loadFirst(cache.Acquire(key, delegate(T x) { request.numLoaded++; handler(x); })); } loadLast(waitRequest(request, onFinished)); return(request); }
private IEnumerator loadSprite(TypedAssetContentKey <Sprite> key, Image image) { AssetRequest <Sprite> request = null; try { request = Content.LoadAsync(key); } catch (Exception ex) { Log.LogException(this, ex); } if (request != null) { yield return(request); image.sprite = request.Asset; } yield return(null); image.color = Color.white; }
private void loadFranchiseDefinition() { TypedAssetContentKey <ScriptableObject> key = new TypedAssetContentKey <ScriptableObject>(FranchiseDefinitionKeyPath); Content.LoadAsync(onFranchiseDefinitionLoaded, key); }