public bool DuplicateFilter(Maid maid, string slotName, Material mat, string fromPropName, string toPropName) { var srcTex2d = mat.GetTexture(fromPropName) as Texture2D; if (srcTex2d == null || string.IsNullOrEmpty(srcTex2d.name)) { return(false); } var srcFilter = GetFilter(maid, slotName, mat.name, srcTex2d.name); var dstTex2d = mat.GetTexture(toPropName) as Texture2D; if (dstTex2d == null || string.IsNullOrEmpty(dstTex2d.name)) { return(false); } var key = CreateKey(MaidHelper.GetGuid(maid), slotName, mat.name, dstTex2d.name); var dstFilter = new FilterParam(srcFilter); _filterParams.Add(key.ToString(), dstFilter); FilterTexture(dstTex2d, dstFilter); return(true); }
// Token: 0x06000097 RID: 151 RVA: 0x00009238 File Offset: 0x00007438 public bool DuplicateFilter(Maid maid, string slotName, Material mat, string fromPropName, string toPropName) { Texture2D texture2D = mat.GetTexture(fromPropName) as Texture2D; if (texture2D == null || string.IsNullOrEmpty(texture2D.name)) { return(false); } TextureModifier.FilterParam filter = this.GetFilter(maid, slotName, mat.name, texture2D.name); Texture2D texture2D2 = mat.GetTexture(toPropName) as Texture2D; if (texture2D2 == null || string.IsNullOrEmpty(texture2D2.name)) { return(false); } StringBuilder stringBuilder = this.CreateKey(new string[] { MaidHelper.GetGuid(maid), slotName, mat.name, texture2D2.name }); TextureModifier.FilterParam filter2 = new TextureModifier.FilterParam(filter); this._filterParams.Add(stringBuilder.ToString(), filter2); this.FilterTexture(texture2D2, filter2); return(true); }
public bool IsChanged(Maid maid, string slotName, string matName, string texName) { var key = CreateKey(MaidHelper.GetGuid(maid), slotName, matName, texName); var filterParam = _filterParams.Get(key.ToString()); return((filterParam != null) && !filterParam.HasNotChanged()); }
// Token: 0x06000096 RID: 150 RVA: 0x000091F4 File Offset: 0x000073F4 public TextureModifier.FilterParam GetFilter(Maid maid, string slotName, string matName, string texName) { StringBuilder stringBuilder = this.CreateKey(new string[] { MaidHelper.GetGuid(maid), slotName, matName, texName }); return(this._filterParams.Get(stringBuilder.ToString())); }
// Token: 0x06000091 RID: 145 RVA: 0x00009078 File Offset: 0x00007278 public bool RemoveFilter(Maid maid, string slotName, Material mat, Texture2D tex2D) { StringBuilder stringBuilder = this.CreateKey(new string[] { MaidHelper.GetGuid(maid), slotName, mat.name, tex2D.name }); return(this._filterParams.Remove(stringBuilder.ToString())); }
// Token: 0x06000093 RID: 147 RVA: 0x00009110 File Offset: 0x00007310 public bool IsChanged(Maid maid, string slotName, string matName, string texName) { StringBuilder stringBuilder = this.CreateKey(new string[] { MaidHelper.GetGuid(maid), slotName, matName, texName }); TextureModifier.FilterParam filterParam = this._filterParams.Get(stringBuilder.ToString()); return(filterParam != null && !filterParam.HasNotChanged()); }
public void ProcGUI(Maid maid, string slotName, Material material, string propName) { // material 抽出 => texture 抽出 var tex2D = material.GetTexture(propName) as Texture2D; if (tex2D == null || string.IsNullOrEmpty(tex2D.name)) { return; } var key = CreateKey(MaidHelper.GetGuid(maid), slotName, material.name, tex2D.name); var fp = _filterParams.GetOrAdd(key.ToString()); fp.ProcGUI(tex2D); }
private string GetKey(Maid maid, string slotName, Material material, string propName) { if (maid == null || material == null || string.IsNullOrEmpty(propName)) { return(null); } var tex2d = material.GetTexture(propName) as Texture2D; if (tex2d == null || string.IsNullOrEmpty(tex2d.name)) { return(null); } return(CreateKey(MaidHelper.GetGuid(maid), slotName, material.name, tex2d.name).ToString()); }
public bool ApplyFilter(Maid maid, string slotName, Material mat, string propName, FilterParam filter) { var tex2d = mat.GetTexture(propName) as Texture2D; if (tex2d == null || string.IsNullOrEmpty(tex2d.name)) { return(false); } var key = CreateKey(MaidHelper.GetGuid(maid), slotName, mat.name, tex2d.name); var filter2 = new FilterParam(filter); _filterParams.Add(key.ToString(), filter2); FilterTexture(tex2d, filter2); return(true); }
// Token: 0x0600008A RID: 138 RVA: 0x00008E64 File Offset: 0x00007064 public void ProcGUI(Maid maid, string slotName, Material material, string propName) { Texture2D texture2D = material.GetTexture(propName) as Texture2D; if (texture2D == null || string.IsNullOrEmpty(texture2D.name)) { return; } StringBuilder stringBuilder = this.CreateKey(new string[] { MaidHelper.GetGuid(maid), slotName, material.name, texture2D.name }); TextureModifier.FilterParam orAdd = this._filterParams.GetOrAdd(stringBuilder.ToString()); orAdd.ProcGUI(texture2D); }
public bool UpdateTex(Maid maid, Material mat, EditTarget texEdit) { var tex2D = mat.GetTexture(texEdit.propName) as Texture2D; if (tex2D == null || string.IsNullOrEmpty(tex2D.name)) { return(false); } var key = CreateKey(MaidHelper.GetGuid(maid), texEdit.slotName, mat.name, tex2D.name); var filterParam = _filterParams.GetOrAdd(key.ToString()); // スライダー変更がなければ何もしない if (!filterParam.IsDirty) { return(false); } //LogUtil.DebugLogF("Update Texture. slot={0}, material={0}, tex={1}", texEdit.slotName, mat.name, tex2d.name); FilterTexture(tex2D, filterParam); return(true); }
// Token: 0x0600008E RID: 142 RVA: 0x00008F94 File Offset: 0x00007194 public bool UpdateTex(Maid maid, Material mat, EditTarget texEdit) { Texture2D texture2D = mat.GetTexture(texEdit.propName) as Texture2D; if (texture2D == null || string.IsNullOrEmpty(texture2D.name)) { return(false); } StringBuilder stringBuilder = this.CreateKey(new string[] { MaidHelper.GetGuid(maid), texEdit.slotName, mat.name, texture2D.name }); TextureModifier.FilterParam orAdd = this._filterParams.GetOrAdd(stringBuilder.ToString()); if (!orAdd.IsDirty) { return(false); } this.FilterTexture(texture2D, orAdd); return(true); }
public FilterParam GetFilter(Maid maid, string slotName, string matName, string texName) { var key = CreateKey(MaidHelper.GetGuid(maid), slotName, matName, texName); return(_filterParams.Get(key.ToString())); }
public bool RemoveFilter(Maid maid, string slotName, Material mat, Texture2D tex2D) { var key = CreateKey(MaidHelper.GetGuid(maid), slotName, mat.name, tex2D.name); return(_filterParams.Remove(key.ToString())); }