void Initialize() { ts = OT.Sprite("tiles-sprite") as OTTilesSprite; // fill the matrix with random tiles ts.FillWithRandomTiles(); // Create new objects and link them to the tiles LinkNewObjects(ts.allTiles); // hook up input event ts.onInput = TilesInput; // keep start position to be used to snap back after scrolling a row psStart = ts.position; // get bottom and top row tsBottomRow = ts.TilesY(0); tsTopRow = ts.TilesY(ts.tileMatrix.y-1); // bottom row starts transparent ts.Alpha(tsBottomRow,0f); // pre-fabricate tile objects OT.PreFabricate("tile",25); // collect animation tiles for quicker lookup GetAnimationTiles(); }
// Use this for initialization void Start() { // find the tilemap object from this scene tilemap = GameObject.Find("TileMap").GetComponent<OTTileMap>(); tilesSprite = OT.Sprite("TilesSprite") as OTTilesSprite; tilesSprite.visible = false; OT.Sprite("cover-h").visible = tilesSprite.visible; OT.Sprite("cover-v").visible = tilesSprite.visible; }