title: On trigger exit subctract mana
body: <p>I have perform a c# script to add mana to the slider ontriggerEnter and Subtract mana on trigguerExit wen touch on Enemy object, but it seems to have some thing wrong, the script have no errors but wen its touch the Enemy Object It Take all the mana, and not the value i set.
  I am new on c# scripting, tank you in advance.
  This is my Script</p>
  
  <pre><code>using UnityEngine;
  using UnityEngine.UI;
  using System.Collections;
  
  public class mana : MonoBehaviour {
  
  
  public void addmana()
  {
      manaBar.value += 300;
  
  }
  
  public void Takemana()
  {
      manaBar.value -= 30;
  
  }
  
  public Slider manaBar;
  
  
  // Use this for initialization
  void Start () 
  {
  
      manaBar.value = 300;
      if (manaBar != null)
      {
          manaBar.IsActive();
      }
  }
  
  
  void OnTriggerEnter(Collider other)
  {
      // The switch statement checks what tag the other gameobject is, and reacts accordingly.
      switch (other.gameObject.tag)
      {
      case "manapickup":
          Debug.Log(other.gameObject.tag);
          Invoke("addmana", 0f);
          Destroy (other.gameObject);
          break;
  
      }
      // Finally, this line destroys the gameObject the player collided with.
      //Destroy(other.gameObject);
  }
  
  void OnTriggerExit(Collider other)
  {
      // The switch statement checks what tag the other gameobject is, and reacts accordingly.
      switch (other.gameObject.tag)
      {
      case "Enemy":
          Debug.Log(other.gameObject.tag);
          Invoke("Takemana", 0f);
          break;
  
      }
      // Finally, this line destroys the gameObject the player collided with.
      //Destroy(other.gameObject);
  }
  </code></pre>