当前位置:网站首页>EditorUtility. The role and application of setdirty in untiy
EditorUtility. The role and application of setdirty in untiy
2022-07-06 04:50:00 【charlsdm】
UnityEditor.EditorUtility.SetDirty(this.gameObject);
Combine some Unity The script changes the Inspector Then change some properties on
Direct change Unity Function of prefabricated body , Used to change Inspector Save the data on
My code is attached below
[ContextMenu(" Automatically assign null to my original image ")]
public void ClearPictureOrSpriteOrigionName()
{
string myname = null;
if (this.GetComponent<Image>() != null || this.GetComponent<SpriteRenderer>() != null)
{
if (this.GetComponent<Image>() != null)
{
myname = this.GetComponent<Image>().sprite.name;
}
else if (this.GetComponent<SpriteRenderer>() != null)
{
myname = this.GetComponent<SpriteRenderer>().sprite.name;
}
}
if (myname != null)
{
if (this.GetComponent<Image>() != null)
{
this.GetComponent<Image>().sprite = null;
}
else if (this.GetComponent<SpriteRenderer>() != null)
{
this.GetComponent<SpriteRenderer>().sprite = null;
}
UnityEditor.EditorUtility.SetDirty(this.gameObject);
Debug.Log(" Save some data ");
}
}
边栏推荐
- English Vocabulary - life scene memory method
- 力扣(LeetCode)186. 翻转字符串里的单词 II(2022.07.05)
- [mathematical modeling] differential equation -- sustainable development of fishing industry
- Unity screen coordinates ugui coordinates world coordinates conversion between three coordinate systems
- 2021RoboCom机器人开发者大赛(初赛)
- [buuctf.reverse] 159_ [watevrCTF 2019]Watshell
- RT thread analysis log system RT_ Kprintf analysis
- acwing周赛58
- Yyds dry goods inventory OSI & tcp/ip
- SharedPreferences source code analysis
猜你喜欢

The IPO of mesk Electronics was terminated: Henan assets, which was once intended to raise 800 million yuan, was a shareholder

How to estimate the population with samples? (mean, variance, standard deviation)
![[Yu Yue education] reference materials of complex variable function and integral transformation of Northwestern Polytechnic University](/img/22/ead74bc121a64910ef6ef374cd029b.png)
[Yu Yue education] reference materials of complex variable function and integral transformation of Northwestern Polytechnic University

Programmers' position in the Internet industry | daily anecdotes

Fuzzy -- basic application method of AFL

Zynq learning notes (3) - partial reconfiguration

Uva1592 Database

English Vocabulary - life scene memory method
![[mathematical modeling] differential equation -- sustainable development of fishing industry](/img/7c/2ab6f2a34bc2c97318537ec8e0b0c5.png)
[mathematical modeling] differential equation -- sustainable development of fishing industry

Postman管理测试用例
随机推荐
canal同步mysql数据变化到kafka(centos部署)
Yyds dry goods inventory OSI & tcp/ip
[noip2008 improvement group] stupid monkey
Platformio create libopencm3 + FreeRTOS project
web工程导入了mysql驱动jar包却无法加载到驱动的问题
图论的扩展
Embedded development program framework
麦斯克电子IPO被终止:曾拟募资8亿 河南资产是股东
A blog to achieve embedded entry
RT thread analysis - object container implementation and function
Quick sort
C'est un petit résumé de l'étude.
Selection sort
11. Intranet penetration and automatic refresh
Is the mode of education together - on campus + off campus reliable
最高法院,离婚案件判决标准
What should the project manager do if there is something wrong with team collaboration?
RT thread analysis log system RT_ Kprintf analysis
View workflow
Unity screen coordinates ugui coordinates world coordinates conversion between three coordinate systems