本文整理汇总了C#中LWF.Movie.AttachMovie方法的典型用法代码示例。如果您正苦于以下问题:C# Movie.AttachMovie方法的具体用法?C# Movie.AttachMovie怎么用?C# Movie.AttachMovie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LWF.Movie
的用法示例。
在下文中一共展示了Movie.AttachMovie方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AttachMovieLua
public int AttachMovieLua(Movie movie, bool empty)
{
if (luaState==null)
return 0;
Lua.lua_State l = (Lua.lua_State)luaState;
int args = Lua.lua_gettop(l);
string linkageName;
string attachName;
int attachDepth = -1;
bool reorder = false;
int offset = empty ? 2 : 3;
MovieEventHandlerDictionary handlers =
new MovieEventHandlerDictionary() {
{"load",null},
{"postLoad",null},
{"unload",null},
{"enterFrame",null},
{"update",null},
{"render",null}
};
Movie child;
/* 1: LWF_Movie instance */
/* 2: linkageName:string */
/* 3: attachName:string */
/* 4: table {key:string, handler:function} */
/* 5: attachDepth:number (option) */
/* 6: reorder:boolean (option) */
/* or */
/* 1: LWF_Movie instance */
/* 2: attachName:string */
/* 3: table {key:string, handler:function} */
/* 4: attachDepth:number (option) */
/* 5: reorder:boolean (option) */
linkageName = empty ? "_empty" : Lua.lua_tostring(l, 2).ToString();
attachName = Lua.lua_tostring(l, offset).ToString();
if (args >= offset + 1) {
Lua.lua_getglobal(l, "LWF");
/* -1: LWF */
if (!Lua.lua_istable(l, -1)) {
Lua.lua_pop(l, 1);
/* 0 */
goto error;
}
Lua.lua_getfield(l, -1, "Instances");
/* -2: LWF */
/* -1: LWF.Instances */
Lua.lua_remove(l, -2);
/* -1: LWF.Instances */
if (!Lua.lua_istable(l, -1)) {
Lua.lua_pop(l, 1);
/* 0 */
goto error;
}
Lua.lua_getfield(l, -1, instanceIdString);
/* -2: LWF.Instances */
/* -1: LWF.Instances.<instanceId> */
Lua.lua_remove(l, -2);
/* -1: LWF.Instances.<instanceId> */
if (!Lua.lua_istable(l, -1)) {
Lua.lua_pop(l, 1);
/* 0 */
goto error;
}
Lua.lua_getfield(l, -1, "Handlers");
/* -2: LWF.Instances.<instanceId> */
/* -1: LWF.Instances.<instanceId>.Handlers */
Lua.lua_remove(l, -2);
/* -1: LWF.Instances.<instanceId>.Handlers */
if (!Lua.lua_istable(l, -1)) {
Lua.lua_pop(l, 1);
/* 0 */
goto error;
}
Lua.lua_pushnil(l);
/* -2: LWF.Instances.<instanceId>.Handlers */
/* -1: nil */
while (Lua.lua_next(l, 4) != 0) {
/* -3: LWF.Instances.<instanceId>.Handlers */
/* -2: key: eventName string */
/* -1: value: handler function */
string key = Lua.lua_tostring(l, -2).ToString();
if (key != null && Lua.lua_isfunction(l, -1)) {
int luaHandlerId = GetEventOffset();
handlers[key] = (Movie a) => {
if (!a.lwf.PushHandlerLua(luaHandlerId))
return;
/* -1: function */
Lua.lua_State ls = (Lua.lua_State)a.lwf.luaState;
Luna_LWF_Movie.push(ls, a, false);
/* -2: function */
/* -1: Movie or Button */
if (Lua.lua_pcall(ls, 1, 0, 0)!=0)
Lua.lua_pop(ls, 1);
/* 0 */
};
//.........这里部分代码省略.........