Unity3D学习笔记《Space Shooter》二
来源:互联网 发布:ubuntu win10启动项 编辑:程序博客网 时间:2024/05/01 16:14
写 PlayerController 的时候依然需要修改。
如下。
using UnityEngine;using System.Collections;[System.Serializable]public class Boundary{public float xMin,xMax,zMin,zMax;}public class PlayerController : MonoBehaviour{public Rigidbody rb;public float speed;public Boundary bd;public float tilt;void Start() { rb = GetComponent<Rigidbody> (); } void FixedUpdate() { float moveH=Input.GetAxis("Horizontal"); float moveV=Input.GetAxis("Vertical"); Vector3 now = new Vector3 (moveH, 0.0f, moveV); rb.velocity = now * speed;rb.position = new Vector3(Mathf.Clamp(rb.position.x,bd.xMin,bd.xMax),0.0f,Mathf.Clamp(rb.position.z,bd.zMin,bd.zMax));rb.rotation = Quaternion.Euler (0.0f, 0.0f, rb.velocity.x * -tilt);} }
自己创建子弹材质的时候,fx_bolt_orange需要选择Shader的时候要选择Mobile/particles/Addtive,然后才能选择纹理。
在创建盒子的时候。查找OnTriggerExit函数的时候,提示在history里面。不知道以后还能不能用。
这四章完成。
0 0
- Unity3D学习笔记《Space Shooter》二
- Unity3D学习笔记《Space Shooter》一
- Unity3D学习笔记《Space Shooter》三
- Unity学习笔记(二)----Space Shooter
- unity官方教程Space Shooter 学习笔记
- Part2:Unity学习笔记十 - Space Shooter
- Part2:Unity学习笔记十一 - Space Shooter
- Unity学习笔记(一)----Space Shooter
- Unity学习笔记(三)----Space Shooter
- unity space shooter 学习
- unity官方教程Space shooter学习笔记-01
- unity官方教程Space shooter学习笔记-02
- Unity学习笔记二 - Survival Shooter Tutorial
- Unity笔记 SPACE SHOOTER 实例详解
- unity官方教程space shooter 学习文档
- 学习Space shooter 小项目 总结
- Unity3d 5.4-官方教程2之Space Shooter
- Unity3D 学习日志之一 Survival shooter P2
- Windows下Nginx的安装与配置
- How to deploy iOS apps to the iPhone via the command line
- android 布局
- morose things go by
- 操作符重载[ ];
- Unity3D学习笔记《Space Shooter》二
- mezzanine timezone 的问题
- socket通信之八:完成端口模型实现的客户/服务器模型
- partial关键字
- 01-01 Creational Patterns
- Android ArrayAdapter 详解
- Linux内核中trace_xxxx()函数的定义
- POJ2309 BST(树状数组)
- 欢迎来挑战:极限打印99乘法表