KorolevDmitry123

Untitled

Apr 9th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 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(Input.GetButtonDown("Use")&Vector3.Distance(transform.position, player.transform.position)<5)
  17. {
  18. x.Clip += 1;
  19. gameObject.SetActive(false);
  20. z.a1 = true;
  21. }
  22. }
  23. }
Add Comment
Please, Sign In to add comment