This commit is contained in:
corn
2026-06-07 22:59:32 +08:00
commit a62ff7379b
7171 changed files with 10015624 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections;
using System.Collections.Generic;
//using Unity.VisualScripting;
using UnityEngine;
public class Finish : MonoBehaviour
{
public static Finish instance;
public ParticleSystem blast;
private void Awake()
{
instance = this;
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.CompareTag("CUBE"))
{
GameManager.instance.donecount++;
if (other.gameObject.GetComponentInChildren<Rigidbody>().isKinematic == true)
{
other.gameObject.GetComponentInChildren<Rigidbody>().isKinematic = false;
}
Destroy(other.gameObject.GetComponent<Rigidbody2D>());
Destroy(other.gameObject.GetComponent<PolygonCollider2D>());
}
}
}