Beispiel #1
0
    void Start()
    {
        rb           = GetComponentInChildren <Rigidbody> ();
        rb.velocity += transform.forward * speed;

        trackInformer = GameObject.Find("TrackInformer").GetComponent <TrackInformer>();
        TrackInformer.TrackInfo trackInfo = trackInformer.GetTrackInfo(transform.position, transform.right, transform.up, 100f);
        height = Mathf.Max(trackInfo.distanceToGround, 1.0f);

        AudioSource.PlayClipAtPoint(laserSound, transform.position);

        if (originShip.name == "Victor")
        {
            GetComponentInChildren <Light>().color = Color.red;
        }
        if (originShip.name == "Oscar")
        {
            GetComponentInChildren <Light>().color = Color.green;
        }
        if (originShip.name == "Cristina")
        {
            GetComponentInChildren <Light>().color = Color.magenta;
        }
        if (originShip.name == "Sanic")
        {
            GetComponentInChildren <Light>().color = Color.blue;
        }

        Destroy(gameObject, 5f);
    }
Beispiel #2
0
 new void Start()
 {
     base.Start();
     trackInformer = GameObject.Find("TrackInformer").GetComponent <TrackInformer>();
     timer         = gameObject.AddComponent <Timer> ();
 }
Beispiel #3
0
 void Start()
 {
     rb            = GetComponent <Rigidbody> ();
     model         = transform.FindChild("ModelWrapper/ModelTilter").gameObject;
     trackInformer = GameObject.Find("TrackInformer").GetComponent <TrackInformer>();
 }