当前位置:网站首页>Unity message push
Unity message push
2022-07-24 02:53:00 【Just be interesting】
Send Message Mechanism
Unity Provided Message push mechanism It can be very convenient for our script development , It implements a pseudo listener model , Use of is The reflex mechanism .
About message push , There are three commonly used functions :SendMessage、SendMessageUpwards、BroadcastMessage. These functions are all GameObject perhaps Component Member function of , Just get an object , Then call these three functions to push a message .
SendMessage: Call each in this GameObject MonoBehaviour It's called methodName Methods . Be careful , Messages are not sent to inactive objects
SendMessageUpwards: Call each in this GameObject MonoBehaviour On or in this behavior Each parent It's called methodName Methods .
BroadcastMessage: Call this GameObject or its Any child Each of the MonoBehaviour It's called methodName Methods .
Messages are not sent to inactive objects . When unity When the method in the script is static , This method is invalid , So you can only call non static methods
Unity Event Mechanism
And UGUI The event mechanism is the same , By registering and removing listeners , Can be in Inspector Set relevant methods in the panel .
C Sharp Event Mechanism
Use C Sharp Of event.
边栏推荐
- 自定义log注解,请求抓取
- Unity TimeLine使用教程
- Attack and defense world web practice area (backup, cookie, disabled_button)
- QT display Chinese garbled code
- ssm的求职招聘系统兼职应聘求职
- Uie: unified model of information extraction
- Skywalking distributed system application performance monitoring tool - upper
- og seo
- compostion-api(setup中) watch使用细节
- Programmers can't JVM? Ashes Engineer: all waiting to be eliminated! This is a must skill!
猜你喜欢

Doodle Icons - 一组免费商用的涂鸦风格图标库,可爱轻快又独特

Ugui source code analysis - maskablegraphic

Attack and defense world web practice area (weak_auth, simple_php, xff_referer)

TP5 framework link promotion project

Pyg uses messagepassing to build GCN to realize node classification

Composition API (in setup) watch usage details
![js传参时传入 string有数据;传入 number时没有数据;2[0]是对的!number类型数据可以取下标](/img/4e/3d0c25d9579b6d5c00473048dbbd83.png)
js传参时传入 string有数据;传入 number时没有数据;2[0]是对的!number类型数据可以取下标
![Cloud native explanation [expansion]](/img/82/b206d496cfecd61aedd53ebc6ae1ea.png)
Cloud native explanation [expansion]

SkyWalking分布式系统应用程序性能监控工具-上

Doodle icons - a free commercial graffiti style icon library, cute, light and unique
随机推荐
UIE: 信息抽取的大一统模型
LeetCode-栈和队列刷题
自定义kindeditor富文本默认的宽高
Nirvana rebirth! Byte Daniel recommends a large distributed manual, and the Phoenix architecture makes you become a God in fire
Programmers can't JVM? Ashes Engineer: all waiting to be eliminated! This is a must skill!
Unity TimeLine使用教程
rust allow dead_ code
Ugui source code analysis - stencilmaterial
[untitled]
Go log package
Analyze the overall planning of steam and maker education classroom
Lumberyard game engine of o3de
Honey, we are homeless now
Fasterrcnn sample code test 1: make anchor_ generator = None
Acwing 4498. pointer (DFS)
Dynamic programming-01 knapsack problem
Custom log annotation, request fetching
The implementation in unity determines whether missing or null
Symbol类型
Relational expression greater than > less than < congruence = = = Nan isnan() logical operator double sense exclamation point!! & |% +-- Short circuit calculation assignment expression shortcut operat