资源简介
源码可使用unity打开,一个赛车游戏。
![](http://www.nz998.com/pic/58568.jpg)
代码片段和文件信息
/**
* A simple car physics script using wheel colliders.
* Jaap Kreijkamp jaap@ctrl-j.com.au
*
* orientation should be that front of car is in direction of
* the ‘blue arrow‘ in Unity the roof should be in direction of
* the green angle. Thus with rotation 0 0 0 adding 1 to Z
* will move car 1m forward adding 1 to Y will move car 1m
* upward. The wheels should be children of the car object this
* script is added to and connected to the wheelFL wheelFR ...
* variables.
*
* Please modify script and do whatever you like with it
* in it‘s current state it should give a working car
* but by no means perfect (or even close) behavior.
* It‘s my first attempt and don‘t really need in my current
* project so haven‘t put too much effort into it to perfect
* it. As often people are looking for help to getting
* a car working with wheel colliders I‘d appreciate when
* improvements are posted back on the unity forums.
*
* Lastly thanks to all the people helping me on forums (especially
* the order of initialisation problem and other example
* code that helped me much in learning how to do stuff like
* this).
*/
using UnityEngine;
using System.Collections;
// used to indicate if car is frontwheeldrive backwheeldrive or 4wheeldrive
// also (mis)used to indicate if a wheel is a front wheel or a back wheel
public enum JWheelType {
Front = 1
Back = 2
All = 3
}
public class JCar : MonoBehaviour {
// if connected the controls will block if object not active
// (for example steer only if car camera is active).
public Gameobject checkForActive;
// if set car records position accel ... data every time
// handle motor is called.
public JRecordRoute recordRoute;
// returns current speed in Km/H
public float CurrentSpeed {
get { return rigidbody.velocity.magnitude * 3.6f; }
}
public int CurrentGear {
get { return currentGear; }
}
public float MotorRPM {
get { return motorRPM; }
}
public bool MotorRunning {
get { return audioSource.isPlaying; }
}
public float TotalDistance {
get { return totaldist; }
}
public Transform wheelFR; // connect to Front Right Wheel transform
public Transform wheelFL; // connect to Front Left Wheel transform
public Transform wheelBR; // connect to Back Right Wheel transform
public Transform wheelBL; // connect to Back Left Wheel transform
// power curves (power1 is for gear 1 and reverse!)
// horizontal axis is RPM
// vertical axis is power where 5000f equals to 100%
// (you can go over 5000f if you want but for easier tuning it‘s probably
// better to adjust the torque parameter and keep the curve below 5000f.)
// the default values are totally useless so you have to edit the curves
// you can do this by adding CurveEditor.cs and ResponseCurveEditor.cs to
// your project (in Editor directory of JCar or in the Animation-API example).
// the best way to set curves is steep increase with top at 2000RPM then
// slow decrease back to 0 at h
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-02-26 18:13 Unity3D开发的简单赛车游戏\
目录 0 2019-02-26 18:21 Unity3D开发的简单赛车游戏\greenCar\
文件 6148 2008-08-21 09:20 Unity3D开发的简单赛车游戏\greenCar\.DS_Store
目录 0 2019-02-26 18:15 Unity3D开发的简单赛车游戏\greenCar\Assets\
文件 6148 2008-08-14 15:32 Unity3D开发的简单赛车游戏\greenCar\Assets\.DS_Store
目录 0 2019-02-26 18:15 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\
文件 6148 2008-08-17 15:58 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\.DS_Store
文件 28689 2008-08-20 13:32 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Car.jas
文件 2035 2019-02-26 18:15 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Car.jas.me
文件 107411 2008-08-12 12:17 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Car.png
文件 1430 2019-02-26 18:15 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Car.png.me
文件 7299 2008-08-19 21:33 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\DirectionDisplay.jas
文件 1874 2019-02-26 18:15 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\DirectionDisplay.jas.me
目录 0 2019-02-26 18:15 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials\
文件 3654 2008-08-14 15:29 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials\Car Black Color.mat
文件 161 2019-02-26 18:15 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials\Car Black Color.mat.me
文件 3727 2008-08-14 16:53 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials\Car.mat
文件 161 2019-02-26 18:15 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials\Car.mat.me
文件 3654 2008-08-14 20:36 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials\GhostCar Black Color.mat
文件 161 2019-02-26 18:15 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials\GhostCar Black Color.mat.me
文件 3735 2008-08-14 16:55 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials\GhostCar.mat
文件 161 2019-02-26 18:15 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials\GhostCar.mat.me
文件 3646 2008-08-20 14:32 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials\car-b h 01.mat
文件 161 2019-02-26 18:15 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials\car-b h 01.mat.me
文件 3809 2008-08-12 16:14 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials\dials.mat
文件 161 2019-02-26 18:15 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials\dials.mat.me
文件 3646 2008-08-12 16:15 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials\speedometer.mat
文件 161 2019-02-26 18:15 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials\speedometer.mat.me
文件 150 2019-02-26 18:15 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\Materials.me
文件 48106 2008-08-19 14:03 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\RPM.jas
文件 1948 2019-02-26 18:15 Unity3D开发的简单赛车游戏\greenCar\Assets\Car\RPM.jas.me
............此处省略1016个文件信息
相关资源
- WPF USB 网络 串口 通信软件
- B/S 网上订餐系统
- 教室管理系统.rar
- 小鸡快跑游戏.
-
分别适用于.NET fr
amework 2.0和4.0的E - Unity3D登录界面工程
- 汽车租赁系统............................
- 德卡D8读写器关于读写感应卡的一些代
- halcon 测量助手
- unity3d反编译工具
- 图片存储到数据库保存二进制文件并
- 用Socket写的简易FTP服务器和客户端
- 企业销售管理信息系统(全套)
- 串口操作类(justinio)
- 基于Petri网的工作流(完整的原创源代
- 选择题自动考试系统
- 多线程实例:桌面智能弹球小游戏
-
UnityWebPla
yerFull - 土地信息管理系统
- ServiceStack V3.9 全部dll
- PDF pdfview.ocx 无水印
- Unity纪念碑谷.rar
- Unity3d实现扭动挤压浏览效果
- 无需共享打印机实现远程打印功能小
- unity案例入门坦克大战源码
- Unity3D游戏开发.pdf 宣雨松著完整高清
- Unity3D版水果忍者
- unity3d爆炸特效包
- unity3d_见缝插针源码及报告.zip
- 真正的破解版PDFView4NET
评论
共有 条评论