public class GamePlayManager : MonoBehaviour {
public void BirdDiedShowPanel(){
pausePanel.SetActive (true);
scoreText.gameObject.SetActive (false);
gameOverUI.gameObject.SetActive (true);
resumeGameButton.onClick.RemoveAllListeners ();
resumeGameButton.onClick.AddListener(()=>RestartGameButton());
}
}
public class BlueBirdScript : MonoBehaviour {
void OnCollisionEnter2D(Collision2D target){
GamePlayManager t = new GamePlayManager();
if (target.gameObject.tag == "Ground" || target.gameObject.tag == "Pipe") {
if (birdIsAlive) {
birdIsAlive = false;
anim.SetTrigger ("Died");
audioSource.PlayOneShot (diedClip);
GamePlayManager.instance.BirdDiedShowPanel();
t.BirdDiedShowPanel ();
}
}
}
why t.BirdDiedShowPanel error (line 22) ???, I don't understand, please explain it
↧