示例#1
0
 void GenerateAndPlaceTile(Hex hex)
 {
     //check if the tile is already built
         if (hex.hasInstance())
             return;
         //Place the tile
         var instance = (Transform)PrefabUtility.InstantiatePrefab(tileMap.tilePrefab);
         //instance.gameObject.isStatic = true;
         instance.parent = tileMap.transform;
         instance.localPosition = hex.position;
         hex.instance = instance.gameObject;
         defineHexTileType(hex);
         hex.findBuildPosition();
         tileMap.updateHex(hex);
         //instance.localRotation = Quaternion.identity;//*Quaternion.Euler(0, tileMap.directions[index] * 90, 0);
 }