Looking Up Entities
Looking up an entity by name is simple. You can do it from code, or via the level file.
1.
2.
<
entity
name
=
"NamedEntity"
>
3.
4.
</
entity
>
1.
2.
var
namedEntity:IEntity = PBE.lookupEntity(
"NamedEntity"
);
1.
2.
<
entity
name
=
"ExampleEntity"
>
3.
<
component
name
=
"NameExampleComponent"
>
4.
5.
<
EntityReference
entityName
=
"NamedEntity"
/>
6.
</
component
>
7.
</
entity
>
Looking Up Components
You can look up components by name in several ways. You can look them up in code or XML. You can also look them up via the NameManager, or via methods on IEntity.
1.
2.
<
entity
name
=
"NamedEntity"
>
3.
4.
<
component
type
=
"ExampleComponent"
name
=
"A"
/>
5.
<
component
type
=
"AnotherComponent"
name
=
"B"
/>
6.
<
component
type
=
"AnotherComponent"
name
=
"C"
/>
7.
</
entity
>
01.
02.
var
componentA:ExampleComponent = PBE.lookupComponentByType(
"NamedEntity"
, ExampleComponent) as ExampleComponent;
03.
04.
05.
var
componentB:AnotherComponent = PBE.lookupComponentByName(
"NamedEntity"
,
"B"
) as AnotherComponent;
06.
07.
08.
09.
10.
11.
var
componentA:ExampleComponent = owner.lookupComponentByName(
"A"
);
You can also look up another component by type, as mentioned in the component chapter.
01.
02.
<
entity
name
=
"ExampleEntity"
>
03.
04.
05.
<
component
type
=
"AnotherComponent"
name
=
"D"
/>
06.
<
component
name
=
"ComponentNameExampleComponent"
>
07.
08.
<
ComponentReference
entityName
=
"NamedEntity"
/>
09.
10.
<
AnotherComponentReference
entityName
=
"NamedEntity"
componentName
=
"C"
/>
11.
12.
13.
<
YetAnotherComponentReference
componentName
=
"D"
/>
14.
</
component
>
15.
</
entity
>
分享到:
相关推荐
NULL 博文链接:https://deepfuture.iteye.com/blog/709512
NULL 博文链接:https://deepfuture.iteye.com/blog/709502
NULL 博文链接:https://deepfuture.iteye.com/blog/709889
NULL 博文链接:https://deepfuture.iteye.com/blog/722156
帮助你快速了解PushButton的结构,尽快熟练应用
pushbutton engine是一个很好的flash游戏开发引擎,包含了常用的游戏组件,让设计师更注重游戏性的开发
PushButton Engine is a free framework for building Flash games. There are lots of great libraries for Flash game development. PushButton Engine makes it easy to bring those libraries together to build...
一键式语音/停止技能 关于 假设有一个连接到Raspberry Pi的按钮,则会编写此Mycroft技能。 短按该按钮与说出唤醒词相同,然后允许用户说出命令。 长按与发出“停止”命令相同,因此将停止播放任何音频。...
一款很强大的flash游戏开发引擎,分享下
原创pushbutton应用显示多行文字及数学公式-003v2.rar 因為修改太多~重新發帖~ 舊帖請至 https://www.ilovematlab.cn/thread-86806-1-4.html 查看 該函數應該已經很完善 如果有出現問題可至下方網址的日誌回報 ...
ui->pushButton->setEnabled(false); myCom->setBaudRate(BAUD9600); myCom->setDataBits(DATA_8); myCom->setParity(PAR_NONE); myCom->setStopBits(STOP_1); myCom->setTimeout(500); connect(myCom,...
Flash2D+3D游戏引擎: Flixel 位图引擎; Pushbutton engine; FlashPunk 引擎; As3isolibj; Away3D; Alternativa3D; Flare3D; CopperCube; Sophie3D;
通过点击Qt中的pushbutton,可以弹出菜单,菜单选项是QAction,可以连接槽完成相应功能。Qt工程是基于Qt5.10.1 32位,Qt Creator 4.5.1(Community)
带Icon的自绘PushButton示例
智能家居自动化:GIRA PUSHBUTTON SENSOR 4,GIRA TASTSENSOR 4.pdf
包括PushButton类的所有文件,可以用于自己自定义组件时参考。
pushbutton1_Callback.m
SW PUSHBUTTON SE PUSHBUTTON SW-PB Switch SW-SPDT SPDT Subminiature Toggle Switch, Right Angle Mounting, Vertical Actuation URF04 Ultrasonic wave distanc measure module VS1003b-Module MP3 module XTAL ...
带Icon的自绘PushButton
STM32F103ZET6单片机开发板PDF原理图PCB+AD集成封装库文件,集成库器件如下: ...SW PUSHBUTTON SE PUSHBUTTON SW-PB Switch SW-SPDT SPDT Subminiature Toggle Switch, Right Angle Mounting, Vertical Actuation URF0