当前位置:网站首页>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 ");
}
}
边栏推荐
- A blog to achieve embedded entry
- What should the project manager do if there is something wrong with team collaboration?
- Quick sort
- Fuzzy -- basic application method of AFL
- Postman Association
- Excellent PM must experience these three levels of transformation!
- acwing周赛58
- Extension of graph theory
- ETCD数据库源码分析——etcdserver bootstrap初始化存储
- Summary of redis AOF and RDB knowledge points
猜你喜欢

Lepton 无损压缩原理及性能分析

Postman manage test cases

Visio draw fan

RTP gb28181 document testing tool

IPv6 comprehensive experiment

Basic knowledge and examples of binary tree

Orm-f & Q object
![[Chongqing Guangdong education] engineering fluid mechanics reference materials of southwestjiaotonguniversity](/img/ac/93a64e59592e3d083a771b993d6884.jpg)
[Chongqing Guangdong education] engineering fluid mechanics reference materials of southwestjiaotonguniversity

Postman Association
![[classic example] binary tree recursive structure classic topic collection @ binary tree](/img/39/0319c4be43716f927b9d98d89f7655.jpg)
[classic example] binary tree recursive structure classic topic collection @ binary tree
随机推荐
关于es8316的音频爆破音的解决
Can CDC pull the Oracle table in full
The kernel determines whether peripherals are attached to the I2C address
web工程导入了mysql驱动jar包却无法加载到驱动的问题
11. Intranet penetration and automatic refresh
Platformio create libopencm3 + FreeRTOS project
A little knowledge of CPU, disk and memory
On the solution of es8316's audio burst
Postman管理测试用例
Ue5 small knowledge points to enable the setting of lumen
Postman manage test cases
从0到1建设智能灰度数据体系:以vivo游戏中心为例
Fuzzy -- basic application method of AFL
关于Unity Inspector上的一些常用技巧,一般用于编辑器扩展或者其他
Microservice resource address
canal同步mysql数据变化到kafka(centos部署)
8. Static file
Flody的应用
麦斯克电子IPO被终止:曾拟募资8亿 河南资产是股东
ISP学习(2)