public void Init(TileManager.TYPE _type, int _num) { Number = _num; Type = _type; Reverse = TileManager.REVERS.DEFAULT; Rotaion = TileManager.ROTATION.DEFAULT; Name = TileManager.GetTileName(Type, Number); }
/// <summary> /// Set tile button. /// </summary> /// <param name="_type">Tile type.</param> private void SetTileButton(TileManager.TYPE _type) { int maxNum = TileManager.GetMaxNumber(_type); for (int i = 0; i < maxNum; i++) { var tileInstance = Instantiate(tileButton) as GameObject; var tileComponent = tileInstance.GetComponent <TileMenu.TileSelectButton>(); tileComponent.SetParent(this.gameObject); tileComponent.InitTile(_type, i); tileMenuGrid.repositionNow = true; tileInstance.transform.SetParent(tileMenuGrid.transform, false); tileButtons.Add(tileInstance); } }
public void InitTile(TileManager.TYPE _type, int _num) { TileInfo = new Tile(); TileInfo.Init(_type, _num); }