当前位置:网站首页>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 ");
}
}
边栏推荐
- Nestjs配置文件上传, 配置中间件以及管道的使用
- The implementation of the maize negotiable digital warehouse receipt standard will speed up the asset digitization process of the industry
- acwing周赛58
- Application of Flody
- The kernel determines whether peripherals are attached to the I2C address
- Word cover underline
- 团队协作出了问题,项目经理怎么办?
- Zynq learning notes (3) - partial reconfiguration
- Basic knowledge and examples of binary tree
- How to estimate the population with samples? (mean, variance, standard deviation)
猜你喜欢

Digital children < daily question> (Digital DP)

Postman管理测试用例

从0到1建设智能灰度数据体系:以vivo游戏中心为例

ue5 小知识点 开启lumen的设置

Postman pre script - global variables and environment variables

Unity screen coordinates ugui coordinates world coordinates conversion between three coordinate systems

Dry goods collection | Vulkan game engine video tutorial

Uva1592 Database

Postman断言

二叉树基本知识和例题
随机推荐
Selection sort
Codeforces Round #804 (Div. 2)
[数学建模] 微分方程--捕鱼业的持续发展
Bill Gates posted his 18-year-old resume and expected an annual salary of $12000 48 years ago
The underlying structure of five data types in redis
Luogu deep foundation part 1 Introduction to language Chapter 2 sequential structure programming
也算是学习中的小总结
【LGR-109】洛谷 5 月月赛 II & Windy Round 6
[mathematical modeling] differential equation -- sustainable development of fishing industry
集合详解之 Collection + 面试题
[HBZ share] reasons for slow addition and deletion of ArrayList and fast query
2021 RoboCom 世界机器人开发者大赛-本科组(复赛)
Finance online homework
力扣(LeetCode)186. 翻转字符串里的单词 II(2022.07.05)
Is the mode of education together - on campus + off campus reliable
Selection of slow motion function
Why does MySQL need two-phase commit
yolov5 tensorrt加速
Dynamic programming (tree DP)
Flink kakfa data read and write to Hudi