Created
November 14, 2012 05:03
-
-
Save mogeta/4070363 to your computer and use it in GitHub Desktop.
LWF example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SetEventHandler("Done",(movie,button)=>{print("yatta!");}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fscommand ("event", "done"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
[ExecuteInEditMode] | |
public class LWFSampleObject : LWFObject { | |
public int count=0; | |
void Start() | |
{ | |
string dir = System.IO.Path.GetDirectoryName(lwfName); | |
if (dir.Length > 0) | |
dir += "/"; | |
if (Application.isEditor) | |
UseDrawMeshRenderer(); | |
//sample swf | |
SetEventHandler("NoticePressEvent",(movie,button)=>{print("test");}); | |
//get fscommand("event",done); | |
SetEventHandler("done",(movie,button)=>{print("test");}); | |
//add eny event handler | |
SetMovieEventHandler("_root", | |
(movie)=>{print("load");}, | |
(movie)=>{print("postload");}, | |
(movie)=>{print("unload");}, | |
(movie)=>{count++;print("onEnterFrame"+count);}, | |
(movie)=>{print("update");}, | |
(movie)=>{print("render");}); | |
Load(lwfName, dir); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment