UI update 02
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace KD.Destro2D{
|
||||
public class BasicMissile : MonoBehaviour
|
||||
{
|
||||
public GameObject DestructionObject;
|
||||
public GameObject effect;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
Destroy(this.gameObject,4f);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OnCollisionEnter2D(Collision2D collision)
|
||||
{
|
||||
Vector2 hitPoint = collision.contacts[0].point;
|
||||
if(this!= null){
|
||||
Instantiate(DestructionObject,hitPoint,Quaternion.identity);
|
||||
Instantiate(effect,hitPoint,Quaternion.identity);
|
||||
Destroy(this.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user