// private void check_and_load(string name) { _lwfObject.lwfName = name; _fileSelectIndex = _fileList.Find(name); if (exist_resource(name)) { Debug.Log(name); _lwfObject.CreatePlayer(); Debug.Log(name); } }
static SpriteObject load_lwf(GameObject obj, string path) { SpriteObject sobj = obj.AddComponent <SpriteObject>(); sobj.lwfName = path; sobj.CreatePlayer(); sobj.player.AddEventHandler("finish", (movie, button) => { Debug.Log("FINISH"); }); //sobj.player.rootMovie.SetEventHandler("finish", (movie, button) => { Debug.Log("FINISH"); }); return(sobj); }
// @class SpriteObject // @desc GameObjectにSpriteObjectを貼り付けて読み込む // @decl load(gameobject, path, is_ui) // @param gameobject 対象となるGameObject // @param path LWFのファイルパス // @param is_ui レンダラがUI対応版かどうか private static int L_load(ILuaState lua) { GameObject obj = get_internal <GameObject>(lua, 1); string path = lua.ToString(2); bool is_ui = lua.ToBoolean(3); SpriteObject sobj = obj.AddComponent <SpriteObject>(); sobj.lwfName = path; if (is_ui) { sobj.renderType = SpriteObject.RenderType.UI; } push_new <SpriteObject>(lua, klassName, sobj, obj); lua.SetField(1, "sprite_object"); sobj.CreatePlayer(); return(0); }