/// <summary> /// DO NOT CALL THIS ON LOOP, 不要在迴圈呼叫此函式, 用於檢查flowchart 是否執行中 /// </summary> public void CheckFlowChartIdle() { bool resultFlag = true; var blocks = GetComponents <Block>(); for (int i = 0; i < blocks.Length; i++) { var block = blocks[i]; if (block.IsExecuting()) { resultFlag = false; break; } } if (isMenuOpen) { resultFlag = false; } if (resultFlag) { Debug.Log("<color=cyan>Flowhart Finished</color>"); onFlowchartFinished?.Invoke(UserSelectedOption); onEndSystem?.Invoke(); AdvSignals.AdvCheckFlowchartEnd -= CheckFlowChartIdle; } }
//选择菜单项 public override void SelectItem(int index, bool invokeCallback = true) { if (index == currentItemIndex || index < 0 || index >= menuItemCount) { return; } //Debug.Log("SelectItem = " + index); MenuItem item = GetMenuItem(index); if (item != null) { if (invokeCallback && MenuSelectCallback != null) { MenuSelectCallback.Invoke(index); } } HightlightSelectedItem(index); HightlighNextItem(-1); PointToMenuItem(index); currentItemIndex = index; }