Advertisement
Guest User

Untitled

a guest
Jun 6th, 2020
44
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Stash : MonoBehaviour
  6. {
  7.     public Collider2D stashCollider;
  8.     public Bars umbrellaBar;
  9.     public float refillValue; //The amount regained
  10.     private void OnCollisionEnter(Collision collision)
  11.     {
  12.         if(Input.GetKeyDown(KeyCode.E))
  13.         {
  14.             umbrellaBar.currentHealth += refillValue;
  15.         }
  16.     }
  17.  
  18. }
Advertisement
RAW Paste Data Copied
Advertisement