Advertisement
juliosantanna75

Untitled

Aug 19th, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. var pedra: GameObject;
  2. var barraJogar: boolean; //ve se esta pronto para o arremesso ou nao
  3. var tempoGiro: float; //verifia se a a nimaรงao de arremesso foi ate o fim
  4.  
  5. function Start () {
  6. tempoGiro = 0f;
  7. barraJogar = false;
  8. }
  9.  
  10. function Update () {
  11.  
  12.  
  13. if (Input.GetKeyDown(KeyCode.V)){
  14. tempoGiro = tempoGiro*Time.deltaTime;
  15. if (tempoGiro >=0.7f){
  16. barraJogar = true;
  17.  
  18. }
  19.  
  20. if(barraJogar ==true){
  21. Instantiate(pedra,transform.position,transform.rotation);
  22. }
  23.  
  24. if(Input.GetKeyUp(KeyCode.V)){
  25. tempoGiro = 0f;
  26. barraJogar = false;
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement