Exemplo n.º 1
0
    public IEnumerator DoDissolveEffect(List <SkinnedMeshRenderer> meshs)
    {
        //return;
        if (meshs == null)
        {
            yield break;
        }
        foreach (var render in meshs)
        {
            yield return(null);

            Shader shader         = render.sharedMaterial.shader;
            var    textureClothes = render.sharedMaterial.GetTexture("_Part1Tex");
            var    textureEquips  = render.sharedMaterial.GetTexture("_Part2Tex");
            Loader.Instance.CreatTexture("noise", tex =>
            {
                DissolveBurn db = DissolveBurn.Begin(render.gameObject, roleEffectBehaviour.speed, roleEffectBehaviour.begein, roleEffectBehaviour.end);
                db.SetMats(render.sharedMaterial, tex, Color.white);
                render.sharedMaterial.mainTexture = textureClothes ?? textureEquips;
                db.SetFinish(() =>
                {
                    render.sharedMaterial.shader = shader;
                });
            });
            //break;
        }
    }
Exemplo n.º 2
0
    protected override void OnInit()
    {
        DissolveBurn db = DissolveBurn.Begin(parent.gameObject, 0.2f, 0, 1.2f);

        Renderer[] renders = parent.gameObject.GetComponentsInChildren <Renderer>();
        for (int i = 0; i < renders.Length; i++)
        {
            if (renders[i] && renders[i].material)
            {
                db.SetMats(renders[i].material, GetAsset() as Texture, Color.red);
            }
        }
    }