Created
March 19, 2021 08:10
-
-
Save lokeshsuryan/a69bb2495c3c61b2cae2d6607912a065 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine.SceneManagement; | |
using UnityEngine; | |
using UnityEditor; | |
using HuaweiService; | |
using HuaweiService.ads; | |
public class Die : MonoBehaviour | |
{ | |
public GameObject Bird; | |
public GameObject Pattern; | |
private void OnCollisionEnter2D(Collision2D collision2D){ | |
if(collision2D.collider.tag == "Ground"){ | |
Destroy(); | |
} | |
} | |
public void ShowDialog(){ | |
SceneManager.LoadScene(SceneManager.GetActiveScene().name); // loads current scene | |
} | |
private void Destroy(){ | |
Destroy(Bird); | |
Instantiate(Pattern,transform.position,Quaternion.identity); | |
FindObjectOfType<Projecttile>().ScoreUp(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment