public Material set_strength_shader(Material ml, Texture2D tex1, int id, int fxlevel)
    {
        //Material cur_mat = ml;
        Texture tex = ml.GetTexture(EnumShader.SPI_MAINTEX);

        ////例如   mage_skin0_diff_h 到 mage_skin0_q
        //string tex1_name = tex.name.Substring(0, tex.name.Length - 6) + "q";
        ////debug.Log("材质是"+ tex1_name);

        ////Texture tex1 = GAMEAPI.ABFight_LoadTexture2D("mtl_" + tex1_name);
        //Texture tex1 = null;
        Material mtl_inst = GameObject.Instantiate(m_fxLvMtl) as Material;

        mtl_inst.SetTexture(EnumShader.SPI_MAINTEX, tex);

        if (tex1 != null)
        {
            mtl_inst.SetTexture(EnumShader.SPI_SUBTEX, tex1);
        }

        SXML xml = XMLMgr.instance.GetSXML("item.stage", "stage_level==" + fxlevel);

        if (xml == null)
        {
            return(mtl_inst);
        }

        xml = xml.GetNode("stage_info", "itemid==" + id);
        if (xml == null)
        {
            return(mtl_inst);
        }

        xml = xml.GetNode("intensify_light", null);
        if (xml == null)
        {
            return(mtl_inst);
        }

        string[] high_light     = xml.getString("high_light").Split(',');
        string[] strength_light = xml.getString("strength_light").Split(',');
        string[] color          = xml.getString("color").Split(',');

        Vector4 splRim   = new Vector4(float.Parse(high_light[0]), float.Parse(high_light[1]), float.Parse(high_light[2]), float.Parse(high_light[3]));
        Vector4 strAnim  = new Vector4(float.Parse(strength_light[0]), float.Parse(strength_light[1]), float.Parse(strength_light[2]), float.Parse(strength_light[3]));
        Color   strColor = new Color(float.Parse(color[0]) / 255, float.Parse(color[1]) / 255, float.Parse(color[2]) / 255);

        mtl_inst.SetVector(EnumShader.SPI_SPLRIM, splRim);
        mtl_inst.SetVector(EnumShader.SPI_STRANIM, strAnim);
        mtl_inst.SetColor(EnumShader.SPI_STRCOLOR, strColor);
        return(mtl_inst);
    }
예제 #2
0
    public float GetTraceRange(int mid)
    {
        bool  flag = this.dMon.ContainsKey(mid);
        float result;

        if (flag)
        {
            SXML  expr_1D = this.dMon[mid];
            float?arg_59_0;
            if (expr_1D == null)
            {
                arg_59_0 = null;
            }
            else
            {
                SXML expr_3B = expr_1D.GetNode("ai", "");
                arg_59_0 = ((expr_3B != null) ? new float?(expr_3B.getFloat("tracerang")) : null);
            }
            result = (arg_59_0 ?? 0f) / 53.333f;
        }
        else
        {
            result = 0f;
        }
        return(result);
    }
예제 #3
0
    public Material set_strength_shader(Material ml, int id, int fxlevel)
    {
        Material material = UnityEngine.Object.Instantiate <Material>(this.m_fxLvMtl);
        Texture  texture  = ml.GetTexture(EnumShader.SPI_MAINTEX);

        material.SetTexture(EnumShader.SPI_MAINTEX, texture);
        string str = texture.name.Substring(0, texture.name.Length - 6) + "q";

        debug.Log("材质是" + str);
        Texture texture2 = Resources.Load("mtl/" + str) as Texture2D;
        bool    flag     = texture2 != null;

        if (flag)
        {
            material.SetTexture(EnumShader.SPI_SUBTEX, texture2);
        }
        SXML     sXML  = XMLMgr.instance.GetSXML("item.stage", "stage_level==" + fxlevel);
        bool     flag2 = sXML == null;
        Material result;

        if (flag2)
        {
            result = material;
        }
        else
        {
            sXML = sXML.GetNode("stage_info", "itemid==" + id);
            bool flag3 = sXML == null;
            if (flag3)
            {
                result = material;
            }
            else
            {
                sXML = sXML.GetNode("intensify_light", null);
                bool flag4 = sXML == null;
                if (flag4)
                {
                    result = material;
                }
                else
                {
                    string[] array = sXML.getString("high_light").Split(new char[]
                    {
                        ','
                    });
                    string[] array2 = sXML.getString("strength_light").Split(new char[]
                    {
                        ','
                    });
                    string[] array3 = sXML.getString("color").Split(new char[]
                    {
                        ','
                    });
                    Vector4 vector  = new Vector4(float.Parse(array[0]), float.Parse(array[1]), float.Parse(array[2]), float.Parse(array[3]));
                    Vector4 vector2 = new Vector4(float.Parse(array2[0]), float.Parse(array2[1]), float.Parse(array2[2]), float.Parse(array2[3]));
                    Color   color   = new Color(float.Parse(array3[0]) / 255f, float.Parse(array3[1]) / 255f, float.Parse(array3[2]) / 255f);
                    material.SetVector(EnumShader.SPI_SPLRIM, vector);
                    material.SetVector(EnumShader.SPI_STRANIM, vector2);
                    material.SetColor(EnumShader.SPI_STRCOLOR, color);
                    result = material;
                }
            }
        }
        return(result);
    }
예제 #4
0
        public bool WillPick(uint tpid)
        {
            a3_ItemData itemDataById = ModelBase <a3_BagModel> .getInstance().getItemDataById(tpid);

            int  quality = itemDataById.quality;
            int  num     = 1 << quality - 1;
            bool result  = true;
            bool flag    = itemDataById.item_type == 1;

            if (flag)
            {
                SXML     sXML   = XMLMgr.instance.GetSXML("autoplay", "");
                string[] source = sXML.GetNode("eqp_cailiao", "").getString("list").Split(new char[]
                {
                    ','
                });
                string[] source2 = sXML.GetNode("pet_cailiao", "").getString("list").Split(new char[]
                {
                    ','
                });
                string[] source3 = sXML.GetNode("wing_cailiao", "").getString("list").Split(new char[]
                {
                    ','
                });
                string[] source4 = sXML.GetNode("summon_cailiao", "").getString("list").Split(new char[]
                {
                    ','
                });
                string[] source5 = sXML.GetNode("drugs", "").getString("list").Split(new char[]
                {
                    ','
                });
                bool flag2 = source.Contains(tpid.ToString()) && this.PickEqp_cailiao != 1;
                if (flag2)
                {
                    result = false;
                }
                else
                {
                    bool flag3 = source2.Contains(tpid.ToString()) && this.PickPet_cailiao != 1;
                    if (flag3)
                    {
                        result = false;
                    }
                    else
                    {
                        bool flag4 = source3.Contains(tpid.ToString()) && this.PickWing_cailiao != 1;
                        if (flag4)
                        {
                            result = false;
                        }
                        else
                        {
                            bool flag5 = source4.Contains(tpid.ToString()) && this.PickSummon_cailiao != 1;
                            if (flag5)
                            {
                                result = false;
                            }
                            else
                            {
                                bool flag6 = source5.Contains(tpid.ToString()) && this.PickDrugs != 1;
                                if (flag6)
                                {
                                    result = false;
                                }
                                else
                                {
                                    bool flag7 = this.PickOther != 1;
                                    if (flag7)
                                    {
                                        result = false;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                bool flag8 = itemDataById.item_type == 2;
                if (flag8)
                {
                    result = ((num & this.PickEqp) != 0);
                }
                else
                {
                    bool flag9 = tpid == 0u;
                    if (flag9)
                    {
                        bool flag10 = this.PickGold != 1;
                        if (flag10)
                        {
                            result = false;
                        }
                    }
                }
            }
            return(result);
        }