예제 #1
0
 // Use this for initialization
 void Start()
 {
     countx = 0;
     //countz = 0;
     currentGrid = "x";
     currentTile = gameObject;
     currentTile.transform.position = transform.position;
     currentcheck    = GetComponent <ConnectorCheck>();
     currentposition = transform.position;
     originPosition  = transform.position;
     length          = compatibleTiles.Count;
 }
예제 #2
0
 public void getCompatability()
 {
     foreach (GameObject t in tiles)
     {
         ccheck = t.transform.GetComponent <ConnectorCheck>();
         if (ccheck.north == currentcheck.south || ccheck.south == currentcheck.north || ccheck.east == currentcheck.west || ccheck.west == currentcheck.east)
         {
             ccheck.isCompatible = true;
         }
     }
     length = 0;
     foreach (GameObject t in tiles)
     {
         ccheck = t.GetComponent <ConnectorCheck>();
         if (ccheck.isCompatible == true)
         {
             length++;
             compatibleTiles.Add(t);
         }
     }
 }