Guest User

Untitled

a guest
Jun 27th, 2014
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class moveCamera : MonoBehaviour {
  5.  
  6. public float x = 4;
  7. public Vector3 translate_vector;
  8.  
  9. // Use this for initialization
  10. void Start () {
  11. translate_vector = new Vector3 ();
  12.  
  13. }
  14.  
  15. // Update is called once per frame
  16. void Update () {
  17. //transform.position = transform.position + new Vector3(x * Time.deltaTime, 0, 0);
  18. translate_vector.x = x * Time.deltaTime;
  19. transform.Translate( translate_vector );
  20.  
  21. if (Input.GetMouseButtonDown(0) )
  22. {
  23. if(Time.timeScale > 0.0f)
  24. Time.timeScale = 0.0f;
  25. else
  26. Time.timeScale = 1.0f;
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment