Example #1
0
    private void Awake()
    {
        if (instancia != null)
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(this.gameObject);
        instancia = this;
    }
Example #2
0
    void Start()
    {
        puntos       = FindObjectOfType <GuardarPuntos>();
        textPj1.text = "$" + puntos.puntosP1;
        textPj2.text = "$" + puntos.puntosP2;

        Destroy(puntos.gameObject, 0.33f);
        if (puntos.puntosP1 > puntos.puntosP2)
        {
            imagenGanadores[0].SetActive(true);
            imagenGanadores[1].SetActive(false);
        }
        else
        {
            imagenGanadores[0].SetActive(false);
            imagenGanadores[1].SetActive(true);
        }
    }