public static void CopyTexture(TexSetter s, TexLoader l) { if (l.Target.mainTexture != null && AssetBundlePath.inst.IsCdnAsset(l.Target.mainTexture)) { AssetRef r = new AssetRef(); r.cdn = true; r.SetPath(l.Target.mainTexture); s.textures.Add(r); EditorUtil.SetDirty(s); } }
public static void SetIfCdn(UITexture tex) { if (tex == null || tex.mainTexture == null || tex.GetComponent <TexSetter>() != null) { return; } /// Add TexSetter if texture is from CDN if (AssetBundlePath.inst.IsCdnAsset(tex.mainTexture)) { TexLoader l = tex.GetComponentEx <TexLoader>(); TexSetter s = l.GetComponentEx <TexSetter>(); TexSetterInspector.CopyTexture(s, l); } }