Пример #1
0
 void Update()
 {
     //Movimiento en x
     Mario = GameObject.FindObjectOfType <MarioBross>();
     if (Mario.inputX == 1f)
     {
         velX = -0.05f;
     }
     //
     movX = transform.position.x + (-velX);
     transform.position = new Vector3(movX, transform.position.y, 0);
     tiempo             = tiempo + Time.deltaTime;
     if (tiempo.ToString("f0") == "3")
     {
         Destroy(gameObject);
         tiempo = 0.0f;
     }
 }
Пример #2
0
 // Update is called once per frame
 void Update()
 {
     Mario = GameObject.FindObjectOfType <MarioBross>();
 }