// Update is called once per frame
    void Update()
    {
        Vector3 posicion = transform.position;

        if (canCreate == true) //Es posile rear el Objeto?
        {
            GameObject clon       = Instantiate(ObjClonar[Random.Range(0, ObjClonar.Length)], posicion, Quaternion.identity);
            Renderer   clonRedner = clon.GetComponent <Renderer>();
            Rigidbody  clonBody   = clon.GetComponent <Rigidbody>();
            bulletMove = clon.GetComponent <MovementBadBullet>(); //Tomar el scrip de movimiento para la botella

            canCreate = false;                                    //Desactivar el Create
        }



        /* time += Time.deltaTime;  //Conteo del tiempo
         *
         * if (time >= timeCreate) //Ya es tiempo de crear?
         * {
         *   time = 0; //Reiniciar el tiempo
         *   timeCreate = Random.Range(minValCreate, maxValCreate); //Escoger otro tiempo
         *   canCreate = true; //Re-Activar el Create
         * }
         *
         */
    }
Example #2
0
 // Use this for initialization
 void Start()
 {
     Movimiento_Zorro = GameObject.FindObjectOfType <MovementFox>();
     musica           = GameObject.FindObjectOfType <Musica>();
     moveMalas        = GameObject.FindObjectOfType <MovementBadBullet>();
 }
Example #3
0
 // Use this for initialization
 void Start()
 {
     rb      = GetComponent <Rigidbody2D>();
     botella = FindObjectOfType <MovementBadBullet>();
 }