duck

duck

Nov 29th, 2010
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. public class Block : MonoBehaviour {
  2.  
  3.     void OnCollisionEnter()
  4.     {
  5.         this.exists = false;
  6.        
  7.     }
  8.    
  9.     void Start()
  10.     {
  11.    
  12.         BoxCollider bc = gameObject.AddComponent<BoxCollider>();
  13.         //bc.center = transform.position;
  14.         //bc.size = transform.scale;
  15.     }
  16.    
  17.     public Building building;
  18.     public Vector3 position;
  19.     private bool _exists = true;
  20.     public bool exists
  21.     {
  22.         get {
  23.             return _exists;
  24.         }
  25.         set {
  26.             if (value != _exists) { building.dirty = true; }
  27.             _exists = value;
  28.             if (collider != null)
  29.             {
  30.                 collider.isTrigger = !value;
  31.             }
  32.         }
  33.     }
  34.     public BlockNeighbours neighbours = new BlockNeighbours();
  35.    
  36.    
  37. }
Advertisement
Add Comment
Please, Sign In to add comment