using UnityEngine;
using System.Collections;

public class Scaler : MonoBehaviour {

	public BoxCollider[] colliders;


	// Use this for initialization
	void Start() {

		colliders = transform.GetComponentsInChildren<BoxCollider>();
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	public void SwitchColliders(bool val) {

		foreach (BoxCollider child in colliders)
		{
			if(child.isTrigger == false) {
				Vector3 tempSize = child.size;
				Vector3 tempCenter = child.center;
				tempSize.z = val ? 100 : 1;
				tempSize.y = !val ? 100 : 1;
				tempCenter.y = !val ? -49.5f : 0;
				child.size = tempSize;
				child.center = tempCenter;
			}
//			else {
//				Vector3 tempSize = child.size;
//				tempSize.z = val ? 100 : 0.6f;
//				tempSize.y = !val ? 100 : 0.6f;
//				child.size = tempSize;
//			}
		}
	}
}
