Unity3D FPS Game:第一人称射击游戏(三)

2023-11-09

耗时一周制作的第一人称射击游戏,希望能帮助到大家!
由于代码较多,分为三篇展示,感兴趣的朋友们可以点击查看!

Unity3D FPS Game:第一人称射击游戏(一)

Unity3D FPS Game:第一人称射击游戏(二)

Unity3D FPS Game:第一人称射击游戏(三)

资源

链接:https://pan.baidu.com/s/15s8KSN_4JPAvD_fA8OIiCg
想要资源的同学关注公众号输入【FPS】即可获取密码下载资源,这是小编做的公众号,里面有各种外卖优惠券,有点外卖需求的话各位同学可以支持下!
在这里插入图片描述

在这里插入图片描述

代码

FPS_KeyPickUp.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FPS_KeyPickUp : MonoBehaviour
{
    public AudioClip keyClip;                               //钥匙音效
    public int keyId;                                       //钥匙编号
                                                            
    private GameObject player;                              //玩家
    private FPS_PlayerInventory playerInventory;            //背包


    private void Start()
    {
        player = GameObject.FindGameObjectWithTag(Tags.player);
        playerInventory = player.GetComponent<FPS_PlayerInventory>();
    }

    private void OnTriggerEnter(Collider other)
    {
        if(other.gameObject == player)
        {
            AudioSource.PlayClipAtPoint(keyClip, transform.position);
            playerInventory.AddKey(keyId);
            Destroy(this.gameObject);
        }
    }
}

FPS_LaserDamage.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FPS_LaserDamage : MonoBehaviour
{
    public int damage = 20;                        //伤害值
    public float damageDelay = 1;                  //伤害延迟时间
                                                   
    private float lastDamageTime = 0;              //上一次收到伤害的时间
    private GameObject player;                     //玩家

    private void Start()
    {
        player = GameObject.FindGameObjectWithTag(Tags.player);
    }

    private void OnTriggerStay(Collider other)
    {
        if(other.gameObject == player && Time.time > lastDamageTime + damageDelay)
        {
            player.GetComponent<FPS_PlayerHealth>().TakeDamage(damage);
            lastDamageTime = Time.time;
        }
    }
}

FPS_PlayerContorller.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public enum PlayerState
{
    None,                   //初始状态
    Idle,                   //站立
    Walk,                   //行走
    Crouch,                 //蹲伏
    Run                     //奔跑
}

public class FPS_PlayerContorller : MonoBehaviour
{
    private PlayerState state = PlayerState.None;

    /// <summary>
    /// 人物状态设置
    /// </summary>
    public PlayerState State
    {
        get
        {
            if (runing)
            {
                state = PlayerState.Run;
            }
            else if (walking)
            {
                state = PlayerState.Walk;
            }
            else if (crouching)
            {
                state = PlayerState.Crouch;
            }
            else
            {
                state = PlayerState.Idle;
            }
            return state;
        }
    }

    public float sprintSpeed = 10f;                         //冲刺速度
    public float sprintJumpSpeed = 8f;                      //冲刺跳跃速度
    public float normalSpeed = 6f;                          //正常速度
    public float normalJumpSpeed = 7f;                      //正常跳跃速度
    public float crouchSpeed = 2f;                          //蹲伏速度
    public float crouchJumpSpeed = 6f;                      //蹲伏跳跃速度
    public float crouchDeltaHeight = 0.5f;                  //蹲伏下降高度
    public float gravity = 20f;                             //重力
    public float cameraMoveSpeed = 8f;                      //相机跟随速度
    public AudioClip jumpAudio;                             //跳跃音效

    public float currentSpeed;                              //当前速度
    public float currentJumnSpeed;                          //当前跳跃速度

    private Transform mainCamera;                           //主摄像对象
    private float standardCamHeight;                        //相机标准高度
    private float crouchingCamHeight;                       //蹲伏时相机高度
    private bool grounded = false;                          //是否在地面上
    private bool walking = false;                           //是否在行走
    private bool crouching = false;                         //是否在蹲伏
    private bool stopCrouching = false;                     //是否停止蹲伏
    private bool runing = false;                            //是否在奔跑
    private Vector3 normalControllerCenter = Vector3.zero;  //角色控制器中心
    private float normalControllerHeight = 0f;              //角色控制器高度
    private float timer = 0;                                //计时器
    private CharacterController characterController;        //角色控制器组件
    private AudioSource audioSource;                        //音频源组件
    private FPS_PlayerParameters parameters;                //FPS_Parameters组件
    private Vector3 moveDirection = Vector3.zero;           //移动方向

    /// <summary>
    /// 初始化
    /// </summary>
    private void Start()
    {
        crouching = false;
        walking = false;
        runing = false;
        currentSpeed = normalSpeed;
        currentJumnSpeed = normalJumpSpeed;
        mainCamera = GameObject.FindGameObjectWithTag(Tags.mainCamera).transform;
        standardCamHeight = mainCamera.position.y;
        crouchingCamHeight = standardCamHeight - crouchDeltaHeight;
        audioSource = this.GetComponent<AudioSource>();
        characterController = this.GetComponent<CharacterController>();
        parameters = this.GetComponent<FPS_PlayerParameters>();
        normalControllerCenter = characterController.center;
        normalControllerHeight = characterController.height;
    }

    private void FixedUpdate()
    {
        MoveUpdate();
        AudioManager();
    }

    /// <summary>
    /// 任务移动控制更新
    /// </summary>
    private void MoveUpdate()
    {
        //如果在地面上
        if (grounded)
        {
            //自身坐标轴的y轴对应世界坐标轴的z轴
            moveDirection = new Vector3(parameters.inputMoveVector.x, 0, parameters.inputMoveVector.y);
            //将 direction 从本地空间变换到世界空间
            moveDirection = transform.TransformDirection(moveDirection);
            moveDirection *= currentSpeed;
            //如果玩家输入跳跃
            if (parameters.isInputJump)
            {
                //获取跳跃速度
                CurrentSpeed();
                moveDirection.y = currentJumnSpeed;
                //播放跳跃音频
                AudioSource.PlayClipAtPoint(jumpAudio, transform.position);
            }
        }
        //受重力下落
        moveDirection.y -= gravity * Time.deltaTime;
        //CollisionFlags 是 CharacterController.Move 返回的位掩码。
        //其概述您的角色与其他任何对象的碰撞位置。
        CollisionFlags flags = characterController.Move(moveDirection * Time.deltaTime);
        /*
        CollisionFlags.CollidedBelow   底部发生了碰撞"flags & CollisionFlags.CollidedBelow"返回1;
        CollisionFlags.CollidedNone    没发生碰撞"flags & CollisonFlags.CollidedNone"返回1;
        CollisionFlags.CollidedSides   四周发生碰撞"flags & CollisionFlags.CollidedSides"返回1;
        CollisionFlags.CollidedAbove   顶端发生了碰撞"flags & CollisionFlags.CollidedAbove"返回1;        
        */
        //表示在地面上,grounded为true
        grounded = (flags & CollisionFlags.CollidedBelow) != 0;
        //如果在地面上且有移动的输入
        if (Mathf.Abs(moveDirection.x) > 0 && grounded || Mathf.Abs(moveDirection.z) > 0 && grounded) 
        {
            if (parameters.isInputSprint)
            {
                walking = false;
                crouching = false;
                runing = true;
            }
            else if (parameters.isInputCrouch)
            {
                walking = false;
                crouching = true;
                runing = false;
            }
            else
            {
                walking = true;
                crouching = false;
                runing = false;
            }
        }
        else
        {
            if (walking)
            {
                walking = false;
            }
            if (runing)
            {
                runing = false;
            }
            if (parameters.isInputCrouch)
            {
                crouching = true;
            }
            else
            {
                crouching = false;
            }
        }
        //蹲伏状态下的角色控制器中心与高度
        if (crouching)
        {
            characterController.height = normalControllerHeight - crouchDeltaHeight;
            characterController.center = normalControllerCenter - new Vector3(0, crouchDeltaHeight / 2, 0);
        }
        else
        {
            characterController.height = normalControllerHeight;
            characterController.center = normalControllerCenter;
        }
        CurrentSpeed();
        CrouchUpdate();
    }

    /// <summary>
    /// 根据人物的状态对其速度进行定义
    /// </summary>
    private void CurrentSpeed()
    {
        switch (State)
        {
            case PlayerState.Idle:
                currentSpeed = normalSpeed;
                currentJumnSpeed = normalJumpSpeed;
                break;
            case PlayerState.Walk:
                currentSpeed = normalSpeed;
                currentJumnSpeed = normalJumpSpeed;
                break;
            case PlayerState.Crouch:
                currentSpeed = crouchSpeed;
                currentJumnSpeed = crouchJumpSpeed;
                break;
            case PlayerState.Run:
                currentSpeed = sprintSpeed;
                currentJumnSpeed = sprintJumpSpeed;
                break;
        }
    }

    /// <summary>
    /// 根据人物状态对其脚步声进行定义
    /// </summary>
    private void AudioManager()
    {
        if(State == PlayerState.Walk)
        {
            //设置音频源的音高,行走时缓慢
            audioSource.pitch = 0.8f;
            if (!audioSource.isPlaying)
            {
                audioSource.Play();
            }
        }
        else if(State == PlayerState.Run)
        {
            //设置音频源的音高,奔跑时急促
            audioSource.pitch = 1.3f;
            if (!audioSource.isPlaying)
            {
                audioSource.Play();
            }
        }
        else
        {
            audioSource.Stop();
        }
    }

    /// <summary>
    /// 蹲伏下降与蹲伏上升时相机位置更新
    /// </summary>
    private void CrouchUpdate()
    {
        if (crouching)
        {
            if (mainCamera.localPosition.y > crouchingCamHeight)
            {
                if(mainCamera.localPosition.y-(crouchDeltaHeight * Time.deltaTime * cameraMoveSpeed)< crouchingCamHeight)
                {
                    mainCamera.localPosition = new Vector3(mainCamera.localPosition.x, crouchingCamHeight, mainCamera.localPosition.z); 
                }
                else
                {
                    mainCamera.localPosition -= new Vector3(0, crouchDeltaHeight * Time.deltaTime * cameraMoveSpeed, 0);
                }
            }
            else
            {
                mainCamera.localPosition = new Vector3(mainCamera.localPosition.x, crouchingCamHeight, mainCamera.localPosition.z);
            }
        }
        else
        {
            if (mainCamera.localPosition.y < standardCamHeight)
            {
                if(mainCamera.localPosition.y + (crouchDeltaHeight * Time.deltaTime * cameraMoveSpeed) > standardCamHeight)
                {
                    mainCamera.localPosition = new Vector3(mainCamera.localPosition.x, standardCamHeight, mainCamera.localPosition.z);
                }
                else
                {
                    mainCamera.localPosition += new Vector3(0, crouchDeltaHeight * Time.deltaTime * cameraMoveSpeed, 0);
                }
            }
            else
            {
                mainCamera.localPosition = new Vector3(mainCamera.localPosition.x, standardCamHeight, mainCamera.localPosition.z);
            }
        }
    }
}

FPS_PlayerHealth.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class FPS_PlayerHealth : MonoBehaviour
{
    public bool isDead;                         //是否死亡
    public float resetAfterDeathTime = 5;       //死亡后重置时间
    public AudioClip deathClip;                 //死亡时音效
    public AudioClip damageClip;                //受伤害时音效
    public float maxHp = 100;                   //生命值上限
    public float currentHp = 100;               //当前生命值
    public float recoverSpeed = 1;              //回复生命值速度
    public Text hpText;

    private float timer;                        //计时器
    private FadeInOut fader;                    //FadeInOut组件
    private FPS_Camera fPS_Camera;

    private void Start()
    {
        currentHp = maxHp;
        fader = GameObject.FindGameObjectWithTag(Tags.fader).GetComponent<FadeInOut>();
        fPS_Camera = GameObject.FindGameObjectWithTag(Tags.mainCamera).GetComponent<FPS_Camera>();
        BleedBehavior.BloodAmount = 0;
        hpText.text = "生命值:" + Mathf.Round(currentHp) + "/" + Mathf.Round(maxHp);
    }

    private void Update()
    {
        if (!isDead)
        {
            currentHp += recoverSpeed * Time.deltaTime;
            hpText.text = "生命值:" + Mathf.Round(currentHp) + "/" + Mathf.Round(maxHp);
            if (currentHp > maxHp)
            {
                currentHp = maxHp;
            }
        }
        if (currentHp < 0)
        {
            if (!isDead)
            {
                PlayerDead();
            }
            else
            {
                LevelReset();
            }
        }
    }

    /// <summary>
    /// 受到伤害
    /// </summary>
    public void TakeDamage(float damage)
    {
        if (isDead)
            return;
        //播放受伤音频
        AudioSource.PlayClipAtPoint(damageClip, transform.position);
        //将值限制在 0 与 1 之间并返回其伤害值
        BleedBehavior.BloodAmount += Mathf.Clamp01(damage / currentHp);
        currentHp -= damage;
    }

    /// <summary>
    /// 禁用输入
    /// </summary>
    public void DisableInput()
    {
        //将敌人相机禁用
        transform.Find("Player_Camera/WeaponCamera").gameObject.SetActive(false);
        this.GetComponent<AudioSource>().enabled = false;
        this.GetComponent<FPS_PlayerContorller>().enabled = false;
        this.GetComponent<FPS_PlayerInput>().enabled = false;
        if (GameObject.Find("BulletCount") != null)
        {
            GameObject.Find("BulletCount").SetActive(false);
        }
        fPS_Camera.enabled = false;
    }

    /// <summary>
    /// 玩家死亡
    /// </summary>
    public void PlayerDead()
    {
        isDead = true;

        DisableInput();
        AudioSource.PlayClipAtPoint(deathClip, transform.position);
    }

    /// <summary>
    /// 关卡重置
    /// </summary>
    public void LevelReset()
    {
        timer += Time.deltaTime;
        if (timer > resetAfterDeathTime)
        {
            fader.EndScene();
        }
    }
}

FPS_PlayerInput.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public class FPS_PlayerInput : MonoBehaviour
{
    /// <summary>
    /// 锁定鼠标属性
    /// </summary>
    public bool LockCursor
    {
        get
        {
            //如果鼠标是处于锁定状态,返回true
            return Cursor.lockState == CursorLockMode.Locked ? true : false;
        }
        set
        {
            Cursor.visible = value;
            Cursor.lockState = value ? CursorLockMode.Locked : CursorLockMode.None;
        }
    }

    private FPS_PlayerParameters parameters;
    private FPS_Input input;

    private void Start()
    {
        LockCursor = true;
        parameters = this.GetComponent<FPS_PlayerParameters>();
        input = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<FPS_Input>();
    }

    private void Update()
    {
        InitialInput();
    }

    /// <summary>
    /// 输入参数赋值初始化
    /// </summary>
    private void InitialInput()
    {
        parameters.inputMoveVector = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
        parameters.inputSmoothLook = new Vector2(Input.GetAxisRaw("Mouse X"), Input.GetAxisRaw("Mouse Y"));
        parameters.isInputCrouch = input.GetButton("Crouch");
        parameters.isInputFire = input.GetButton("Fire");
        parameters.isInputJump = input.GetButton("Jump");
        parameters.isInputReload = input.GetButtonDown("Reload");
        parameters.isInputSprint = input.GetButton("Sprint");
    }
}

FPS_PlayerInventory.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FPS_PlayerInventory : MonoBehaviour
{

    private List<int> keysArr;          //钥匙列表

    private void Start()
    {
        keysArr = new List<int>();
    }

    /// <summary>
    /// 添加钥匙
    /// </summary>
    public void AddKey(int keyId)
    {
        if (!keysArr.Contains(keyId))
        {
            keysArr.Add(keyId);
        }
    }

    /// <summary>
    /// 是否有对应门的钥匙
    /// </summary>
    /// <param name="doorId"></param>
    /// <returns></returns>
    public bool HasKey(int doorId)
    {
        if (keysArr.Contains(doorId))
            return true;
        return false;
    }
}

FPS_PlayerParameters.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

//当你添加的一个用了RequireComponent组件的脚本,
//需要的组件将会自动被添加到game object(游戏物体),
//这个可以有效的避免组装错误
[RequireComponent(typeof(CharacterController))]


public class FPS_PlayerParameters : MonoBehaviour
{
    [HideInInspector]
    public Vector2 inputSmoothLook;     //相机视角
    [HideInInspector]
    public Vector2 inputMoveVector;     //人物移动
    [HideInInspector]
    public bool isInputFire;            //是否开火
    [HideInInspector]
    public bool isInputReload;          //是否换弹
    [HideInInspector]
    public bool isInputJump;            //是否跳跃
    [HideInInspector]
    public bool isInputCrouch;          //是否蹲伏
    [HideInInspector]
    public bool isInputSprint;          //是否冲刺

}

HashIDs.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HashIDs : MonoBehaviour
{
    public int deadBool;
    public int speedFloat;
    public int playerInSightBool;
    public int shotFloat;
    public int aimWidthFloat;
    public int angularSpeedFloat;

    private void Awake()
    {
        deadBool = Animator.StringToHash("Dead");
        speedFloat = Animator.StringToHash("Speed");
        playerInSightBool = Animator.StringToHash("PlayerInSight");
        shotFloat = Animator.StringToHash("Shot");
        aimWidthFloat = Animator.StringToHash("AimWidth");
        angularSpeedFloat = Animator.StringToHash("AngularSpeed");
    }
}

Tags.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

/// <summary>
/// 封装标签
/// </summary>
public class Tags
{
    public const string player = "Player";                      //玩家
    public const string gameController = "GameController";      //游戏控制器
    public const string enemy = "Enemy";                        //敌人
    public const string fader = "Fader";                        //淡入淡出的画布
    public const string mainCamera = "MainCamera";              //主摄像机
}

一个坚持学习,坚持成长,坚持分享的人,即使再不聪明,也一定会成为优秀的人!

整理不易,如果看完觉得有所收获的话,记得一键三连哦,谢谢!

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Unity3D FPS Game:第一人称射击游戏(三) 的相关文章

  • Redis——redis配置与优化

    文章目录 一 关系数据库与非关系型数据库 1 关系型数据库 2 非关系型数据库 二 Redis 简介 1 Redis的应用场景 2 Redis的优点 三 Redis 安装部署 1 安装Redis 2 配置参数 四 Redis

随机推荐

  • 任务管理器详解

    进程 看是否有除系统外多余进程 可能是病毒或没有完全关闭的进程 影响机器性能 进程下显示了所有当前正在运行的进程 包括应用程序 后台服务等 性能下可以看到CPU和内存 页面文件的使用情况 卡机 死机 中毒时 CPU使用率会达到100 CPU
  • mysql 用sqlyog连接1045错误解决办法(数据库在linux)

    1045 多半就是要么你端口号3306没开 要么就是你密码错误 安装网路分析 yum install net tools 防火墙开放3306端口 root localhost firewall cmd zone public add por
  • 学生信息管理系统(登录功能)

    工具eclipse 主要操作登陆 增删查改 编写实体类 public class Student private int id private String sId 学号 private String name private String
  • CTF BugKu平台———(Web篇②)

    源代码 unescape编码 https tool chinaz com Tools Escape aspx PS p1 35 34 61 61 32 p2 然后提交即可 67d709b2b54aa2aa648cf6e87a7114f1 文
  • 操作系统 线程同步实验

    操作系统 线程同步实验 一 实验目标 顺序表循环队列实现的实验目标 掌握使用顺序表和循环队列实现队列的基本操作 如队列的插入 删除 遍历等 同时了解循环队列的内部实现原理和利用循环队列解决实际问题的方法 Linux生产者 消费者问题的多线程
  • MFC自定义消息

    一 背景 消息机制是windows程序的典型运行机制 在MFC中有很多已经封装好了的消息 但是在有些特殊情况下我们需要自定义一些消息去完成一些我们所需要的功能 这时候MFC的向导不能帮助我们做到这一点 对此 我们可以通过添加相应的代码去完成
  • C++ 深浅拷贝、写时拷贝

    前言 本章以string类为例介绍浅拷贝与深拷贝 引用计数写时拷贝作为了解内容 string类的模拟实现参考C string类的模拟实现 文章目录 1 浅拷贝 2 深拷贝 3 引用计数 写时拷贝 1 浅拷贝 浅拷贝 对于有申请空间的对象的类
  • Java集合类的总结与比较

    Collection List LinkedList ArrayList Vector Stack Set Map Hashtable HashMap WeakHashMap Collection接口 Collection是最基本的集合接口
  • react自定义useState hook获取更新后值

    您好 如果喜欢我的文章 可以关注我的公众号 量子前端 将不定期关注推送前端好文 在业务中有比较多的场景需要在setState中获取更新后的值从而进行下一步的业务操作 在Class组件中可以通过 this setState name 123
  • 全网最详细中英文ChatGPT-GPT-4示例文档-官网推荐的48种最佳应用场景——从0到1快速入门自然语言指令创建支付API代码(附python/node.js/curl命令源代码,小白也能学)

    目录 Introduce 简介 setting 设置 Prompt 提示 Sample response 回复样本 API request 接口请求 python接口请求示例 node js接口请求示例 curl命令示例 json格式示例
  • 分布式系统领域经典论文翻译集

    分布式领域论文译序 sql nosql年代记 SMAQ 海量数据的存储计算和查询 一 google论文系列 1 google系列论文译序 2 The anatomy of a large scale hypertextual Web sea
  • Azure云服务基础其五

    文章目录 Azure云服务基础其五 什么是Azure Kubernetes 服务 创建 Kubernetes集群 部署应用程序 测试应用程序 Azure云服务基础其五 什么是Azure Kubernetes 服务 官网的解释是Azure K
  • docker搭建mysql高可用集群

    docker中搭建mysql高可用集群 percona xtradb cluster percona xtradb cluster是一款很棒的mysql高可用集群解决方案 特点是每个节点都能进行读写且都保存全量的数据 也就是说在任何一个节点
  • 大数据 第一节课 linux基础 基本的操作

    Linux的基础 一 Linux的实验环境 二 安装配置Linux和Linux的目录结构 1 安装Linux的过程中 注意的问题 虚拟机类型 Redhat linux 7 64位 重要的 网卡的类型 仅主机模式 host only IP地址
  • 性能测试(并发负载测试)测试分析

    声明 此文章是从网络上转载下来的 至于真实出处无法找到 在对系统进行测试的时候 通常有一个难点那就是使用LR JMeter等进行了性能测试 但是很难进行测试后的分析 以下很大一部分是从网上转载下的一位前辈对性能测试后的分析的见解 分析原则
  • 一些诗集-自创+整理

    常学问 传统文化常学问 研究中易琢磨神 时时出来抬头看 兼容并包实践真
  • win10和linux双系统免u盘,WIN10下免U盘安装Ubuntu双系统

    目录 一 工具下载 二 安装前的准备工作 三 安装Ubuntu系统 四 注意 最后 附下本文参考的博客 一 工具下载 1 下载Ubuntu操作系统 Ubuntu操作协同最好是去Ubuntu官方网站下载 https ubuntu com do
  • 你知道es是如何计算相似度得分的吗?

    1 es中相似度计算公式 BM25 6 x版本和7 x 版本的es的默认得分计算方式都是BM25 假如用户给定一个输入 Q Q Q 其包含了关键字 q 1
  • Latex插入表格及表格设置

    前言 下面将介绍简单的表格插入与格式设置 更多请参考texdoc中宏包说明 1 导言区 代码如下 示例 documentclass article usepackage ctex 更多表格设置见 texdoc booktab 三线表 tex
  • Unity3D FPS Game:第一人称射击游戏(三)

    耗时一周制作的第一人称射击游戏 希望能帮助到大家 由于代码较多 分为三篇展示 感兴趣的朋友们可以点击查看 Unity3D FPS Game 第一人称射击游戏 一 Unity3D FPS Game 第一人称射击游戏 二 Unity3D FPS