예제 #1
0
 void Update()
 {
     cu   = GetComponent <movimento>();
     lado = cu.lado;
     if (Input.GetKeyDown(KeyCode.Mouse1))
     {
         if (lado == true)
         {
             Instantiate(tir, r.transform.position, Quaternion.identity);
         }
         if (lado == false)
         {
             Instantiate(til, l.transform.position, Quaternion.identity);
         }
     }
 }
예제 #2
0
 // Start is called before the first frame update
 void Start()
 {
     script = transform.parent.GetComponent <movimento> ();
 }