---
title: "Shader Graph做的Shader，属性值都是随机的比如_basecolor这种，怎么赋值呢"
author: "石心.Yong"
published_by: "Perrin Yong"
canonical: https://www.pystone.net/notes/uwa-answer-set-shader-graph-generated-properties/
type: note
content_role: source
source_type: "source"
visibility: public
id_stability: rename-stable
source_path: "10-计算机、信息技术与工程/05-游戏图形与运行时/我的UWA问答/2021-03-24 - Shader Graph做的Shader，属性值都是随机的比如_basecolor这种，怎么赋值呢.md"
content_hash: 79b23e5dfd4f4b1c38a64640b2c4b9e360fba58832eaf125127dbc7d689f3f30
knowledge_version: 224c990773de.5fa8af6e39fa
site_commit: 224c990773de166d23a886306577dd90379529ce
notes_commit: 5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a
---
# Shader Graph做的Shader，属性值都是随机的比如_basecolor这种，怎么赋值呢

> **note · 我的 UWA 问答**
> 本文收录我在 UWA 问答发表的公开回答。问题内容归原提问者；回答保留当时语境，技术结论可能受 Unity 版本、平台和项目条件限制。

## 问题

Shader Graph做的Shader，属性值都是随机的比如_basecolor这种，怎么赋值呢？

- 提问者：芝麻青豆角
- 提问时间：2021-03-24 02:59:34

## 我的回答

选中Property，在GraphInspector中勾选Exposed，就可以暴露在Material的Inspector面板：

![image.png](/media/dfc233d1d17360643d2d.png)

![image.png](/media/904f6fa002390bb74af9.png)

![image.png](/media/1df5891ba2980ff03f5d.png)

或者使用Inline Node，可以在ShaderGraph中直接赋值：

![image.png](/media/5b6e49615ef11742ae68.png)

- 回答时间：2021-03-24 03:57:45
- 最后更新：2021-03-24 03:59:22
- 采纳状态：未采纳

## 来源与关系

- 上位集合：[我的 UWA 问答](https://www.pystone.net/notes/my-uwa-answers/)
- UWA 标签：Shader
- 原始问题：[Shader Graph做的Shader，属性值都是随机的比如_basecolor这种，怎么赋值呢](https://answer.uwa4d.com/question/6059ca16cfa35d5b53669be3)
- 源页最后更新：2021-03-24 03:57:44
