void OnGUI() { if (GUILayout.Button("Attach movie from library sprite")) { if (lwf != null) { // The linkage named "gree" is instantiated and attached to root movie. string instance_name = linkage_name + attach_count.ToString(); LWF.Movie attached_movie = lwf.rootMovie.AttachMovie( linkage_name, // Symbol's linkage name in library instance_name, // Attached movie name. // NOTE: Atttached movie name should unique. // If duplicated name is specified , new instance is not created and existing instance is returned. enterFrame: enterFrameCallback // Callback that called every frame. ); if (attached_movie != null) { // Randomize position attached_movie.MoveTo(Random.Range(0, 500), Random.Range(0, 500)); // Increament count for unique attached movie name. attach_count++; } } } GUILayout.Box(message); }
void OnGUI() { if (GUILayout.Button("Attach movie from movie")) { if (lwf != null) { // The linkage named "gree" is instantiated and attached to root movie. LWF.Movie attached_movie = lwf.rootMovie.AttachMovie( "gree", // Symbol's linkage name in library "attached_gree" + attach_count.ToString() // Attached movie name. // NOTE: Atttached movie name should unique. // If duplicated name is specified , new instance is not created and existing instance is returned. ); if (attached_movie != null) { // Randomize position attached_movie.MoveTo(Random.Range(0, 500), Random.Range(0, 500)); // Increament count for unique attached movie name. attach_count++; } } } }
void OnGUI() { if (GUILayout.Button("Attach movie from library sprite")) { if (lwf != null) { // The linkage named "gree" is instantiated and attached to root movie. LWF.Movie attached_movie = lwf.rootMovie.AttachMovie( linkage_name, // Symbol's linkage name in library linkage_name + attached_movies.Count.ToString() // Attached movie name. // NOTE: Atttached movie name should unique. // If duplicated name is specified , new instance is not created and existing instance is returned. ); if (attached_movie != null) { attached_movies.Add(attached_movie); // Randomize position attached_movie.MoveTo( UnityEngine.Random.Range(0, 500), UnityEngine.Random.Range(0, 500)); } } } // Go to "action" if (GUILayout.Button("action")) { foreach (Movie attached_movie in attached_movies) { attached_movie.GotoLabel("action"); attached_movie.Play(); } } // Go back to "start" if (GUILayout.Button("start")) { foreach (Movie attached_movie in attached_movies) { attached_movie.GotoLabel("start"); attached_movie.Play(); } } }
public static int _bind_moveTo(Lua.lua_State L) { if (Lua.lua_gettop(L) != 3 || Luna.get_uniqueid(L, 1) != 29625181 || Lua.lua_isnumber(L, 2) == 0 || Lua.lua_isnumber(L, 3) == 0) { Luna.printStack(L); Lua.luaL_error(L, "luna typecheck failed:moveTo(LWF.Movie self)"); } LWF.Movie self = Luna_LWF_Movie.check(L, 1); float vx = (float)Lua.lua_tonumber(L, 2); float vy = (float)Lua.lua_tonumber(L, 3); try { self.MoveTo(vx, vy); } catch (Exception e) { Lua.luaL_error(L, new Lua.CharPtr(e.ToString())); } return(0); }