• 大小: 8.56MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-10
  • 语言: 其他
  • 标签: unity3d  ugui  

资源简介

UGUI各种UI shader效果,附带unity工程文件,大概几十种效果 5.6以上版本 需要text mesh pro 插件 unity商店有免费下载即可

资源截图

代码片段和文件信息

#if TMP_PRESENT
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro.EditorUtilities;
using UnityEditor;
using Coffee.UIExtensions;
using System.IO;
using System.Linq;
using System;

namespace Coffee.UIEffect.Editors
{
public class TMP_SDFShaderGUI : TMPro.EditorUtilities.TMP_SDFShaderGUI
{
static GUIstyle s_Paneltitle;
Material currentMaterial;

public override void OnGUI(MaterialEditor materialEditor MaterialProperty[] properties)
{
currentMaterial = materialEditor.target as Material;
base.OnGUI(materialEditor properties);
}

protected override void DoGUI()
{
if (currentMaterial.HasProperty(“_FaceColor“))
{
base.DoGUI();
}
else
{
DrawSpritePanel();
}

var name = currentMaterial.shader.name;
if (name.EndsWith(“(UIEffect)“))
{
DrawEffectPanel();
}
else if (name.EndsWith(“(UIDissolve)“))
{
DrawDissolvePanel();
}
else if (name.EndsWith(“(UIShiny)“))
{
DrawShinyPanel();
}
else if (name.EndsWith(“(UITransition)“))
{
DrawTransitionPanel();
}
}

void DrawSpritePanel()
{
if (BeginTmpPanel(“Sprite“ true))
{
EditorGUI.indentLevel += 1;
DoTexture2D(“_MainTex“ “Texture“);
DoColor(“_Color“ “Color“);
EditorGUI.indentLevel -= 1;
}
EndTmpPanel();
}

void DrawDissolvePanel()
{
if (BeginTmpPanel(“Dissolve“ true))
{
EditorGUI.indentLevel += 1;
DoTexture2D(“_NoiseTex“ “Texture“);
DrawEnum(currentMaterial);
EditorGUI.indentLevel -= 1;
}
EndTmpPanel();
}

void DrawShinyPanel()
{
}

void DrawTransitionPanel()
{
if (BeginTmpPanel(“Transition“ true))
{
EditorGUI.indentLevel += 1;
DoTexture2D(“_NoiseTex“ “Texture“);
DrawEnum(currentMaterial);
EditorGUI.indentLevel -= 1;
}
EndTmpPanel();
}

void DrawEffectPanel()
{
if (BeginTmpPanel(“Effect“ true))
{
EditorGUI.indentLevel += 1;
DrawEnum(currentMaterial);
DrawEnum(currentMaterial);
DrawEnum(currentMaterial);
DrawToggleKeyword(currentMaterial “Advanced Blur“ “EX“);
EditorGUI.indentLevel -= 1;
}
EndTmpPanel();
}

static void DrawEnum(Material mat)
{
Type type = typeof(T);
string[] names = System.Enum.GetNames(type);
int[] values = System.Enum.GetValues(type) as int[];

int mode = 0;
for (int i = 0; i < names.Length; i++)
{
if (mat.IsKeywordEnabled(names[i].ToUpper()))
mode = values[i];
}

var newMode = EditorGUILayout.IntPopup(objectNames.NicifyVariableName(type.Name) mode names values);
if (mode != newMode)
{
Array.IndexOf(values mode);
mat.DisableKeyword(names[Array.IndexOf(values mode)].ToUpper());
if (newMode != 0)
mat.EnableKeyword(names[Array.IndexOf(values newMode)].ToUpper());
}
}

static void DrawToggleKeyword(Material mat string label string keyword)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-06-30 14:12  UIEffect-develop\
     目录           0  2019-06-30 14:12  UIEffect-develop\.github\
     文件         591  2019-06-30 14:12  UIEffect-develop\.github\FUNDING.yml
     目录           0  2019-06-30 14:12  UIEffect-develop\.github\ISSUE_TEMPLATE\
     文件         565  2019-06-30 14:12  UIEffect-develop\.github\ISSUE_TEMPLATE\bug_report.md
     文件         576  2019-06-30 14:12  UIEffect-develop\.github\ISSUE_TEMPLATE\feature_request.md
     文件         454  2019-06-30 14:12  UIEffect-develop\.github\ISSUE_TEMPLATE\question.md
     文件         155  2019-06-30 14:12  UIEffect-develop\.github_changelog_generator
     文件         490  2019-06-30 14:12  UIEffect-develop\.gitignore
     目录           0  2019-06-30 14:12  UIEffect-develop\Assets\
     文件         191  2019-06-30 14:12  UIEffect-develop\Assets\Coffee.meta
     目录           0  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\
     文件         191  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions.meta
     目录           0  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\
     文件         191  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect.meta
     目录           0  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\
     文件       20927  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\CHANGELOG.md
     文件         174  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\CHANGELOG.md.meta
     文件         172  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro.meta
     目录           0  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro\
     文件         191  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro\Editor.meta
     目录           0  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro\Editor\
     文件        3882  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro\Editor\TMP_SDFShaderGUI.cs
     文件         243  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro\Editor\TMP_SDFShaderGUI.cs.meta
     文件         172  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro\Shaders.meta
     目录           0  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro\Shaders\
     文件        4851  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro\Shaders\TMP_SDF (UIDissolve).shader
     文件         433  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro\Shaders\TMP_SDF (UIDissolve).shader.meta
     文件        5608  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro\Shaders\TMP_SDF (UIEffect).shader
     文件         433  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro\Shaders\TMP_SDF (UIEffect).shader.meta
     文件        4772  2019-06-30 14:12  UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro\Shaders\TMP_SDF (UIHsvModifier).shader
............此处省略320个文件信息

评论

共有 条评论