- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
unity3d FPS游戏教程2
FPS游戏教程2
Part 2: Enhancements 第二部分 增强
This intermediate-level tutorial extends upon the Basic FPS tutorial by introducing game elements such as multiple weapons, damage and enemies.
这个中级教程是FPS基本教程的扩展,介绍游戏元素例如多种武器、毁伤和敌人。
Prerequisites
This tutorial assumes that you are familiar with the Unity interface and basic scripting
concepts. Additionally, you should already be familiar with the concepts discussed in
Part 1 of the FPS tutorial series.
这个指南已经默认了你已经熟悉了Unity界面和基本的脚本概念。你已经熟悉了第一部分的FPS概念的讨论。
Before we begin -level setup
在我们开始层面设置之前
Download FPS_Tutorial.zip, unzip, and open the project folder in Unity. If you
have completed Part 1, then unzip the files to a new folder.
下载FPS_Tutorial.zip解压缩并且在U你体验中打开项目,如果你有已完成的第一部分,这时解压缩它们到一个新的目录。
Import the Standard Assets Unity Package.
导入Standard Assets标准资源包
Add the mainLevelMesh and FPS controller prefab to the scene.
增加mainLevelMesh和FPS控制预制物体到场景中。
NOTE In this tutorial no new scripts need to created. We’ll be using the ones that
were downloaded from the Unity Package.
注意 在这个指南中没有新的脚本需要建立,我们将使用下载的Unity软件包中的一些东西。
Weapon switching 武器开关
Before we discuss how to create each individual weapon, we need to write some code to manage how the weapons are initialized and switched from one to another. Let’s look at the Javascript for PlayerWeapons.js:
在我们讨论如何建立每一个个体的武器之前,我们需要写一些代码以便管理这些武器怎么被初始化并且能被另一个(武器)关闭,让我们看一下PlayerWeapons.js:这个脚本代码:
function Awake()
{
// Select the first weapon 选择第一个武器
SelectWeapon(0);
}
This function initializes weapon 0 as the default weapon.
这个函数初始化武器0 为缺省的武器。
function Update()
{
// Did the user press fire?用户按开火?
if (Input.GetButton (Fire1))
BroadcastMessage(Fire);
if (Input.GetKeyDown(1))
{
SelectWeapon(0);
}
else if (Input.GetKeyDown(2))
{
SelectWeapon(1);
}
}
This function detects keyboard input; the fire button, the ?1? button for weapon 1 or the ?2? button for weapon 2. The weapons will be children objects of the Main Camera.
function SelectWeapon(index : int)
{
for (var i=0;itransform.childCount;i++)
{
您可能关注的文档
- 实验二可上传.docx
- 第五章_RACF.doc
- 管理信息系统-超市.doc
- 超市管理系统数据说明书.doc
- VMware Host Profiles配置Step by Step.doc
- 超市管理软件概要详细设计说明书模板.doc
- 美国留学申请:“套磁信”模板.doc
- 系统数据库设计2.docx
- 某超管理信息系统详细设计.doc
- 新译林版四上Project 1 My profile教案.doc
- 中日友好医院招聘合同制编辑1人参考试题带答案解析.docx
- 2025年碳纤维增强陶瓷基复合材料2025年应用.docx
- 2025考研农学真题及答案解析.doc
- 《快递行业末端配送优化实践:2025年冷链快递需求增长机遇探讨》.docx
- 中日友好医院招聘合同制编辑1人参考试题附答案解析.docx
- 2025-2026学年初中英语牛津译林版2012九年级上册-译林版2012教学设计合集.docx
- 《2025年特种陶瓷行业在智能传感器的应用突破》.docx
- 《2025年工业节能电机能效提升余热回收技术融资环境分析》.docx
- 2025年光电传感器在虚拟现实行业应用研究.docx
- 2025年无人机行业应用场景分析及发展趋势研究报告.docx
最近下载
- (高清版)G-B∕T 36992-2019 手动牙间刷.pdf VIP
- 《一只鸟仔》(课件)人音版音乐三年级下册.ppt VIP
- 视觉传达设计专业介绍.pptx VIP
- JB_T 13649.1-2019 高速刀柄与机床主轴接口 第1部分:带有法兰接触面的空心圆锥(HSK)接口技术规范.docx VIP
- J B-T 11342-2013 小型电机定子端部整形机.pdf VIP
- 2023年视觉传达设计专业介绍模板.pptx VIP
- 消防安全评估合同范本6篇.docx VIP
- ags8101_大华视频监控平台接入网关服务器_使用说明书_v1 0 0_20130924.pdf VIP
- SAE AMS2774G-2020 镍及钴合金零件的热处理 Heat Treatment Nickel Alloy and Cobalt Alloy Parts.pdf
- (可直接使用)中国土壤分布.ppt VIP
原创力文档


文档评论(0)