Ejemplo n.º 1
0
 private void Start()
 {
     player = GetComponent <PlayerStuff>();
     hud    = GameObject.Find("HUD").GetComponentInChildren <hudChange>();
     dia    = hud.GetComponentInChildren <DialogCentre>(true);
     if (cardMenu == null)
     {
         cardMenu = hud.GetComponentInChildren <CardMenu>();
     }
 }
Ejemplo n.º 2
0
    internal void ChanceCard()
    {
        PlayerStuff player = turn.player;

        dia = hud.GetComponentInChildren <DialogCentre>(true);

        switch (UnityEngine.Random.Range(0, 4))
        {
        case 0: dia.ShowMessage("Игрок " + player.name + " находит мелочь на дороге. +684$"); player.GetComponent <Money>().Transaction(-684); player.EndTurn(); break;

        case 1: dia.ShowMessage("Игрок " + player.name + " замечает несколько купюр в зимней куртке. +980$"); player.GetComponent <Money>().Transaction(-980); player.EndTurn(); break;

        case 2: dia.ShowMessage("Игрок " + player.name + " выигрывает региональный конкурс предпринимателей. +1500$"); player.GetComponent <Money>().Transaction(-1500); player.EndTurn(); break;

        case 3: dia.ShowMessage("Игрок " + player.name + " проливает чай на свой компьютер. Починка 1000$"); player.targetCard.cost = 1000; ShowPay(); break;

        case 4: dia.ShowMessage("Игроку " + player.name + " пора отдохнуть. Поезка на море обойдется в 2000$"); player.targetCard.cost = 2000; ShowPay(); break;
        }
    }
Ejemplo n.º 3
0
    private void Start()
    {
        owner      = null;
        isMonopoly = false;
        hud        = GameObject.Find("HUD").GetComponentInChildren <hudChange>();
        upgLevel   = GetComponentInChildren <TextMesh>();
        if (canBuy)
        {
            costText      = GetComponentsInChildren <TextMesh>()[1];
            costText.text = _cost + "$";

            labelText      = GetComponentsInChildren <TextMesh>()[2];
            labelText.text = label;
            Color tmpColor = labelText.color;
            tmpColor.a      = 0f;
            labelText.color = tmpColor;
        }
        turn = GameObject.Find("players").GetComponent <Turn>();

        // Индексы монополий
        List <int> monopolyInds = new List <int> {
            0, 1, 2, 3, 4, 5, 6, 7, 15
        };

        if (monopolyInds.Contains(index))
        {
            canBuy = true;
        }
        //
        try
        {
            anim = GetComponent <Animator>();
        }
        catch (System.Exception)
        {
            anim = null;
        }

        trade = hud.GetComponentInChildren <Trade>();
    }