(client) feat:实现3d模型按钮

This commit is contained in:
m0_75251201
2025-08-27 20:44:29 +08:00
parent 8456b6c162
commit f4ce4fcf1f
11 changed files with 4590 additions and 578 deletions

View File

@ -0,0 +1,306 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2412502657045938467
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 709533242955877997}
- component: {fileID: 5821092905185152964}
- component: {fileID: 3254240173477692892}
- component: {fileID: 2649725512596744611}
- component: {fileID: 8989378577537570065}
m_Layer: 0
m_Name: Button3D
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &709533242955877997
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2412502657045938467}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -13.67, y: -5.09, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7795760929196660143}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &5821092905185152964
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2412502657045938467}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &3254240173477692892
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2412502657045938467}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &2649725512596744611
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2412502657045938467}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &8989378577537570065
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2412502657045938467}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0d5e1709fa6d5c54f93ac068f067e20b, type: 3}
m_Name:
m_EditorClassIdentifier:
OnClick:
m_PersistentCalls:
m_Calls: []
renderer: {fileID: 3254240173477692892}
outlineMaterial: {fileID: 2100000, guid: 7b32baf03e8f4bd448cf625f4299f5ce, type: 2}
text: {fileID: 3761108353443528858}
--- !u!1 &3805996714208757134
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7795760929196660143}
- component: {fileID: 5919324744879230529}
- component: {fileID: 3761108353443528858}
m_Layer: 0
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7795760929196660143
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3805996714208757134}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 709533242955877997}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 2}
m_SizeDelta: {x: 5, y: 2}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!23 &5919324744879230529
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3805996714208757134}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: -1361428157011412921, guid: 317edb274e9c5144a9916937bdbf7716, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!114 &3761108353443528858
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3805996714208757134}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Sample text
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 317edb274e9c5144a9916937bdbf7716, type: 2}
m_sharedMaterial: {fileID: -1361428157011412921, guid: 317edb274e9c5144a9916937bdbf7716, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 5
m_fontSizeBase: 5
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 1024
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 0
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
_SortingLayer: 0
_SortingLayerID: 0
_SortingOrder: 0
m_hasFontAssetChanged: 0
m_renderer: {fileID: 5919324744879230529}
m_maskType: 0

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 04bb56c29e3de4248a236f83c889ca7d
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,141 @@
using System.Linq; // 用于可能的LINQ操作但在此版本中可能不直接使用
using TMPro; // 用于 TextMeshPro 组件
using UnityEngine;
using UnityEngine.Events; // 用于 UnityEvent
namespace UI
{
public class Button3D : MonoBehaviour
{
[Tooltip("当按钮被点击时触发的UnityEvent。可以在Inspector中配置.")]
public UnityEvent OnClick;
public MeshRenderer renderer; // 请确保在Inspector中拖拽赋值
public Material outlineMaterial; // 请确保在Inspector中拖拽赋值
public TMP_Text text; // 文本组件
private Material[] _originalMaterials; // 用于存储按钮的原始材质,以便正确添加和移除描边
private void Awake()
{
if (renderer == null)
{
Debug.LogError("Button3D: MeshRenderer is not assigned. Please assign it in the Inspector.", this);
return;
}
if (outlineMaterial == null)
{
Debug.LogWarning(
"Button3D: Outline Material is not assigned. Outline effect will not work. Please assign it in the Inspector.",
this);
}
if (text == null)
{
Debug.LogWarning("Button3D: TMP_Text is not assigned. Text features will not work. Please assign it in the Inspector.", this);
// 这里不return允许按钮无文本运行
}
// 存储原始材质数组,以便在添加和移除描边时正确操作
// .ToArray() 是为了确保我们拿到的是拷贝,而不是引用,防止外部意外修改
_originalMaterials = renderer.materials.ToArray();
// 确保初始化时没有边框材质
// Important: 调用RemoveOutlineMaterialInternal()可能会清除_originalMaterials所以要确保先保存
RemoveOutlineMaterialInternal(); // 这一步会根据_originalMaterials重新设置renderer.materials
// 初始时隐藏文本
if (text != null)
{
text.gameObject.SetActive(false);
}
}
private void Update()
{
// 文本始终朝向摄像机
if (text != null && text.IsActive() && Camera.main != null)
{
text.transform.LookAt(text.transform.position + Camera.main.transform.rotation * Vector3.forward,
Camera.main.transform.rotation * Vector3.up);
}
}
private void OnMouseEnter()
{
if (renderer == null) return;
// 鼠标进入时显示文本
if (text != null)
{
text.gameObject.SetActive(true);
}
// 如果没有描边材质,或者渲染器已经有描边材质,就没必要再添加了
// 检查当前材质数组长度是否已经大于等于_originalMaterials的长度+1
// 这样可以避免重复添加
if (outlineMaterial == null || renderer.materials.Length > _originalMaterials.Length)
{
return;
}
// 如果当前材质数组和_originalMaterials不一致说明可能被其他逻辑修改了
// 稳妥起见最好先恢复到_originalMaterials
if (!renderer.materials.SequenceEqual(_originalMaterials))
{
//Debug.LogWarning("Button3D: Renderer materials were unexpectedly modified before OnMouseEnter. Restoring original materials.");
// 通常不应该发生,除非有其他脚本在修改
renderer.materials = _originalMaterials;
}
// 创建一个新数组,包含原始材质和描边材质
Material[] newMaterials = new Material[_originalMaterials.Length + 1];
System.Array.Copy(_originalMaterials, newMaterials, _originalMaterials.Length);
newMaterials[_originalMaterials.Length] = outlineMaterial;
renderer.materials = newMaterials;
}
private void OnMouseExit()
{
if (renderer == null) return;
// 鼠标离开时隐藏文本
if (text != null)
{
text.gameObject.SetActive(false);
}
// 调用内部方法移除边框材质
RemoveOutlineMaterialInternal();
}
private void OnMouseDown()
{
// 触发UnityEvent
OnClick.Invoke();
}
/// <summary>
/// 移除渲染器上的边框材质(如果存在),恢复到按钮的原始材质。
/// </summary>
private void RemoveOutlineMaterialInternal()
{
if (renderer == null) return;
// 即使_originalMaterials == null因为Awake中的LogError也可以安全赋值空数组
// 但如果_originalMaterials确实是null说明Awake有问题后续操作也可能继续出错
if (_originalMaterials == null)
{
Debug.LogError("Button3D: _originalMaterials is null. Cannot remove outline. Check Awake method.", this);
return;
}
// 直接将渲染器材质恢复为_originalMaterials的副本
renderer.materials = _originalMaterials.ToArray(); // 使用ToArray()确保赋值一个副本避免_originalMaterials被意外修改
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0d5e1709fa6d5c54f93ac068f067e20b

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8d4583fea28dea54cac2f29cde1b99c3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,910 @@
{
"m_SGVersion": 3,
"m_Type": "UnityEditor.ShaderGraph.GraphData",
"m_ObjectId": "4c4fc4006449490dbe343b50970f353c",
"m_Properties": [
{
"m_Id": "966cc5eb0a8a4289b76db1c1fb9a20b4"
},
{
"m_Id": "aee9bea820ab495ebea1fd16e6e4426d"
}
],
"m_Keywords": [],
"m_Dropdowns": [],
"m_CategoryData": [
{
"m_Id": "77b7ab57f4994f77bc06b85fd1862a13"
}
],
"m_Nodes": [
{
"m_Id": "59a780e466d342afa011b55a3d95b15b"
},
{
"m_Id": "92c6bf1708bc4eefa9f708ccedf82e7b"
},
{
"m_Id": "3da1fcb014254517857c0f1757f89dee"
},
{
"m_Id": "275d38d75fd947068131f18e2ea8f88b"
},
{
"m_Id": "9d575cc9818041d0b0b195bdab8bb293"
},
{
"m_Id": "cd0010223c1344559b11ffc2f918a831"
},
{
"m_Id": "1f4e07b0db3c459b906693c887f3e252"
},
{
"m_Id": "d22f0b20543941d4b21cdb5780053b49"
},
{
"m_Id": "23cf3544aed047c38359d49bc9bfd39c"
}
],
"m_GroupDatas": [],
"m_StickyNoteDatas": [],
"m_Edges": [
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "1f4e07b0db3c459b906693c887f3e252"
},
"m_SlotId": 2
},
"m_InputSlot": {
"m_Node": {
"m_Id": "59a780e466d342afa011b55a3d95b15b"
},
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "23cf3544aed047c38359d49bc9bfd39c"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "275d38d75fd947068131f18e2ea8f88b"
},
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "cd0010223c1344559b11ffc2f918a831"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "1f4e07b0db3c459b906693c887f3e252"
},
"m_SlotId": 1
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "d22f0b20543941d4b21cdb5780053b49"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "1f4e07b0db3c459b906693c887f3e252"
},
"m_SlotId": 0
}
}
],
"m_VertexContext": {
"m_Position": {
"x": -95.0000228881836,
"y": 76.00000762939453
},
"m_Blocks": [
{
"m_Id": "59a780e466d342afa011b55a3d95b15b"
},
{
"m_Id": "92c6bf1708bc4eefa9f708ccedf82e7b"
},
{
"m_Id": "3da1fcb014254517857c0f1757f89dee"
}
]
},
"m_FragmentContext": {
"m_Position": {
"x": -95.0000228881836,
"y": 286.0000305175781
},
"m_Blocks": [
{
"m_Id": "275d38d75fd947068131f18e2ea8f88b"
},
{
"m_Id": "9d575cc9818041d0b0b195bdab8bb293"
}
]
},
"m_PreviewData": {
"serializedMesh": {
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
"m_Guid": ""
},
"preventRotation": false
},
"m_Path": "Shader Graphs",
"m_GraphPrecision": 1,
"m_PreviewMode": 2,
"m_OutputNode": {
"m_Id": ""
},
"m_SubDatas": [],
"m_ActiveTargets": [
{
"m_Id": "4cc1a064f7874a9b8aa521d595d5092d"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
"m_ObjectId": "17ef39b9aa3f4f9b9b545bd0a4d867f5",
"m_Id": 0,
"m_DisplayName": "Color",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.MultiplyNode",
"m_ObjectId": "1f4e07b0db3c459b906693c887f3e252",
"m_Group": {
"m_Id": ""
},
"m_Name": "Multiply",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -329.0,
"y": 76.0,
"width": 208.0,
"height": 302.0
}
},
"m_Slots": [
{
"m_Id": "a89ab5333ae449e59da03aa1ab9d9022"
},
{
"m_Id": "32a29b201337425ea089343d5247233d"
},
{
"m_Id": "6785395363af428fbc58da381fe55359"
}
],
"synonyms": [
"multiplication",
"times",
"x"
],
"m_Precision": 0,
"m_PreviewExpanded": false,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "23cf3544aed047c38359d49bc9bfd39c",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -251.00001525878907,
"y": 325.0,
"width": 105.0,
"height": 34.000030517578128
}
},
"m_Slots": [
{
"m_Id": "17ef39b9aa3f4f9b9b545bd0a4d867f5"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "aee9bea820ab495ebea1fd16e6e4426d"
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "275d38d75fd947068131f18e2ea8f88b",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.BaseColor",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "64edbafd8dfd47a2ad97435827012ad2"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.BaseColor"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot",
"m_ObjectId": "32a29b201337425ea089343d5247233d",
"m_Id": 1,
"m_DisplayName": "B",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "B",
"m_StageCapability": 3,
"m_Value": {
"e00": 2.0,
"e01": 2.0,
"e02": 2.0,
"e03": 2.0,
"e10": 2.0,
"e11": 2.0,
"e12": 2.0,
"e13": 2.0,
"e20": 2.0,
"e21": 2.0,
"e22": 2.0,
"e23": 2.0,
"e30": 2.0,
"e31": 2.0,
"e32": 2.0,
"e33": 2.0
},
"m_DefaultValue": {
"e00": 1.0,
"e01": 0.0,
"e02": 0.0,
"e03": 0.0,
"e10": 0.0,
"e11": 1.0,
"e12": 0.0,
"e13": 0.0,
"e20": 0.0,
"e21": 0.0,
"e22": 1.0,
"e23": 0.0,
"e30": 0.0,
"e31": 0.0,
"e32": 0.0,
"e33": 1.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "3da1fcb014254517857c0f1757f89dee",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Tangent",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "b4c90de2ecc947c0ba37d42e034cb369"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Tangent"
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget",
"m_ObjectId": "4cc1a064f7874a9b8aa521d595d5092d",
"m_Datas": [],
"m_ActiveSubTarget": {
"m_Id": "7d6d58b2f6734a4fa425de949a55a7c4"
},
"m_AllowMaterialOverride": false,
"m_SurfaceType": 1,
"m_ZTestMode": 4,
"m_ZWriteControl": 0,
"m_AlphaMode": 0,
"m_RenderFace": 1,
"m_AlphaClip": false,
"m_CastShadows": true,
"m_ReceiveShadows": true,
"m_DisableTint": false,
"m_AdditionalMotionVectorMode": 0,
"m_AlembicMotionVectors": false,
"m_SupportsLODCrossFade": false,
"m_CustomEditorGUI": "",
"m_SupportVFX": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "59a780e466d342afa011b55a3d95b15b",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Position",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "673631bf98b24d6a9c127d8c2bbe71bc"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Position"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
"m_ObjectId": "64edbafd8dfd47a2ad97435827012ad2",
"m_Id": 0,
"m_DisplayName": "Base Color",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "BaseColor",
"m_StageCapability": 2,
"m_Value": {
"x": 0.5,
"y": 0.5,
"z": 0.5
},
"m_DefaultValue": {
"x": 0.5,
"y": 0.5,
"z": 0.5
},
"m_Labels": [],
"m_ColorMode": 0,
"m_DefaultColor": {
"r": 0.5,
"g": 0.5,
"b": 0.5,
"a": 1.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot",
"m_ObjectId": "673631bf98b24d6a9c127d8c2bbe71bc",
"m_Id": 0,
"m_DisplayName": "Position",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Position",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot",
"m_ObjectId": "6785395363af428fbc58da381fe55359",
"m_Id": 2,
"m_DisplayName": "Out",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": {
"e00": 0.0,
"e01": 0.0,
"e02": 0.0,
"e03": 0.0,
"e10": 0.0,
"e11": 0.0,
"e12": 0.0,
"e13": 0.0,
"e20": 0.0,
"e21": 0.0,
"e22": 0.0,
"e23": 0.0,
"e30": 0.0,
"e31": 0.0,
"e32": 0.0,
"e33": 0.0
},
"m_DefaultValue": {
"e00": 1.0,
"e01": 0.0,
"e02": 0.0,
"e03": 0.0,
"e10": 0.0,
"e11": 1.0,
"e12": 0.0,
"e13": 0.0,
"e20": 0.0,
"e21": 0.0,
"e22": 1.0,
"e23": 0.0,
"e30": 0.0,
"e31": 0.0,
"e32": 0.0,
"e33": 1.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
"m_ObjectId": "77b7ab57f4994f77bc06b85fd1862a13",
"m_Name": "",
"m_ChildObjectList": [
{
"m_Id": "966cc5eb0a8a4289b76db1c1fb9a20b4"
},
{
"m_Id": "aee9bea820ab495ebea1fd16e6e4426d"
}
]
}
{
"m_SGVersion": 2,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget",
"m_ObjectId": "7d6d58b2f6734a4fa425de949a55a7c4"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot",
"m_ObjectId": "8169db28379542af9cdd62d5a1b89de0",
"m_Id": 0,
"m_DisplayName": "Normal",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Normal",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "92c6bf1708bc4eefa9f708ccedf82e7b",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Normal",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "8169db28379542af9cdd62d5a1b89de0"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Normal"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "936f470cf96b4c65a1750ba068d23d51",
"m_Id": 0,
"m_DisplayName": "Alpha",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Alpha",
"m_StageCapability": 2,
"m_Value": 1.0,
"m_DefaultValue": 1.0,
"m_Labels": []
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
"m_ObjectId": "966cc5eb0a8a4289b76db1c1fb9a20b4",
"m_Guid": {
"m_GuidSerialized": "05553a18-36ca-4f4b-8dcb-3d0622846b4c"
},
"m_Name": "Scale",
"m_DefaultRefNameVersion": 1,
"m_RefNameGeneratedByDisplayName": "Scale",
"m_DefaultReferenceName": "_Scale",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_Value": 0.0,
"m_FloatType": 0,
"m_RangeValues": {
"x": 0.0,
"y": 1.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "9d575cc9818041d0b0b195bdab8bb293",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.Alpha",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "936f470cf96b4c65a1750ba068d23d51"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.Alpha"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot",
"m_ObjectId": "a89ab5333ae449e59da03aa1ab9d9022",
"m_Id": 0,
"m_DisplayName": "A",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "A",
"m_StageCapability": 3,
"m_Value": {
"e00": 0.0,
"e01": 0.0,
"e02": 0.0,
"e03": 0.0,
"e10": 0.0,
"e11": 0.0,
"e12": 0.0,
"e13": 0.0,
"e20": 0.0,
"e21": 0.0,
"e22": 0.0,
"e23": 0.0,
"e30": 0.0,
"e31": 0.0,
"e32": 0.0,
"e33": 0.0
},
"m_DefaultValue": {
"e00": 1.0,
"e01": 0.0,
"e02": 0.0,
"e03": 0.0,
"e10": 0.0,
"e11": 1.0,
"e12": 0.0,
"e13": 0.0,
"e20": 0.0,
"e21": 0.0,
"e22": 1.0,
"e23": 0.0,
"e30": 0.0,
"e31": 0.0,
"e32": 0.0,
"e33": 1.0
}
}
{
"m_SGVersion": 3,
"m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty",
"m_ObjectId": "aee9bea820ab495ebea1fd16e6e4426d",
"m_Guid": {
"m_GuidSerialized": "79218567-43f6-4d23-b803-a064a7a527b0"
},
"m_Name": "Color",
"m_DefaultRefNameVersion": 1,
"m_RefNameGeneratedByDisplayName": "Color",
"m_DefaultReferenceName": "_Color",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_Value": {
"r": 0.0,
"g": 0.0,
"b": 0.0,
"a": 1.0
},
"isMainColor": false,
"m_ColorMode": 1
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot",
"m_ObjectId": "b4c90de2ecc947c0ba37d42e034cb369",
"m_Id": 0,
"m_DisplayName": "Tangent",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Tangent",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.ShaderGraph.PositionNode",
"m_ObjectId": "cd0010223c1344559b11ffc2f918a831",
"m_Group": {
"m_Id": ""
},
"m_Name": "Position",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -596.0,
"y": 123.00000762939453,
"width": 208.00003051757813,
"height": 314.00006103515627
}
},
"m_Slots": [
{
"m_Id": "d1f1ce54627b45e1856f7d362b461a97"
}
],
"synonyms": [
"location"
],
"m_Precision": 1,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 2,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Space": 0,
"m_PositionSource": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "d1f1ce54627b45e1856f7d362b461a97",
"m_Id": 0,
"m_DisplayName": "Out",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "d22f0b20543941d4b21cdb5780053b49",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -492.0,
"y": 89.0,
"width": 104.00003051757813,
"height": 34.00000762939453
}
},
"m_Slots": [
{
"m_Id": "d7622898365f4568be7c6a1fd7941832"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "966cc5eb0a8a4289b76db1c1fb9a20b4"
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "d7622898365f4568be7c6a1fd7941832",
"m_Id": 0,
"m_DisplayName": "Scale",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 11268f83bf2cc2447b1f0e995112ca43
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

View File

@ -0,0 +1,60 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-2119912562947499068
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Shader Graphs_OutlineShader
m_Shader: {fileID: -6465566751694194690, guid: 11268f83bf2cc2447b1f0e995112ca43, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _QueueControl: 0
- _QueueOffset: 0
- _Scale: 1.05
m_Colors:
- _Color: {r: 1.8490566, g: 1.6566842, b: 0.61925954, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7b32baf03e8f4bd448cf625f4299f5ce
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long