当前位置:网站首页>Executeineditmode property details
Executeineditmode property details
2022-06-11 02:26:00 【Xia 78】
ExecuteInEditMode Attribute is used to EditMode You can also execute scripts under .Unity By default , Scripts are executed only when they are running , After adding this attribute , Don't run the program , Can also execute scripts .
And PlayMode The difference is , Functions don't keep executing .
Update : Only when an object in the scene changes , Only called .
OnGUI : When GameView Received a Event Call when .
OnRenderObject And other rendering callback functions : SceneVidw perhaps GameView Redraw time , call .
Awake And Start Call rules :
Awake: call on load .
Start: Called on first activation .
This is consistent with the call rules in the run mode . See 《unity----- Function execution order 》.
It should be noted that , Because it can run in both modes , all , The moment you switch modes , It's worth staying Take it easy .
Whether from edit mode to run mode , Or from run mode to edit mode ,unity Will reload resources , therefore :
When it's time to MonoBehavior Given in the editor GameObject When ,Awake, Start Will be carried out .
When Play After the button is pressed and the game starts ,Awake, Start Will be carried out .
When Play After the button stops ,Awake, Start Will be executed again .
When opened in the editor, it contains the MonoBehavior When I was in the middle of the scene ,Awake, Start Will be carried out .
Usage method :
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class Example : MonoBehaviour {
public Transform target;
void Update() {
if (target)
transform.LookAt(target);
}
}
边栏推荐
- To view the data in redis, in addition to the command line and client, you have a third option
- 2022 high altitude installation, maintenance and removal of simulated examination platform of theoretical question bank
- 双面材质【double sided】的Shader
- 优化调度(火电、风能、储能)【matlab代码实现】
- 889. construct binary tree according to preorder and postorder traversal
- Kotlin apply方法
- Kotlin let方法
- English subtitle video translated into Chinese subtitles
- STC8A8K64D4 EEPROM读写失败
- 贵金属白银和现货白银之间是什么关系
猜你喜欢

Find - (half find / half find)
![[3.delphi common components] 8 dialog box](/img/4b/c06f8789cee58705a0b77f3ca1eee6.jpg)
[3.delphi common components] 8 dialog box

环糊精金属有机骨架(β-CD-MOF)装载二巯丁二酸/大黄素/槲皮素/三氯蔗糖/二氟尼柳/奥美拉唑(OME)

浅析直播间海量聊天消息的架构设计难点

Unity serial port communication

14: 00 interview, came out at 14:08, the question is really too

如何保障数仓数据质量?

Colab报错:ImportError: cannot import name ‘_check_savefig_extra_args‘ from ‘matplotlib.backend_bases‘

378. 有序矩阵中第 K 小的元素

JS basic part hand exercises
随机推荐
金属有机框架MOF-Al(DIBA),MOF-Zr(DIBA),MOF-Fe(DIBA)包载姜黄素/羧苄西林/MTX甲氨蝶呤/紫杉醇PTX/阿霉素DOX/顺铂CDDP/CPT喜树碱等药物
Oracle collects statistics
软件测试面试复盘:技术面没有难倒我,hr面却是一把挂
Optimized dispatching (thermal power, wind energy and energy storage) [matlab code implementation]
Penetration test - security service system +owasp top 10
Ortele has obtained three rounds of financing nine months after its establishment, and hard discount stores have found new ways to grow?
安全生产月知识竞赛——新安法知多少
项目 - Redis消息队列+工作线程取出用户操作日志并入库(二)
金属有机骨架材料Fe-MIL-53,Mg-MOF-74,Ti-KUMOF-1,Fe-MIL-100,Fe-MIL-101)负载异氟醚/甲氨蝶呤/阿霉素(DOX)/紫杉醇/布洛芬/喜树碱
[C language] storage of data in memory -1 plastic
Go develop web
JS Part 5
Merge sort ()
How to guarantee the data quality of data warehouse?
叶酸配体的金属有机骨架材料MOFs负载5-氟尿嘧啶,西达本胺,紫杉醇,阿霉素,柔红霉素,布洛芬,喜树碱,姜黄素,藤黄酸等小分子药物
27岁女生零基础转行软件测试,合适吗?
cannot import name ‘dtensor‘ from ‘tensorflow. compat. v2.experimental‘
【AI周报】AI与冷冻电镜揭示「原子级」NPC结构;清华、商汤提出「SIM」方法兼顾语义对齐与空间分辨能力
English subtitle video translated into Chinese subtitles
SD3.0笔记