예제 #1
0
    void CreateCard()
    {
        CardData cardData = CardCoordinator.GetNextCardData();
        Card     card     = this.cardPrefab.CreateCard(cardData);

        card.transform.parent = cardContainer;
    }
예제 #2
0
    void OnCardsImported(GameMessage msg)
    {
        CardCoordinator.RandomizeCardsForPlayer();
        float wdAmount   = 0;
        float tapeAmount = 0;

        if (PlayerPrefs.GetInt("Ending1") > 0)
        {
            wdAmount += GameConstantsBucket.EndingResourceAward;
        }
        if (PlayerPrefs.GetInt("Ending2") > 0)
        {
            tapeAmount += GameConstantsBucket.EndingResourceAward;
        }

        EventCoordinator.TriggerEvent(EventName.System.Economy.ModifyResource(), GameMessage.Write().WithFloatMessage(tapeAmount).WithResource(ResourceItem.Ductape));
        EventCoordinator.TriggerEvent(EventName.System.Economy.ModifyResource(), GameMessage.Write().WithFloatMessage(wdAmount).WithResource(ResourceItem.Wd));
    }
예제 #3
0
    public static void Import()
    {
        TextAsset tsvText = (TextAsset)Resources.Load("cards");

        string[] records = tsvText.text.Split('\n');
        for (int i = 2; i < records.Length; i++)
        {
            string[] data = records[i].Split('\t');
            CardData card = MakeCard(data);

            bool skip = card.answers.Any(a => a.text == "");
            if (skip)
            {
                continue;
            }

            CardCoordinator.AddCard(card);
        }
    }
예제 #4
0
    private static CardData MakeCard(string[] data)
    {
        Sprite cover = Resources.Load <Sprite>("content pictures/" + data[1]);

        Answer ductapeGood, ductapeBad, wdGood, wdBad;

        ductapeGood          = new Answer();
        ductapeGood.resource = ResourceItem.Ductape;
        ductapeGood.good     = true;
        ductapeGood.text     = data[RowDuctapeGood];
        ductapeGood.cost     = CardCoordinator.GetRandomizedReward(ductapeGood);

        ductapeBad          = new Answer();
        ductapeBad.resource = ResourceItem.Ductape;
        ductapeBad.good     = false;
        ductapeBad.text     = data[RowDuctapeBad];
        ductapeBad.cost     = CardCoordinator.GetRandomizedReward(ductapeBad);

        wdGood          = new Answer();
        wdGood.resource = ResourceItem.Wd;
        wdGood.good     = true;
        wdGood.text     = data[RowWdGood];
        wdGood.cost     = CardCoordinator.GetRandomizedReward(wdGood);

        wdBad          = new Answer();
        wdBad.resource = ResourceItem.Wd;
        wdBad.good     = false;
        wdBad.text     = data[RowWdBad];
        wdBad.cost     = CardCoordinator.GetRandomizedReward(wdBad);

        CardData card = new CardData();

        card.answers    = new Answer[] { ductapeGood, ductapeBad, wdGood, wdBad };
        card.coverImage = cover;
        return(card);
    }