#pragma strict
function Start ()
{
Destroy(gameObject,3.0);
}
#pragma strict
function Start () {
}
var speed : int = 5;
var newobject : Transform;
var sdshu:int=0;
var xmshu:int=0;
function Update ()
{
var x :float = Input.GetAxis("Horizontal")*Time.deltaTime*speed;
var z :float = Input.GetAxis("Vertical")*Time.deltaTime*speed;
transform.Translate(x,0,z);
//print(x);
if(Input.GetButton("Fire1"))
{
var n:Transform = Instantiate(newobject,transform.position,transform.rotation);
var fwd: Vector3 = transform.TransformDirection(Vector3.forward);
n.rigidbody.AddForce(fwd*2800);
sdshu++;
gameObject.Find("zt").GetComponent(GUIText).text="射弹数:"+sdshu+" XiaoMianShu:"+xmshu;
}
if(Input.GetKey(KeyCode.Q))
{
transform.Rotate(0,-25*Time.deltaTime,0,Space.Self);
}
if(Input.GetKey(KeyCode.E))
{
transform.Rotate(0,25*Time.deltaTime,0,Space.Self);
}
if(Input.GetKey(KeyCode.Z))
{
transform.Rotate(-25*Time.deltaTime,0,0,Space.Self);
}
if(Input.GetKey(KeyCode.C))
{
transform.Rotate(25*Time.deltaTime,0,0,Space.Self);
}
if(Input.GetKey(KeyCode.H))
{
transform.Translate(0,5*Time.deltaTime,0);
}
if(Input.GetKey(KeyCode.N))
{
transform.Translate(0,-5*Time.deltaTime,0);
}
}
#pragma strict
function Start () {
}
function Update () {
}
function OnGUI()
{
if(GUI.Button(Rect(180,100,60,30),"tui chu"))
{
Application.Quit();
}
if(GUI.Button(Rect(280,100,60,30),"chong xin kai shi"))
{
Application.Quit();
Application.LoadLevel("Untitled");
}
if(GUI.Button(Rect(10,160,100,50),"Play"))
{
audio.Play();
}
if(GUI.Button(Rect(10,220,100,50),"Pause"))
{
audio.Pause();
}
if(GUI.Button(Rect(10,280,100,50),"Stop"))
{
audio.Stop();
}
}
#pragma strict
function Start () {
}
var sd:int;
var xm:int;
function Update ()
{
if(gameObject.transform.position.y<0){
//Transform.Find("Main Camera").GetComponent("sheji").xmshu++;
xm = gameObject.Find("Main Camera").GetComponent(sheji).xmshu++;
sd = gameObject.Find("Main Camera").GetComponent(sheji).sdshu;
gameObject.Find("zt").GetComponent(GUIText).text="射弹数:"+sd+" 消灭数:"+xm;
if(xm>16)
{
gameObject.Find("zt").GetComponent(GUIText).text="恭喜成功了";
gameObject.Find("Main Camera").GetComponent(sheji).enabled=false;
gameObject.Find("dimian").GetComponent(restart).enabled = true;
print("win");
}
Destroy(gameObject);
}
}
#pragma strict
function Start () {
}
function Update () {
}
function OnCollisionEnter()
{
gameObject.Find("zt").GetComponent(GUIText).text="aabbccddeeff";
gameObject.Find("Directional light").GetComponent(Light).enabled = false;
Destroy(gameObject);
}