Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Clip : MonoBehaviour {
- public GameObject player;
- private GameObject clip;
- public PlaySound2 z;
- public Shooting x;
- void Start()
- {
- clip = (GameObject)this.gameObject;
- }
- void Update ()
- {
- GameObject player = GameObject.FindGameObjectWithTag("Player");
- if(Input.GetButtonDown("Use")&Vector3.Distance(transform.position, player.transform.position)<5)
- {
- x.Clip += 1;
- gameObject.SetActive(false);
- z.a1 = true;
- }
- }
- }
Add Comment
Please, Sign In to add comment