using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraShake : MonoBehaviour {

    float shakeTimer;
    Vector3 camOrigPos;

	// Use this for initialization
	void Start ()
    {
        camOrigPos = transform.position;
	}
	
	// Update is called once per frame
	void Update ()
    {
		if (shakeTimer < 2)
        {
            Vector2 tempVector = Random.insideUnitCircle;
            transform.position += new Vector3(tempVector.x, tempVector.y, 0) * Time.deltaTime;
            shakeTimer += Time.deltaTime;
        }
        else
        {
            transform.position = camOrigPos;
            shakeTimer = 0;
        }
	}
}
