// Token: 0x0600041E RID: 1054 RVA: 0x00023C4B File Offset: 0x00021E4B public static bool TryGetTargetTex(Material m, TexProp texType, out Texture tex) { tex = ((texType == TexProp.MainTex) ? m.mainTexture : m.GetTexture(texType.PropId)); return(tex != null && ParseAnimUtil.IsTarget(tex)); }
// Token: 0x06000419 RID: 1049 RVA: 0x0002398C File Offset: 0x00021B8C public static AnimTex ParseAnimTex(Material mate, TexProp texProp, Texture tex = null) { try { if (tex != null) { if (!ParseAnimUtil.IsTarget(tex)) { return(null); } } else if (!ParseAnimUtil.TryGetTargetTex(mate, texProp, out tex)) { return(null); } Vector2 scale = (texProp == TexProp.MainTex) ? mate.mainTextureScale : mate.GetTextureScale(texProp.PropId); if (mate.HasProperty(texProp.PropScrollXId) || mate.HasProperty(texProp.PropScrollYId)) { Vector2 scroll; scroll.x = ParseAnimUtil.fitting(mate.GetFloat(texProp.PropScrollXId)); scroll.y = ParseAnimUtil.fitting(mate.GetFloat(texProp.PropScrollYId)); float frameSec = ParseAnimUtil.ParseFrameSecond(mate, texProp); ScrollTex scrollTex = new ScrollTex(scroll, tex, frameSec) { texProp = texProp }; scrollTex.InitOffsetIndex(mate.GetTextureOffset(texProp.PropId)); return(scrollTex); } if (scale.x <= 0.5f || scale.y <= 0.5f) { if (ParseAnimUtil.Equals(scale.x, 0f, 1E-06f) || ParseAnimUtil.Equals(scale.y, 0f, 1E-06f)) { return(null); } float frameSec2 = ParseAnimUtil.ParseFrameSecond(mate, texProp); SlideScaledTex slideScaledTex = new SlideScaledTex(scale, tex, frameSec2) { texProp = texProp }; if (slideScaledTex.imageLength > 1) { slideScaledTex.InitOffsetIndex(mate.GetTextureOffset(texProp.PropId)); LogUtil.DebugF("{0} X:{1},Y:{2},length={3}", new object[] { texProp, slideScaledTex.ratioX, slideScaledTex.ratioY, slideScaledTex.imageLength }); return(slideScaledTex); } return(slideScaledTex); } } catch (Exception ex) { LogUtil.Debug(new object[] { "Failed to parse texture:", texProp, ex }); } return(null); }
// Token: 0x0600041D RID: 1053 RVA: 0x00023C10 File Offset: 0x00021E10 public static bool HasTargetTexName(Material m, TexProp texType) { Texture texture = (texType == TexProp.MainTex) ? m.mainTexture : m.GetTexture(texType.PropId); return(texture != null && ParseAnimUtil.IsTarget(texture)); }