Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class moveCamera : MonoBehaviour {
- public float x = 4;
- public Vector3 translate_vector;
- // Use this for initialization
- void Start () {
- translate_vector = new Vector3 ();
- }
- // Update is called once per frame
- void Update () {
- //transform.position = transform.position + new Vector3(x * Time.deltaTime, 0, 0);
- translate_vector.x = x * Time.deltaTime;
- transform.Translate( translate_vector );
- if (Input.GetMouseButtonDown(0) )
- {
- if(Time.timeScale > 0.0f)
- Time.timeScale = 0.0f;
- else
- Time.timeScale = 1.0f;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment