void InstantiateBar(int num)
        {
            if (num < 0 || num >= progressBarPrefabs.Length)
            {
                return;
            }

            currentPrefab = num;

            if (bar != null)
            {
                Destroy(bar.gameObject);
            }

#if UNITY_5_2 || UNITY_5_3 || UNITY_5_4_OR_NEWER
            bar = Instantiate <ProgressBarPro>(progressBarPrefabs[num], prefabParent);
#else
            bar = Instantiate(progressBarPrefabs[num]) as ProgressBarPro;
            bar.transform.SetParent(prefabParent);
#endif
            bar.gameObject.SetActive(false);
            bar.transform.localScale = Vector3.one;
            bar.SetValue(currentValue);
            bar.gameObject.SetActive(true);

            prefabName.text = progressBarPrefabs[currentPrefab].gameObject.name;

            Invoke("EnableBar", 0.01f);
        }
        public void SetValue(float value)
        {
            currentValue = value;

            if (bar != null)
            {
                bar.SetValue(value);
            }
        }