Ejemplo n.º 1
0
 public void CreateTube(int[] x, TubeController tb)
 {
     for (int i = 0; i < 8; i = i + 2)
     {
         tb.AddPosition(FieldController.instance.GetPermanentPosition(x [i], x [i + 1]));
         if (tb.Equals(tb1))
         {
             tb.SetTubeThickness(1);
         }
     }
 }
Ejemplo n.º 2
0
    void Update()
    {
        float step = speed * Time.deltaTime;

        /*if (target != null && !transform.position.Equals(target.position)) {
         *      transform.position = Vector3.MoveTowards (transform.position, target.position, step);
         * }
         */
        Rigidbody      rb = GetComponent <Rigidbody>();
        SphereCollider sc = GetComponent <SphereCollider> ();

        if ((_bullseye != null) && (((float)_bullseye.position.x - (float)transform.position.x) < 6.5) && (((float)_bullseye.position.x - (float)transform.position.x) > 0))
        {
            rb.velocity        = Vector3.zero;
            rb.angularVelocity = Vector3.zero;
            if ((sc != null) && sc.enabled.Equals(false))
            {
                sc.enabled = true;
            }
            if (lastPass.Equals("Goal"))
            {
                //	transform.position = new Vector3 (-144.7f, 11.22563f, -0.6000003f);

                //	//score goal animation
                //	AudioSource cheerAudio =GameObject.Find("Cheer").GetComponent<AudioSource>();
                //	cheerAudio.Play ();
                //	GameObject.FindGameObjectWithTag ("GoalText").GetComponent<ParticleSystem> ().Play ();
                tb.AddPosition(FieldController.instance.GetAbsolutePosition(0, 0));
                for (int i = 0; i < 10; ++i)
                {
                    if (tubeOptions [i, 0] == 0 && tubeOptions [i, 1] == 0)
                    {
                        break;
                    }
                    tb.AddPosition(FieldController.instance.GetAbsolutePosition(tubeOptions [i, 0], tubeOptions [i, 1]));
                }
                tubeOptions = new int[10, 2];


                lastPass = "******";
            }
            //} else if (lastPass.Equals ("OpponentGoal")) {
            //	transform.position = new Vector3 (-144.7f, 11.22563f, -0.6000003f);

            //	//score goal animation
            //	AudioSource booAudio = GameObject.Find("Boo").GetComponent<AudioSource>();
            //	booAudio.Play();
            //	//GameObject.FindGameObjectWithTag ("GoalText").GetComponent<ParticleSystem> ().Play();

            //	lastPass = "******";
            //}

            //	//function to display vector notation
            if (!printed)
            {
                script.convertResultToVector(message, result);
                printed = true;
            }

            //transform.position = _bullseye.position;
        }
    }