Exemplo n.º 1
0
 private void ApplyChoice()
 {
     if (npcTalking == NPCType.Clara.ToString())
     {
         if (choiceSelected == 1)
         {
             NextMonologue();
         }
         else if (choiceSelected == 2)
         {
             StopDialog();
         }
     }
     else if (npcTalking == NPCType.ShopKeeper.ToString())
     {
         if (choiceSelected == 1)
         {
             choiceEnable = false;
             choice1Text.SetMyText(null);
             choice2Text.SetMyText(null);
             choicePanel.SetActive(false);
             dialogPanel.SetActive(false);
             canvasManager.ToggleCanvas(CanvasType.ShopCanvas);
         }
         else if (choiceSelected == 2)
         {
             ActivateMonologue(2, 0);
             choiceEnable = false;
             choice1Text.SetMyText(null);
             choice2Text.SetMyText(null);
             choicePanel.SetActive(false);
         }
     }
 }
Exemplo n.º 2
0
    IEnumerator TypeSentence(string sentence)
    {
        Debug.Log("Npc talking : " + npcTalking);
        string phrase = "";

        dialogText.SetMyText(phrase);
        foreach (char letter in sentence.ToCharArray())
        {
            phrase += letter;
            dialogText.SetMyText(phrase);
            yield return(null);
        }
    }
Exemplo n.º 3
0
    void checkIfHealthAndArmorValid()
    {
        if (currentArmor > maxArmor)
        {
            Debug.Log("Player's armor went further than max value. Reducing armor to " + maxArmor);
            currentArmor = maxArmor;
            txtArmor.SetMyText(currentArmor.ToString());
        }

        if (currentHealth > maxHealth)
        {
            Debug.Log("Player's health went further than max value. Reducing health to " + maxHealth);
            currentHealth = maxHealth;
            txtHealth.SetMyText(currentHealth.ToString());
        }
    }
Exemplo n.º 4
0
 public void SetPlayerHUD()
 {
     barHealth.SetMyMaxValue(playerController.currentHealth);
     barHealth.SetMyCurrentValue(playerController.currentHealth);
     textHealth.SetMyText(playerController.currentHealth.ToString());
     barArmor.SetMyMaxValue(playerController.maxArmor);
     barArmor.SetMyCurrentValue(playerController.currentArmor);
     textArmor.SetMyText(playerController.currentArmor.ToString());
     textMoney.SetMyText(playerController.currentMoney.ToString());
 }
Exemplo n.º 5
0
    public void StartDialog(string npcName, List <List <string> > conv, List <string[]> choices)
    {
        npcTalking = npcName;
        npcNameText.SetMyText(npcName);
        monologueList = conv;

        choiceList = choices;

        dialogLaunched = true;

        dialogPanel.SetActive(true);
        ActivateMonologue(0, 0);
    }
Exemplo n.º 6
0
 public void ActivateHudGear(GearController gear)
 {
     if (gear.gearType == GearType.Weapon)
     {
         Weapon weapon = gear as Weapon;
         consumableHUD.SetActive(false);
         weaponHUD.SetActive(true);
         textMunitions.SetMyText(weapon.munitions.ToString());
         textCapacity.SetMyText(weapon.capacity.ToString());
     }
     else if (gear.gearType == GearType.Consumable)
     {
         Consumable consumable = gear as Consumable;
         weaponHUD.SetActive(false);
         consumableHUD.SetActive(true);
         textConsumablesRemaining.SetMyText(consumable.consumablesRemaining.ToString());
     }
 }
Exemplo n.º 7
0
 public void PlayerEarnMoney(int money)
 {
     currentMoney += money;
     txtMoney.SetMyText(currentMoney.ToString());
 }
Exemplo n.º 8
0
 public void SetName(string gear)
 {
     slotName = gear;
     txtSlot.SetMyText(gear);
 }