using UnityEngine;
using System.Collections;

public class ShakeScale : MonoBehaviour {

	public Vector3 scale;
	Vector3 startScale;

	// Use this for initialization
	void Start () {
		startScale = transform.localScale;
	}
	
	// Update is called once per frame
	void Update () {
		Vector3 n = startScale;
		if(scale.x!=0)n.x+= Random.Range(-scale.x*0.5f, scale.x*0.5f);
		if(scale.y!=0)n.y+= Random.Range(-scale.y*0.5f, scale.y*0.5f);
		if(scale.z!=0)n.z+= Random.Range(-scale.z*0.5f, scale.z*0.5f);
		transform.localScale = n;
	}
}
