private int PlayTexEffect(Texture2D tex, int type) { if (tex == null) { return(-1); } if (!this.CheckMats()) { return(-1); } SMaterialEffect_Tex sMaterialEffect_Tex = this.FindOrCreateEffect <SMaterialEffect_Tex>(type); if (sMaterialEffect_Tex.tex != null) { sMaterialEffect_Tex.Replay(tex); } else { sMaterialEffect_Tex.tex = tex; sMaterialEffect_Tex.texParamName = "_EffectTex"; sMaterialEffect_Tex.shaderKeyword = "_EFFECT_TEX_ON"; sMaterialEffect_Tex.enableFade = true; sMaterialEffect_Tex.hasFadeFactor = true; sMaterialEffect_Tex.fadeInterval = 0.08f; sMaterialEffect_Tex.fadeParamName = "_EffectFactor"; sMaterialEffect_Tex.factorScale = 0.85f; sMaterialEffect_Tex.Play(); } return(sMaterialEffect_Tex.playingId); }
private void StopTexEffect(int type, int playingId) { if (playingId < 0) { return; } SMaterialEffect_Tex sMaterialEffect_Tex = this.FindEffect(type) as SMaterialEffect_Tex; if (sMaterialEffect_Tex == null) { return; } if (playingId > 0 && sMaterialEffect_Tex.playingId != playingId) { return; } if (sMaterialEffect_Tex.enableFade) { sMaterialEffect_Tex.BeginFadeOut(); } else { this.StopEffect(sMaterialEffect_Tex); } }
private void StopTexEffect(int type, int playingId) { if (playingId >= 0) { SMaterialEffect_Tex effect = this.FindEffect(type) as SMaterialEffect_Tex; if ((effect != null) && ((playingId <= 0) || (effect.playingId == playingId))) { if (effect.enableFade) { effect.BeginFadeOut(); } else { this.StopEffect(effect); } } } }