//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); }
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); } }