[問題] Pushbutton 的 makeEntity
請問在用PBE.makeEntity(type:String, paramas:Object)時
paramas設成{"@Spatial.position": ...}
和設成{ positionReference : ...}
positionReference:PropertyReference = new PropertyReference("@Spatial.position")
有什麼不一樣?
當我把paramas設成"@Spatial.position"
或是(new PropertyReference("@Spatial.position"))時,都可以正常執行
可是先在外面設好一個PropertyReference時,雖然會產生新的entity,
但是卻不理會paramas中的PropertyReference : ...
原始碼:http://www.mediafire.com/?wnvtmjzktib
參考:http://code.google.com/p/pushbuttonengine/wiki/Templates
(下面的Entity Creation Idiom)
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.192.65.51
推
07/10 21:47, , 1F
07/10 21:47, 1F
我把paramas設成
{"@Spatial.position":new Point(rand_x,rand_y)}
或是
{(new propertyReference("@Spatial.position")): ...}
會把Entity移到(rand_x,rand_y)上
可是設成{positionReference :...}的話
就只會待在(0,0)
推
07/10 21:52, , 2F
07/10 21:52, 2F
→
07/10 21:53, , 3F
07/10 21:53, 3F
※ 編輯: ousapas 來自: 123.192.65.51 (07/10 22:00)
討論串 (同標題文章)