public void SetDecalProps(int idx, DecalMaterialProperties decalMatProps) { if (DecalMaterialsProps == null || idx >= DecalMaterialsProps.Length) { Log.LogErrorFormatted(this, "Decal index {0} is invalid!", idx); } else { DecalMaterialsProps[idx] = decalMatProps; } }
public override List <Object> InternalReferences() { List <Object> list = base.InternalReferences(); list.AddRange(this.EquipmentMaterial.InternalReferences()); DecalMaterialProperties[] decalMaterials = this.DecalMaterials; for (int i = 0; i < decalMaterials.Length; i++) { DecalMaterialProperties decalMaterialProperties = decalMaterials[i]; list.AddRange(decalMaterialProperties.InternalReferences()); } return(list); }
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; })); } }