public void OnPlayerCardAdded_Board(RuntimeCard _card, int _count) { //DESTROY THE CARD FROM THE HAND GameObject handCard = CardVisual.FindCardVisual(_card.guid).gameObject; Destroy(handCard); //MAKE NEW CARD CardVisual newCardVisual = Instantiate(GameScene.Active.boardCardPrefab).GetComponent <CardVisual>(); newCardVisual.Init(_card); newCardVisual.transform.position = new Vector3(); //ARRANGE THE CARD //get new position Vector3 newPosition = new Vector3(GameScene.Active.playerBoardCardsStart.transform.position.x + (_count - 1) * 90, GameScene.Active.playerBoardCardsStart.transform.position.y, GameScene.Active.playerBoardCardsStart.transform.position.z); newCardVisual.transform.DOMove(newPosition, .5f); }
private void OnPlayerCardRemoved_Board(RuntimeCard _card, int _count) { CardVisual _visual = CardVisual.FindCardVisual(_card.guid); Destroy(_visual.gameObject); }