Exemple #1
0
 public void DealDamage(float damage)
 {
     if ((currentHealth - damage) <= 0)
     {
         currentHealth = 0;
         Die();
     }
     else
     {
         currentHealth = currentHealth - damage;
         UpdateDebugBar();
         PlayerHealthBar.SetHealthBar(currentHealth / PlayerStartHealth);
         ContextualScreen.SwitchToPage(Health);
         if (canRegenerateHealth)
         {
             canRegenerateHealth = false;
             startRegenDelay     = Time.time;
             currentRegenDelay   = standardRegenDelay;
         }
         else
         {
             canRegenerateHealth = false;
             currentRegenDelay   = (Time.time - startRegenDelay) + standardRegenDelay;
             startRegenDelay     = Time.time;
         }
     }
 }
    public void Highlight()
    {
        startHighlightTime = Time.time;

        if (!highlightingGems && !calledFred)
        {
            ContextualScreen.SwitchToPage(ScanPage);

            highlightingGems = true;
        }
    }
    public void toggleRadialMenu()
    {
        isOpen = !isOpen;

        if (isOpen)
        {
            ContextualScreen.SwitchToPage(TrapPage);
            transform.position = radialMenuLocation.position;
            radialMenuAnimator.gameObject.SetActive(true);
            radialMenuAnimator.SetBool("Open", true);
        }
        else
        {
            radialMenuAnimator.SetBool("Open", false);
            Invoke("ResetContextualScreen", 1f);
        }
    }