Пример #1
0
    public void Discard()
    {
        int n = UI_CardPanel.slotNum - 1;

        card = UI_CardLoader.slots[n].GetComponentInChildren <Card> ();

        int amount = card.discardValue;

        if (GameManager.composure + amount <= GameManager.maxValue)
        {
            mm.AddSegment(amount);

            loader.DeactivateCard(card.gameObject, true);

            panel.DisablePanel();
        }
        else
        {
            if (GameManager.composure < GameManager.maxValue)
            {
                mm.AddSegment(GameManager.maxValue - GameManager.composure);

                loader.DeactivateCard(card.gameObject, true);


                panel.DisablePanel();
            }
            else
            {
                print("Composure full");
            }
        }
    }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
//		Debug.Log("Energy: " + energy);
//		Debug.Log("Composure: " + composure);


        if (Input.GetKeyDown(KeyCode.C))
        {
            int i = 5;
            if (i < composure + 1)
            {
                hud.RemoveSegment(i);
            }
        }

        if (Input.GetKeyDown(KeyCode.X))
        {
            int i = 3;
            if (composure + i <= startValue)
            {
                hud.AddSegment(i);
            }
        }
    }