Exemple #1
0
 //public obstaclesScripts moveRods;
 // Start is called before the first frame update
 void Start()
 {
     Accessgravity = FindObjectOfType <PlayerController>();
     Quadmove      = FindObjectOfType <scrollingbackground>();
     Pspeed        = FindObjectOfType <parallaxMountain>();
     // PlayButton btn = PlayButton.GetComponent<Button>();
     // btn.onClick.AddListener(PlayGame);
     PlayButton.SetActive(true);
     namebutton.SetActive(true);
     Spawner.gameObject.SetActive(false);
     Panel.gameObject.SetActive(false);
     Backbutton.SetActive(false);
     Restartbutton.SetActive(false);
 }
Exemple #2
0
    public void LiveReduction()
    {
        baseLives -= 1;

        if (baseLives == 3)
        {
            baseMaterial.color = Color.yellow;
        }
        if (baseLives == 1)
        {
            baseMaterial.color = Color.red;
        }
        if (baseLives == 0)
        {
            Instantiate(baseExplosion, this.transform.position, Quaternion.identity);
            Destroy(this.gameObject);
            Gameovertext.SetActive(true);
            Restartbutton.SetActive(true);
        }
    }