Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Block : MonoBehaviour {
- void OnCollisionEnter()
- {
- this.exists = false;
- }
- void Start()
- {
- BoxCollider bc = gameObject.AddComponent<BoxCollider>();
- //bc.center = transform.position;
- //bc.size = transform.scale;
- }
- public Building building;
- public Vector3 position;
- private bool _exists = true;
- public bool exists
- {
- get {
- return _exists;
- }
- set {
- if (value != _exists) { building.dirty = true; }
- _exists = value;
- if (collider != null)
- {
- collider.isTrigger = !value;
- }
- }
- }
- public BlockNeighbours neighbours = new BlockNeighbours();
- }
Advertisement
Add Comment
Please, Sign In to add comment