Beispiel #1
0
    public void OnPlayerCardAdded_Hand(RuntimeCard _card, int _count)
    {
        CardVisual _cardV = Instantiate(GameScene.Active.playerHandCardPrefab).GetComponent <CardVisual>();

        _cardV.Init(_card);

        //Get the final position
        Vector3 _position = new Vector3(GameScene.Active.playerHandCardsStart.position.x + (90 * (_count - 1)), GameScene.Active.playerHandCardsStart.position.y, GameScene.Active.playerHandCardsStart.position.z);

        _cardV.transform.position = _position;
    }
Beispiel #2
0
    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);
    }