コード例 #1
0
        /// <summary>
        /// アニメーション対象のテクスチャのIDが変わっていないか判定し、
        /// 変更されたテクスチャがアニメ対象外であればマテリアルのスケールを強制的に0,1にセットし、falseを返す
        ///
        ///
        /// menuからの"マテリアル変更"は、materialオブジェクトを使いまわす
        /// "テクスチャ変更"は、さらにオフセットやスケールが変わらない仕様のため、
        /// ***_anim.tex以外のファイルはスケールを元に戻す
        /// </summary>
        /// <param name="anmTex">チェック対象オブジェクト</param>
        /// <returns>アニメーション対象であればtrue それ以外はfalse</returns>
        private bool HasTarget(ref AnimTex anmTex)
        {
            var tex1 = material.GetTexture(anmTex.texProp.PropId);

            if (tex1 == null)
            {
                // LogUtil.Debug("has no texture. ", anmTex.texProp, ", tex=", anmTex);
                anmTex = null;
                return(false);
            }

            if (tex1.GetInstanceID() != anmTex.texId)
            {
                // LogUtil.Debug("tex id changed.", anmTex.texId, "=>", tex1.GetInstanceID());
                var parsedAnmTex = ParseAnimUtil.ParseAnimTex(material, anmTex.texProp, tex1);
                if (parsedAnmTex == null)
                {
                    // LogUtil.Debug(" no anim tex");
                    if (settings.backScale)
                    {
                        RestoreTexPos(anmTex);
                    }
                    anmTex = null;
                    return(false);
                }

                anmTex = parsedAnmTex;
            }
            return(true);
        }
コード例 #2
0
        // Token: 0x060003F4 RID: 1012 RVA: 0x000230E8 File Offset: 0x000212E8
        private bool HasTarget(ref AnimTex anmTex)
        {
            Texture texture = this.material.GetTexture(anmTex.texProp.PropId);

            if (texture == null)
            {
                anmTex = null;
                return(false);
            }
            if (texture.GetInstanceID() != anmTex.texId)
            {
                AnimTex animTex = ParseAnimUtil.ParseAnimTex(this.material, anmTex.texProp, texture);
                if (animTex == null)
                {
                    if (AnimItem.settings.backScale)
                    {
                        this.RestoreTexPos(anmTex);
                    }
                    anmTex = null;
                    return(false);
                }
                anmTex = animTex;
            }
            return(true);
        }
コード例 #3
0
        // Token: 0x060003F9 RID: 1017 RVA: 0x000233C4 File Offset: 0x000215C4
        public List <AnimItem> ParseMaidSlot(TBodySkin slot, Material[] mates, IList <MenuFileHandler.MateInfo> miList)
        {
            if (mates == null)
            {
                return(null);
            }
            List <AnimItem> list = null;

            try
            {
                if (miList == null)
                {
                    int num = 0;
                    foreach (Material material in mates)
                    {
                        AnimTex[] array = ParseAnimUtil.ParseAnimTex(material);
                        if (array != null)
                        {
                            if (list == null)
                            {
                                list = new List <AnimItem>();
                            }
                            list.Add(new AnimItem(material, num, array));
                        }
                        num++;
                    }
                }
                else
                {
                    foreach (MenuFileHandler.MateInfo mateInfo in miList)
                    {
                        Material  material2 = mates[mateInfo.matNo];
                        AnimTex[] array2    = ParseAnimUtil.ParseAnimTex(material2);
                        if (array2 != null)
                        {
                            if (list == null)
                            {
                                list = new List <AnimItem>();
                            }
                            list.Add(new AnimItem(material2, mateInfo.matNo, array2));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogUtil.Debug(new object[]
                {
                    "slotId:",
                    slot,
                    ex.Message
                });
            }
            return(list);
        }
コード例 #4
0
        public List <AnimItem> ParseMaidSlot(TBodySkin slot, Material[] mates, IList <MenuFileHandler.MateInfo> miList)
        {
            if (mates == null)
            {
                return(null);
            }

            // 変更のあったスロットをパースし、マテリアル/テクスチャからアニメーション対象を抽出
            List <AnimItem> targets = null;

            try {
                if (miList == null)
                {
                    var mateNo = 0;
                    foreach (var mate in mates)
                    {
                        var animTexes = ParseAnimUtil.ParseAnimTex(mate);
                        if (animTexes != null)
                        {
                            if (targets == null)
                            {
                                targets = new List <AnimItem>();
                            }
                            targets.Add(new AnimItem(mate, mateNo, animTexes));
                        }
                        mateNo++;
                    }
                }
                else
                {
                    foreach (var mi in miList)
                    {
                        var mate      = mates[mi.matNo];
                        var animTexes = ParseAnimUtil.ParseAnimTex(mate);
                        if (animTexes != null)
                        {
                            if (targets == null)
                            {
                                targets = new List <AnimItem>();
                            }
                            targets.Add(new AnimItem(mate, mi.matNo, animTexes));
                        }
                    }
                }
            } catch (Exception e) {
                LogUtil.Debug("slotId:", slot, e.Message);
            }
            return(targets);
        }
        // Token: 0x06000418 RID: 1048 RVA: 0x00023934 File Offset: 0x00021B34
        public static AnimTex[] ParseAnimTex(Material m)
        {
            AnimTex[] array = null;
            int       num   = 0;

            foreach (TexProp texProp in ParseAnimUtil.targets)
            {
                AnimTex animTex = ParseAnimUtil.ParseAnimTex(m, texProp, null);
                if (animTex != null)
                {
                    array      = (array ?? new AnimTex[ParseAnimUtil.targets.Length]);
                    array[num] = animTex;
                }
                num++;
            }
            return(array);
        }
コード例 #6
0
 // Token: 0x06000426 RID: 1062 RVA: 0x00023E60 File Offset: 0x00022060
 private bool ParseMaterial(Material mate, int matNo)
 {
     AnimTex[] array = ParseAnimUtil.ParseAnimTex(mate);
     if (array != null)
     {
         AnimItem target = this.GetTarget(matNo);
         if (target != null)
         {
             target.UpdateTexes(mate, array);
         }
         else
         {
             this.targets.Add(new AnimItem(mate, matNo, array));
         }
         return(true);
     }
     return(false);
 }
コード例 #7
0
        private bool ParseMaterial(Material mate, int matNo)
        {
            var animTexes = ParseAnimUtil.ParseAnimTex(mate);

            if (animTexes != null)
            {
                var target = GetTarget(matNo);
                if (target != null)
                {
                    target.UpdateTexes(mate, animTexes);
                }
                else
                {
                    targets.Add(new AnimItem(mate, matNo, animTexes));
                }

                return(true);
            }

            return(false);
        }