예제 #1
0
    public static GameObject GetCardPrefab(CardManager.Card c)
    {
        if (c.type == CardType.monster)
        {
            return(GameManager.instance.MonsterCardPrefab);
        }


        if (c.type == CardType.treasure)
        {
            return(GameManager.instance.ItemCardPrefab);
        }

        if (c.type == CardType.blessing || c.type == CardType.wrath)
        {
            return(GameManager.instance.BlessingCardPrefab);
        }


        return(GameManager.instance.MonsterCardPrefab);
    }
    public void Show1()
    {
        this.transform.DOLocalMoveY(HideY, 0);
        this.gameObject.SetActive(true);
        CardManager.Card card = Visual.instance.GetCurrentEnemyCard();

        bool showPowerUp = GameLogic.GetPowerUp(card) != 0;

        PowerUpImage.gameObject.SetActive(showPowerUp);
        PowerUpCounter.gameObject.SetActive(showPowerUp);

        CrewCounter.text    = card.crewNumber.ToString();
        MonsterCounter.text = GameLogic.GetCurrentDifficulty(card).ToString();

        if (showPowerUp)
        {
            PowerUpCounter.text = GameLogic.GetPowerUp(card).ToString();
        }

        IconDice.sprite = FlatDiceImages[card.rollResult - 1];

        this.transform.DOLocalMoveY(ShowY, .7f);
    }
예제 #3
0
    public static GameObject CreateOneCardManager(CardManager.Card c, GameObject point)
    {
        GameObject cardprefab = OneCardManager.GetCardPrefab(c);
        GameObject cardObject = GameObject.Instantiate(cardprefab, point.transform, false);

        OneCardManager cardManager = cardObject.GetComponent <OneCardManager>();

        cardObject.tag = "Untagged";
        if (cardManager.PreviewManager != null)
        {
            cardManager.tag = "Untagged";
        }
        //GameObject cardObject = ScriptableObject.Instantiate(cardprefab, point.transform, false);
        cardObject.transform.localScale    = Vector3.one;
        cardObject.transform.localPosition = new Vector3(0, 0, Visual.instance.transform.position.y);
        //cardObject.transform.localPosition=new Vector3(0,0,0);

        //cardObject.transform.SetParent(null);
        cardObject.SetActive(true);

        cardManager.cardAsset = c;
        cardManager.ReadCardFromAsset();
        return(cardObject);
    }