Ejemplo n.º 1
0
    public void createDodgeText(Transform target)
    {
        Vector2    screenPosition = battleCamera.WorldToScreenPoint(target.position);
        GameObject go             = Instantiate(PrefabDictionary.Instance().DodgeText);

        go.transform.SetParent(battleCanvas, false);

        go.transform.position = screenPosition;
    }
Ejemplo n.º 2
0
    public void createFloatingDamageText(Transform target, int rawDamage, int armor, int block, int healthLost)
    {
        Vector2    screenPosition = battleCamera.WorldToScreenPoint(target.position);
        GameObject go             = Instantiate(PrefabDictionary.Instance().FloatingDamageText);

        go.transform.SetParent(battleCanvas, false);

        go.transform.position = screenPosition;

        go.GetComponent <FloatingDamageText>().SetText(rawDamage, armor, block, healthLost);
    }
Ejemplo n.º 3
0
    protected void startListening()
    {
        listeningStarted = true;
        GameObject go = Instantiate(PrefabDictionary.Instance().targetListener, details.cardBase.transform);

        targetListener = go.GetComponent <TargetListener>();
        targetListener.targetCatgeory = targetCategory;
        targetListener.targetSource   = details.cardBase;
        targetListener.sourceAbility  = this;
        GameAlertUI.Instance().setText(getAlertPromptText());
    }
Ejemplo n.º 4
0
    public void addCard(GameObject details)
    {
        GameObject go   = Instantiate(PrefabDictionary.Instance().cardBase, spawnPoint.position, Quaternion.identity, transform.transform);
        BaseCard   card = go.GetComponent <BaseCard>();

        card.character  = character;
        card.hiddenCard = getDefaultHiddenStatus();
        card.loadCardDetails(details);

        cards.Add(card);

        organizeCards();
    }
    private void displayPlayerCardCollection()
    {
        foreach (GameObject cardGO in PlayerCardCollection.Instance().cardCollection)
        {
            GameObject go = Instantiate(PrefabDictionary.Instance().cardBase, Vector3.zero, Quaternion.Euler(collectionHolder.transform.rotation.eulerAngles + new Vector3(90, 0, 0)), collectionHolder.transform);
            go.AddComponent <PreadventureCardSelector>();
            BaseCard card = go.GetComponent <BaseCard>();
            //Instantiate(PrefabDictionary.Instance().inDeckOverlay, go.transform);
            card.loadCardDetails(cardGO);

            collectionCards.Add(go);
        }
    }
Ejemplo n.º 6
0
    public override void preCastTriggerOther(CardDetails details)
    {
        precastResolve = false;
        this.details   = details;
        GameObject go = Instantiate(PrefabDictionary.Instance().multiTargetListener, details.cardBase.transform);

        targetListener = go.GetComponent <MultiTargetListener>();
        targetListener.targetCatgeory           = targetCategory;
        targetListener.targetSource             = details.cardBase;
        targetListener.multiTargetSourceAbility = this;
        targetListener.targetCount   = targetCount;
        targetListener.uniqueTargets = uniqueTargets;
        GameAlertUI.Instance().setText(getAlertPromptText());
    }
Ejemplo n.º 7
0
    private void displayCollectionSection(List <GameObject> cardPrefabs, bool includedInDeck)
    {
        int cardIndex = collectionCards.Count;

        foreach (GameObject cardGO in cardPrefabs)
        {
            GameObject go   = Instantiate(PrefabDictionary.Instance().cardBase, Vector3.zero, Quaternion.Euler(90, 0, 0), collectionHolder.transform.transform);
            BaseCard   card = go.GetComponent <BaseCard>();
            if (includedInDeck)
            {
                //Instantiate(PrefabDictionary.Instance().inDeckOverlay, go.transform);
            }
            card.loadCardDetails(cardGO);

            collectionCards.Add(go);
        }
    }
Ejemplo n.º 8
0
 private void OnMouseDown()
 {
     if (!EventSystem.current.IsPointerOverGameObject())
     {
         if (inDeck)
         {
             Destroy(overlay);
             overlay = null;
         }
         else
         {
             overlay = Instantiate(PrefabDictionary.Instance().preadventureCardInDeckOverlay, gameObject.transform);
         }
         inDeck = !inDeck;
         PreadventureCardController.Instance().toggleCard(GetComponent <BaseCard>().details, inDeck);
     }
 }