Advertisement
Guest User

Untitled

a guest
May 29th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Clip : MonoBehaviour {
  5. public GameObject player;
  6. private GameObject clip;
  7. public PlaySound2 z;
  8. public Shooting x;
  9. void Start()
  10. {
  11. clip = (GameObject)this.gameObject;
  12. }
  13. void Update ()
  14. {
  15. GameObject player = GameObject.FindGameObjectWithTag("Player");
  16. if (player != null)
  17. {
  18. if (Input.GetButtonDown("Use") & Vector3.Distance(transform.position, player.transform.position) < 5)
  19. {
  20. x.Clip += 1;
  21. gameObject.SetActive(false);
  22. z.a1 = true;
  23. }
  24. }
  25.  
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement