Ejemplo n.º 1
0
 void Update()
 {
     if (pressed == true)
     {
         if (camerachanged == false)
         {
             camerachanged = true;
             other.SetTarget(metal);
         }
     }
 }
Ejemplo n.º 2
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.tag == "domino" || gameObject.tag == "ball")
     {
         if (touched == false)
         {
             touched = true;
             other.SetTarget(this.gameObject);
         }
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (pressed == true)
     {
         if (camerachanged == false)
         {
             camerachanged = true;
             other.SetTarget(main);
         }
         distCovered             = (Time.time - start) * 12;
         Distance                = Vector3.Distance(push.transform.position, Target);
         frac                    = distCovered / Distance;
         push.transform.position = Vector3.Lerp(push.transform.position, Target, frac);
     }
     start = Time.time;
 }