Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- public class Shape : MonoBehaviour {
- public static List<Shape> shapes = new List<Shape>();
- void Start () {
- shapes.Add(this);
- }
- public static DestroyAll()
- {
- foreach (Shape shape in shapes)
- {
- shape.Kill();
- }
- }
- public void Kill()
- {
- // Spawn "destroy" visual effect
- shapes.Remove(this);
- Destroy(gameObject);
- }
- }
Add Comment
Please, Sign In to add comment