Flash 整合Unity3D 教程

时间:2015-12-23 15:07:41
【文件属性】:

文件名称:Flash 整合Unity3D 教程

文件大小:12KB

文件格式:TXT

更新时间:2015-12-23 15:07:41

Flash 整合Unity3D 教程

Flash 整合Unity3D 教程 例子 public class MyLoader extends Sprite implements IUnityContentHost { private var unityContentLoader:UnityContentLoader; public function MyLoader() { var params:UnityLoaderParams = new UnityLoaderParams(false,720,400,false); unityContentLoader = new UnityContentLoader("UnityContent.swf", this, params, false); unityContentLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onUnityContentLoaderProgress); unityContentLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onUnityContentLoaderComplete); unityContentLoader.loadUnity(); } private function onUnityContentLoaderProgress(eventrogressEvent):void { //Respond to load progress } private function onUnityContentLoaderComplete(event:Event):void { addChild(unityContentLoader); unityContentLoader.unityContent.setContentHost(this); } //unityInitStart has to be implemented by whatever implements IUnityContenthost //This is called when the content is loaded and the initialization of the unity engine is started. public function unityInitStart():void { //Unity engine started } //unityInitComplete has to be implemented by whatever implements IUnityContenthost //This is called when the unity engine is done initializing and the first level is loaded. public function unityInitComplete():void { unityContentLoader.unityContent.sendMessage("Main Camera","SetResponder",{responder:this}); } ... },


网友评论

  • 非常感谢楼主的分享,讲的挺仔细的
  • 确实是整合,整合了网上很多地方的资料,不过也算辛苦了,有些帮助的。
  • 只能做参考,看了不到一半,要有很强的as3基础
  • 可以使用,还算不错。
  • 这个是写给程序猿看的,路线是讲清楚了,是否可行我还没有试过