void Awake() { pos = transform.position; allCastBars.Add(this); if (gameObject.name == "PlayerCastBar") { _mainBar = this; } }
// Exits solo mode for this cast bar (must be the last cast bar pushed) public static void exitSolo(CastBar soloBar) { if (soloBar != soloStack.Pop()) { Debug.LogError("StateManager: Solo Stack Mismatch"); } // If stack is empty, hide all except for player if (soloStack.Count == 0) { foreach (CastBar bar in allCastBars) { bar.hidden = !(bar.focus = (bar == _mainBar)); } } // Otherwise, solo the next in the stack else { soloStack.Peek().solo(); } }
// Enters solo mode for this cast bar public static void enterSolo(CastBar soloBar) { soloBar.solo(); soloStack.Push(soloBar); }