Unity3D编写雷电游戏.docx
《Unity3D编写雷电游戏.docx》由会员分享,可在线阅读,更多相关《Unity3D编写雷电游戏.docx(16页珍藏版)》请在优知文库上搜索。
1、HierarchyCreateMainMainCamerarMeCU_StartBeginPlayerPlayerTerreinOInspectora*三MainIStaticTagUnZggdt1.ayerDfauhtJTransformO.Posibon1,191681Y13.49377Z-0.033691RotationOYOZOSceleX1Y1Z1Main.Script(Script)。ScriptMaineScriptGCurStateBMain(StateStOStateStart(Script).。ScriptKStateStartStaitMenUMenueeStartOQS
2、tateRun(Script)ProjectCratAllCode!8MameScnptAlMenuBBegmGamefiPayerConbolSStatefiStotcRunSstatestartImageAiModeINewTerrainPrefdbScene.StandardAssets.ThunderScriptPlayerStateRunPlayer料S税在按M拉卜网切根先起先场花:usingSystem.Coiiections;publicclassBeginGame:MonoBehaviourpublicStateRunm_RunState;publicMJIn_Scriptm-
3、Mai11Scnpt;/UsethisforinitializationvoidStart()vodOnMouseEnterOPentCenBC;voidOnMouseUpO(m一MdinSaiPt.ChangeStatWmRunState);voidOnMouseExitO(PrtntreXItM)出个和本息拄在一个板上而的.由它时Mii人M也的主场景JF同堂卜飞机的体动.现在起先真正的的或元素的*nr常力,让匕机动起求的先是飞m的我迪,可拿2D中的段班是利触侑诩环羊动.在3D中我阳M以让步保机移动存我我。叫口粮超个大地形.在地形I依一”附宅的东曲UUpdateISCaMedonceperf
4、rameVOKJUpdate()Tum1.eft=false;TumRight=false;if(Input.GtKey(KeyCadeAV)Vector3SCreenPos=Ca5creenP0s.y)this.trfisforn.Transte(Vector3.forwardTime.deltaTmem.nMoveSpeed);)if(Input.GetKey(KeyCde.S)Vector3SCreenPoS=Camer.maiCamera.WxldToScreenPolt(this.transrorm.position);If(OswnPos.y)ts.tr3sform.Trastat
5、e(Vector3,forwardme.detTme-m_nMoveSpeed);)If(1nput.GctKcy(KeyCodc.A)(VeCtOr3ScreenPos=Camera.mainC4merd.VorldToScreenPoint(this.transform.position);if(OscreenPos.x)Chis.transform.Transte(Vector3.enMTime.OeitaTimeMm.nMoveSpeed);向左仪添(CurRoutionscreenPos.x)this.transform.Tranlate(Vector3.leftTime.delUT
6、imcam.nMo*Spd;内右转if(CurRotation-RotateUmit)CurRotation-RotateSpeed;TumRight-true;)忖来If(ITum1.cft&ITumRight)if(CurRoUtion0.0)CurRotation-=RotateSpeed;elserf(Curftatono11znewVcctor3(0,0,1);m_Pbnc.rotation三rot;让如机和E帆超以H定的过I曳前格th.transforn.Translate(Vector3.forwardTime.deltaTmemMoveSpeed);Camer.mainCa11
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Unity3D 编写 雷电 游戏