using UnityEngine;
using System.Collections;

public class RotationMimic: MonoBehaviour {
	
	public Transform objToRot;
	
	public bool rotateX, rotateY, rotateZ;
	public float xOffset, yOffset, zOffset;
	
	private Vector3 newRot;
	
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {

		//Quaternion rott = transform
		newRot = objToRot.rotation.eulerAngles;
		
		if(!rotateX){
			newRot.x = transform.rotation.x;
		}else{
			newRot.x += xOffset;
		}
		
		if(!rotateY){
			newRot.y = transform.rotation.y;
		}else{
			newRot.y += yOffset;
		}
		
		if(!rotateZ){
			newRot.z = transform.rotation.z;
		}else{
			newRot.z +=zOffset;
		}

		transform.rotation = Quaternion.Euler(newRot);
		
	}
}
