当前位置:首页 » 编程软件 » 汽车脚本

汽车脚本

发布时间: 2022-02-05 17:58:38

‘壹’ 求一个汽车轮胎广告创意脚本

可以做一个FLASH的东西

‘贰’ unity3d里的car脚本在哪里

是官网的那个赛车的例子吗?汽车上不是绑定了吗?其实在工程窗口,直接搜cs或者js脚本类型,所有脚本都出来了...

‘叁’ flash脚本翻译 汽车颜色

先整体说一下,这个是AS2.0编写的程序,舞台上有4个按钮,每个按钮点击后会改变名为car_mc对象的颜色。

import flash.geom.ColorTransform;
//导入ColorTransform类,这个类在 flash.geom包中。

import flash.geom.Transform;
//类似上面语句

var colorTrans:ColorTransform = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
//新建一个名为colorTrans的ColorTransform 对象,因为一开始引入了这个类,所以可以不用再指定路径,这条语句可以直接写成:
var colorTrans:ColorTransform = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
参数的意义分别是(红色乘数值、绿色乘数值、蓝色乘数值、alpha透明度乘数值、红色通道偏移量、绿色通道偏移量、蓝色通道偏移量),这里的参数设置和默认值一摸一样,表示,你以后给他赋有关颜色透明度的值的时候,赋什么样显示的就是什么样,没特别的效果。于是他可以进一步简写为:
var colorTrans:ColorTransform = new ColorTransform();

var trans:Transform = new flash.geom.Transform(car_mc);
//新建一个名为trans的Transform 对象,并附加到名为car_mc的影片剪辑。就是说以后改变trans,就会改变car_mc的transform 属性。同样因为一开始导入了这个类,可以直接写作:
var trans:Transform = new Transform(car_mc);

trans.colorTransform = colorTrans;
//将创建好的colorTrans赋给trans的colorTransform属性。但其实这条语句在这里没什么用,完全可以删去。

blue_btn.onRelease = function(){
//给名为blue_btn的按钮添加一个onRelease(点击)事件,就是说点击这个按钮后会触发这个事件,这个事件是什么呢?就是{}里的、下面的这些语句。

colorTrans.rgb = 0x333399;
//给colorTrans的属性rgb赋值,0x333399是16进制显示的数,从0x后开始,每两位分别表示:红(r)、绿(g)、蓝(b)。

trans.colorTransform = colorTrans;
//将更改过的colorTrans赋值给trans的colorTransform 属性,因为前面附加过了,那么car_mc的transform 属性也被改变了,最后的结果就是car_mc的颜色变成了0x333399
};

//后面的都一样,就不重复了哦

//最后,把简略了点的程序贴上了~
import flash.geom.ColorTransform;
import flash.geom.Transform;
var colorTrans:ColorTransform = new ColorTransform();
var trans:Transform = new Transform(car_mc);
blue_btn.onRelease = function(){
colorTrans.rgb = 0x333399;
trans.colorTransform = colorTrans;
};
red_btn.onRelease = function() {
colorTrans.rgb = 0xFF0000;
trans.colorTransform = colorTrans;
};
black_btn.onRelease = function() {
colorTrans.rgb = 0x000000;
trans.colorTransform = colorTrans;
};
green_btn.onRelease = function() {
colorTrans.rgb = 0x006600;
trans.colorTransform = colorTrans;
};

‘肆’ 求由我世界汽车脚本

脚本都是自己编的
只要自己编出来什么样子的都可能,不违反规定和限制的都行,
不是很清楚你说的汽车脚本具体是做什么的脚本

‘伍’ 以亲情为主的汽车广告脚本

一份从天而降的遗产打破了赵小宇简单而快乐的生活,她的生活轨迹发生了天翻地覆的变化,特殊的身份招来了至爱亲朋的非议和嫉妒,一群血缘相关的亲人为了遗产猜忌争斗。

‘陆’ 汽车脚本创作理念怎么写

摘要 亲你好,我帮你用图片表格的形式给你整理出来,希望你能满意。

‘柒’ 求一段unity3D汽车自动驾驶的脚本代码

1、把脚本直接连到汽车车身网格上,车身要有Rigidbody Component,要有四个轮子网格做子物体。 要想有声音的话还要有AudioSource Component。

2、打开Inspector,选择汽车脚本,把四个轮子连接到相对应的Transform参数上。设置wheelRadius参数为你轮子网格的大小。WheelCollider是自动生成的,所以无需手动添加。这样就能保证运行了,其他的声音和灰尘可以再添加。

脚本源代码如下:*/
#pragma strict
//maximal corner and braking acceleration capabilities
var maxCornerAccel=10.0;
var maxBrakeAccel=10.0;
//center of gravity height - effects tilting in corners
var cogY = 0.0;
//engine powerband
var minRPM = 700;
var maxRPM = 6000;
//maximum Engine Torque
var maxTorque = 400;
//automatic transmission shift points
var shiftDownRPM = 2500;
var shiftUpRPM = 5500;
//gear ratios
var gearRatios = [-2.66, 2.66, 1.78, 1.30, 1.00];
var finalDriveRatio = 3.4;
//a basic handling modifier:
//1.0 understeer
//0.0 oversteer
var handlingTendency = 0.7;
//graphical wheel objects
var wheelFR : Transform;
var wheelFL : Transform;
var wheelBR : Transform;
var wheelBL : Transform;
//suspension setup
var suspensionDistance = 0.3;
var springs = 1000;
var dampers = 200;
var wheelRadius = 0.45;
//particle effect for ground st
var groundDustEffect : Transform;
private var queryUserInput = true;
private var engineRPM : float;
private var steerVelo = 0.0;
private var brake = 0.0;
private var handbrake = 0.0;
private var steer = 0.0;
private var motor = 0.0;
//private var skidTime = 0.0;
private var onGround = false;
private var cornerSlip = 0.0;
private var driveSlip = 0.0;
private var wheelRPM : float;
private var gear = 1;
//private var skidmarks : Skidmarks;
private var wheels : WheelData[];
private var wheelY = 0.0;
private var rev = 0.0;
//Functions to be used by external scripts
//controlling the car if required
//===================================================================
//return a status string for the vehicle
function GetStatus(gui : GUIText) {
gui.text="v="+(rigidbody.velocity.magnitude * 3.6).ToString("f1") km/h\ngear= "+gear+"\nrpm= "+engineRPM.ToString("f0");
}
//return an information string for the vehicle
function GetControlString(gui : GUIText) {
gui.text="Use arrow keys to control the jeep,\nspace for handbrake."; }
//Enable or disable user controls
function SetEnableUserInput(enableInput)
{
queryUserInput=enableInput;
}
//Car physics
//===================================================================
//some whee calculation data
class WheelData{ + "
var rotation = 0.0;
var coll : WheelCollider;
var graphic : Transform;
var maxSteerAngle = 0.0;
var lastSkidMark = -1;
var powered = false;
var handbraked = false;
var originalRotation : Quaternion;
};
function Start () {
//setup wheels
wheels=new WheelData[4];
for(i=0;i<4;i++)
wheels[i] = new WheelData();

wheels[0].graphic = wheelFL;
wheels[1].graphic = wheelFR;
wheels[2].graphic = wheelBL;
wheels[3].graphic = wheelBR;
wheels[0].maxSteerAngle=30.0;
wheels[1].maxSteerAngle=30.0;
wheels[2].powered=true;
wheels[3].powered=true;
wheels[2].handbraked=true;
wheels[3].handbraked=true;
for(w in wheels)
{
if(w.graphic==null)
Debug.Log("You need to assign all four wheels for the car script!"); if(!w.graphic.transform.IsChildOf(transform))
Debug.Log("Wheels need to be children of the Object with the car script");
w.originalRotation = w.graphic.localRotation;
//create collider
colliderObject = new GameObject("WheelCollider");
colliderObject.transform.parent = transform;
colliderObject.transform.position = w.graphic.position;
w.coll = colliderObject.AddComponent(WheelCollider);
w.coll.suspensionDistance = suspensionDistance;
w.coll.suspensionSpring.spring = springs;
w.coll.suspensionSpring.damper = dampers;
//no grip, as we simulate handling ourselves
w.coll.forwardFriction.stiffness = 0;
w.coll.sidewaysFriction.stiffness = 0;
w.coll.radius = wheelRadius;
}
//get wheel height (height forces are applied on)
wheelY=wheels[0].graphic.localPosition.y;

//setup center of gravity
rigidbody.centerOfMass.y = cogY;

//find skidmark object
// skidmarks = FindObjectOfType(typeof(Skidmarks));

//shift to first
gear=1;
}
//update wheel status
function UpdateWheels()
{
//calculate handbrake slip for traction gfx
handbrakeSlip=handbrake*rigidbody.velocity.magnitude*0.1;
if(handbrakeSlip>1)
handbrakeSlip=1;

totalSlip=0.0;
onGround=false;
for(w in wheels)
{
//rotate wheel
w.rotation += wheelRPM / 60.0 * -rev * 360.0 * Time.fixedDeltaTime; w.rotation = Mathf.Repeat(w.rotation, 360.0);
w.graphic.localRotation= Quaternion.Euler( w.rotation, w.maxSteerAngle*steer, 0.0 ) * w.originalRotation;
//check if wheel is on ground
if(w.coll.isGrounded)
onGround=true;

slip = cornerSlip+(w.powered?driveSlip:0.0)+(w.handbraked?handbrakeSlip:0.0); totalSlip += slip;

var hit : WheelHit;
var c : WheelCollider;
c = w.coll;
if(c.GetGroundHit(hit))
{
//if the wheel touches the ground, adjust graphical wheel position to reflect springs

w.graphic.localPosition.y-=Vector3.Dot(w.graphic.position-hit.point,transform.up)-w.coll.radius;

//create st on ground if appropiate
if(slip>0.5 && hit.collider.tag=="Dusty")
{
groundDustEffect.position=hit.point;

groundDustEffect.particleEmitter.worldVelocity=rigidbody.velocity*0.5; groundDustEffect.particleEmitter.minEmission=(slip-0.5)*3; groundDustEffect.particleEmitter.maxEmission=(slip-0.5)*3;
groundDustEffect.particleEmitter.Emit(); }

//and skid marks
/*if(slip>0.75 && skidmarks != null)

w.lastSkidMark=skidmarks.AddSkidMark(hit.point,hit.normal,(slip-0.75)*2,w.lastSkidMark);
else
w.lastSkidMark=-1; */
}
// else w.lastSkidMark=-1;
}
totalSlip/=wheels.length;
}
//Automatically shift gears
function AutomaticTransmission()
{
if(gear>0)
{
if(engineRPM>shiftUpRPM&&gear<gearRatios.length-1)
gear++;
if(engineRPM<shiftDownRPM&&gear>1)
gear--;
}
}
//Calculate engine acceleration force for current RPM and trottle
function CalcEngine() : float
{
if(brake+handbrake>0.;motor=0.0;;//ifcarisairborne,justre;if(!onGround);engineRPM+=(motor-0.3)*2;engineRPM=Mathf.Clamp(en;return0.0;;else;AutomaticTransmission();;engineRPM=whee
if(brake+handbrake>0.1)

motor=0.0;

//if car is airborne, just rev engine

if(!onGround)

{

engineRPM += (motor-0.3)*25000.0*Time.deltaTime;

engineRPM = Mathf.Clamp(engineRPM,minRPM,maxRPM);

return 0.0;

}

else

{

AutomaticTransmission();

engineRPM=wheelRPM*gearRatios[gear]*finalDriveRatio;

if(engineRPM<minRPM)

engineRPM=minRPM;

if(engineRPM<maxRPM)

{

//fake a basic torque curve

x = (2*(engineRPM/maxRPM)-1);

torqueCurve = 0.5*(-x*x+2);

torqueToForceRatio = gearRatios[gear]*finalDriveRatio/wheelRadius; return
motor*maxTorque*torqueCurve*torqueToForceRatio;

}

else

//rpm delimiter

return 0.0;

}

}

//Car physics

//The physics of this car are really a trial-and-error based extension of
//basic "Asteriods" physics -- so you will get a pretty arcade-like feel. //This
may or may not be what you want, for a more physical approach research //the
wheel colliders

function HandlePhysics () {

var velo=rigidbody.velocity;

wheelRPM=velo.magnitude*60.0*0.5;

rigidbody.angularVelocity=new

Vector3(rigidbody.angularVelocity.x,0.0,rigidbody.angularVelocity.z);
dir=transform.TransformDirection(Vector3.forward);

flatDir=Vector3.Normalize(new Vector3(dir.x,0,dir.z));

flatVelo=new Vector3(velo.x,0,velo.z);

rev=Mathf.Sign(Vector3.Dot(flatVelo,flatDir));

//when moving backwards or standing and brake is pressed, switch to
reverse

if((rev<0||flatVelo.sqrMagnitude<0.5)&&brake>0.1)

gear=0;

if(gear==0)

{

//when in reverse, flip brake and gas

tmp=brake;

brake=motor;

motor=tmp;

//when moving forward or standing and gas is pressed, switch to drive
if((rev>0||flatVelo.sqrMagnitude<0.5)&&brake>0.1)

gear=1;

}

engineForce=flatDir*CalcEngine();

totalbrake=brake+handbrake*0.5;

if(totalbrake>1.0)totalbrake=1.0;

brakeForce=-flatVelo.normalized*totalbrake*rigidbody.mass*maxBrakeAccel;
flatDir*=flatVelo.magnitude;

flatDir=Quaternion.AngleAxis(steer*30.0,Vector3.up)*flatDir;

flatDir*=rev;

diff=(flatVelo-flatDir).magnitude;

cornerAccel=maxCornerAccel;

if(cornerAccel>diff)cornerAccel=diff;

cornerForce=-(flatVelo-flatDir).normalized*cornerAccel*rigidbody.mass;
cornerSlip=Mathf.Pow(cornerAccel/maxCornerAccel,3);

rigidbody.AddForceAtPosition(brakeForce+engineForce+cornerForce,transform.position+transform.up*wheelY);

handbrakeFactor=1+handbrake*4;

if(rev<0)

handbrakeFactor=1;

veloSteer=((15/(2*velo.magnitude+1))+1)*handbrakeFactor;

steerGrip=(1-handlingTendency*cornerSlip);

if(rev*steer*steerVelo<0)

steerGrip=1;

maxRotSteer=2*Time.fixedDeltaTime*handbrakeFactor*steerGrip;

fVelo=velo.magnitude;

veloFactor=fVelo<1.0?fVelo:Mathf.Pow(velo.magnitude,0.3);

steerVeloInput=rev*steer*veloFactor*0.5*Time.fixedDeltaTime*handbrakeFactor;
if(velo.magnitude<0.1)

steerVeloInput=0;

if(steerVeloInput>steerVelo)

{

steerVelo+=0.02*Time.fixedDeltaTime*veloSteer;

if(steerVeloInput<steerVelo)

steerVelo=steerVeloInput;

}

else

{

steerVelo-=0.02*Time.fixedDeltaTime*veloSteer;

if(steerVeloInput>steerVelo)

steerVelo=steerVeloInput;

}

steerVelo=Mathf.Clamp(steerVelo,-maxRotSteer,maxRotSteer);
transform.Rotate(Vector3.up*steerVelo*57.295788);

}

function FixedUpdate () {

//query input axes if necessarry

if(queryUserInput)

{

brake = Mathf.Clamp01(-Input.GetAxis("Vertical"));

handbrake = Input.GetButton("Jump")?1.0:0.0;

steer = Input.GetAxis("Horizontal");

motor = Mathf.Clamp01(Input.GetAxis("Vertical"));

}

else

{

motor = 0;

steer = 0;

brake = 0;

handbrake = 0;

}

//if car is on ground calculate handling, otherwise just rev the engine
if(onGround)

HandlePhysics();

else

CalcEngine();

//wheel GFX

UpdateWheels();

//engine sounds

audio.pitch=0.5+0.2*motor+0.8*engineRPM/maxRPM;

audio.volume=0.5+0.8*motor+0.2*engineRPM/maxRPM;

}

//Called by DamageReceiver if boat destroyed

function Detonate()

{

//destroy wheels

for( w in wheels )

w.coll.gameObject.active=false; //no more car physics

enabled=false;

}

‘捌’ 各位大神 可否知道:http://www.qq.com/ 网页右下弹出的大众汽车广告的脚本哪里下载得到啊!

没发现有大众的广告,
其实这些脚本,你可以直接查看网页的源文件,,里面就能找到

‘玖’ Unity通过键盘控制汽车移动的脚本

privateGameObject_Car;
privatefloat_Speed=100;

voidStart(){
_Car=Instantiate(Resources.Load("实例化物体名"))asGameObject;

}

voidUpdate(){
if(Input.GetKeyDown(KeyCode.W))
{
_Car.transform.Translate(Vector3.forward*_Speed*Time.deltaTime);
}

if(Input.GetKeyDown(KeyCode.S))
{
_Car.transform.Translate(-Vector3.forward*_Speed*Time.deltaTime);
}

if(Input.GetKeyDown(KeyCode.A))
{
_Car.transform.Translate(Vector3.left*_Speed*Time.deltaTime);
}

if(Input.GetKeyDown(KeyCode.D))
{
_Car.transform.Translate(Vector3.right*_Speed*Time.deltaTime);
}
}

‘拾’ 触摸精灵lua 赛车脚本帮忙修正

我搜了一下这个东西发现还挺有趣的~

我之前没接触过这个东西,也不知道你这个游戏是什么游戏,所以我说的可能有点问题,LZ可以一起探讨。

我觉得你这个逻辑可能有点小问题存在的。

你首先按下900ms然后松开,你是想让车加速到一定时间对吗?

然后现在开始了。首先你获取了当前的状态。然后比较这个状态是否正确。

那么第一个问题,这个状态判断我有些奇怪是什么意思。照我看似乎是达到你需要的速度的状态了?那么应该松开,而不是加速吧?

然后用等于的简单判断让我有点警惕,一般来说速度控制有两种情况,超速、低速。这两种情况可能应该需要一并考虑才比较合理。



我的想法有很多,但是不知道具体的需求,也不敢妄下结论,就先列出一个吧。

python">--@params:车当前状态,true为加速,false为减速
functionrunning(s)
localstatus=s
--@paramspeed:1为超速,0为低速(我不知道是否有等于这个速度的情况,如果有请传入1、0以外的速度)
returnfunction(speed)
ifspeed==1then--如果超速
ifstatusthen
status=false
touchUp(0)
end
elseifspeed==0then--如果慢速
ifnotstatusthen
status=true
touchDown(0,531,1518)
end
end
end
end

functionmain()
--前面照旧
whiletruethen
localcontrol=running(false)
localspeed=..经过你的判断,它是超速还是慢速
control(speed)
sleep(500)--加入适当的延迟
end
end
热点内容
linuxsvn配置 发布:2025-01-08 12:19:11 浏览:376
苹果扁头耳机如何在安卓手机上用 发布:2025-01-08 12:17:37 浏览:105
为什么解绑卡还要密码 发布:2025-01-08 12:13:51 浏览:69
反编译得到源代码的比例 发布:2025-01-08 12:12:36 浏览:619
苹果手机7z怎么解压 发布:2025-01-08 12:11:55 浏览:119
租用的云服务器还需要流量么 发布:2025-01-08 12:11:30 浏览:584
为什么手游对手机配置要求低 发布:2025-01-08 12:06:53 浏览:212
怎么设置qq邮箱独立密码 发布:2025-01-08 11:58:14 浏览:387
公司建设网站怎么搭建服务器 发布:2025-01-08 11:45:43 浏览:307
dell存储分类 发布:2025-01-08 11:40:02 浏览:715