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); }
private void Start() { ResetSchematic(); mainTimerPBP = mainTimerObj.GetComponent <ProgressBarPro>(); rollTimerPBP = rollTimerObj.GetComponent <ProgressBarPro>(); lockTimerPBP = lockTimerObj.GetComponent <ProgressBarPro>(); }
void TriggerDetection(ProgressBarPro progressBarPro) { if (progressBarPro == null) { return; } Undo.RecordObject(progressBarPro, "Detected View Components in Children"); progressBarPro.DetectViewObjects(); EditorUtility.SetDirty(progressBarPro); }
private void InstantiateBar(int num) { if (num < 0 || num >= this.progressBarPrefabs.Length) { return; } this.currentPrefab = num; if (Object.op_Inequality((Object)this.bar, (Object)null)) { Object.Destroy((Object)((Component)this.bar).get_gameObject()); } this.bar = (ProgressBarPro)Object.Instantiate <ProgressBarPro>((M0)this.progressBarPrefabs[num], this.prefabParent); ((Component)this.bar).get_gameObject().SetActive(false); ((Component)this.bar).get_transform().set_localScale(Vector3.get_one()); this.bar.SetValue(this.currentValue, false); ((Component)this.bar).get_gameObject().SetActive(true); this.prefabName.set_text(((Object)((Component)this.progressBarPrefabs[this.currentPrefab]).get_gameObject()).get_name()); this.Invoke("EnableBar", 0.01f); }
void Start() { totalPercent = 0; progressBar = GetComponentInChildren <ProgressBarPro>(); }