資源簡介
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? {
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.me
?????目錄???????????0??2019-06-30?14:12??UIEffect-develop\Assets\Coffee\
?????文件?????????191??2019-06-30?14:12??UIEffect-develop\Assets\Coffee\UIExtensions.me
?????目錄???????????0??2019-06-30?14:12??UIEffect-develop\Assets\Coffee\UIExtensions\
?????文件?????????191??2019-06-30?14:12??UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect.me
?????目錄???????????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.me
?????文件?????????172??2019-06-30?14:12??UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro.me
?????目錄???????????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.me
?????目錄???????????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.me
?????文件?????????172??2019-06-30?14:12??UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro\Shaders.me
?????目錄???????????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.me
?????文件????????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.me
?????文件????????4772??2019-06-30?14:12??UIEffect-develop\Assets\Coffee\UIExtensions\UIEffect\ForTMPro\Shaders\TMP_SDF?(UIHsvModifier).shader
............此處省略320個文件信息
- 上一篇:中興v881刷機工具包
- 下一篇:數據中心紅寶書2019技術期刊合集.pdf
評論
共有 條評論