private void PlayerImpl() { GenrateMaterialInstance(); //把材质设置进动画里 if (FadeInOutMaterialColor) { //如果运行模式不是外部指定的 if (FadeInOutMaterialColor.RunMode == EffectRunMode.OutSiedePointed) { FadeInOutMaterialColor.SetMaterialInstance(GetMaterialInstance()); FadeInOutMaterialColor.Play(); } } if (FadeInOutMaterialFloat) { //如果运行模式不是外部指定的 if (FadeInOutMaterialFloat.RunMode == EffectRunMode.OutSiedePointed) { FadeInOutMaterialFloat.SetMaterialInstance(GetMaterialInstance()); FadeInOutMaterialFloat.Play(); } } if (UVTextureAnimator) { //如果运行模式不是外部指定的 if (UVTextureAnimator.RunMode == EffectRunMode.OutSiedePointed) { UVTextureAnimator.SetMaterialInstance(GetMaterialInstance()); UVTextureAnimator.Play(); } } if (UVScroll) { //如果运行模式不是外部指定的 if (UVScroll.RunMode == EffectRunMode.OutSiedePointed) { UVScroll.SetMaterialInstance(GetMaterialInstance()); UVScroll.Play(); } } if (GradientColor) { //如果运行模式不是外部指定的 if (GradientColor.RunMode == EffectRunMode.OutSiedePointed) { GradientColor.SetMaterialInstance(GetMaterialInstance()); GradientColor.Play(); } } if (Duartion > 0.03f) { GameUtil.StartCoroutineHelper(this, WaitForFinish()); } }
void PlayMaterialControl() { List <Material> mats = new List <Material>(); mats.Clear(); if (useMultiColor) { foreach (LineRenderer line in m_subLineRenders) { mats.AddRange(line.materials); } UVScroll.SetMaterialInstance(mats); } else { mats.AddRange(m_LineRender.materials); } //把材质设置进动画里 if (FadeInOutMaterialColor) { //如果运行模式不是外部指定的 if (FadeInOutMaterialColor.RunMode == EffectRunMode.OutSiedePointed) { FadeInOutMaterialColor.SetMaterialInstance(mats); FadeInOutMaterialColor.Play(); } } if (FadeInOutMaterialFloat) { //如果运行模式不是外部指定的 if (FadeInOutMaterialFloat.RunMode == EffectRunMode.OutSiedePointed) { FadeInOutMaterialFloat.SetMaterialInstance(mats); FadeInOutMaterialFloat.Play(); } } if (UVTextureAnimator) { //如果运行模式不是外部指定的 if (UVTextureAnimator.RunMode == EffectRunMode.OutSiedePointed) { UVTextureAnimator.SetMaterialInstance(mats); UVTextureAnimator.Play(); } } if (UVScroll) { //如果运行模式不是外部指定的 if (UVScroll.RunMode == EffectRunMode.OutSiedePointed) { UVScroll.SetMaterialInstance(mats); UVScroll.Play(); } } }
void PlayMaterialControl() { //把材质设置进动画里 if (FadeInOutMaterialColor) { //如果运行模式不是外部指定的 if (FadeInOutMaterialColor.RunMode == EffectRunMode.OutSiedePointed) { FadeInOutMaterialColor.SetMaterialInstance(GenerateMaterialInstance()); FadeInOutMaterialColor.Play(); } } if (FadeInOutMaterialFloat) { //如果运行模式不是外部指定的 if (FadeInOutMaterialFloat.RunMode == EffectRunMode.OutSiedePointed) { FadeInOutMaterialFloat.SetMaterialInstance(GenerateMaterialInstance()); FadeInOutMaterialFloat.Play(); } } if (UVTextureAnimator) { //如果运行模式不是外部指定的 if (UVTextureAnimator.RunMode == EffectRunMode.OutSiedePointed) { UVTextureAnimator.SetMaterialInstance(GenerateMaterialInstance()); UVTextureAnimator.Play(); } } if (UVScroll) { //如果运行模式不是外部指定的 if (UVScroll.RunMode == EffectRunMode.OutSiedePointed) { UVScroll.SetMaterialInstance(GenerateMaterialInstance()); UVScroll.Play(); } } if (GradientColor) { //如果运行模式不是外部指定的 if (GradientColor.RunMode == EffectRunMode.OutSiedePointed) { GradientColor.SetMaterialInstance(GenerateMaterialInstance()); GradientColor.Play(); } } }
public override void OnInspectorGUI() { EditorGUILayout.HelpBox("Effect_UVScroll脚本不能和Effect_UVTextureAnimator同时作用于同一张贴图", MessageType.Warning); pa.RunMode = (EffectRunMode)EditorGUILayout.EnumPopup("运行模式:", pa.RunMode); serializedObject.Update(); EditorGUI.BeginChangeCheck(); pa.TexturePropertyName = EditorGUILayout.TextField("属性名:", pa.TexturePropertyName); if (pa.RunMode == EffectRunMode.Self) { pa.UseSharedMaterial = EditorGUILayout.Toggle("使用共享材质:", pa.UseSharedMaterial); } pa.fStartDelay = EditorGUILayout.FloatField("延迟开始(小于0.03无延迟):", pa.fStartDelay); pa.Rows = EditorGUILayout.IntField("行:", pa.Rows); pa.Columns = EditorGUILayout.IntField("列:", pa.Columns); pa.Fps = EditorGUILayout.FloatField("帧数:", pa.Fps); pa.SelfTiling = EditorGUILayout.Vector2Field("密度:", pa.SelfTiling); pa.AniTimes = EditorGUILayout.IntField("播放次数(小于等于0无限次):", pa.AniTimes); pa.IsReverse = EditorGUILayout.Toggle("逆向:", pa.IsReverse); pa.UseModelUV = EditorGUILayout.Toggle("使用模型UV:", pa.UseModelUV); if (GUILayout.Button("Play")) { pa.Play(); } if (GUILayout.Button("Stop")) { pa.Stop(); } if (GUI.changed) { EditorUtility.SetDirty(pa); } }