Skip to content

Instantly share code, notes, and snippets.

@lokeshsuryan
Created March 19, 2021 08:10
Show Gist options
  • Save lokeshsuryan/a69bb2495c3c61b2cae2d6607912a065 to your computer and use it in GitHub Desktop.
Save lokeshsuryan/a69bb2495c3c61b2cae2d6607912a065 to your computer and use it in GitHub Desktop.
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