using UnityEngine;
using System.Collections;

public class WeaponFoldingController : MonoBehaviour {
	[SerializeField]bool folded = true;

	[ContextMenu("Fold")]
	void ChangeFolding()
	{
		folded = !folded;
		foreach (var foldController in transform.GetComponentsInChildren<FoldController>()) {
			if (foldController != null) {
				foldController.folded = folded;
			}
		}
	}

	void Start () {
	
	}

	float timer = 0;
	void Update () {
		if (timer > 0)
		{
			timer -= Time.deltaTime;
		}
		else
		{
			timer = 3f;
			ChangeFolding();
		}
	}
}
