Exemple #1
0
    /// <summary>
    /// 主要接口,讀取 Flowchart Prefab檔,第二參數 Adv 結束對話時執行
    /// </summary>
    public void LoadContent(FlowchartExtend flowchart, string blockName, MenuSelectCallback callback)
    {
        Debug.Log("<color=lime>trying Start Flowhart</color>");
        InstantiateAndManage(flowchart);
        StartAdvScene();
        if (AdvProjectConfig.Instance.SetShowAvatarInNewFlowchart)
        {
            advSayDialog.IconDisplay = true;
        }

        templateFlowchart.StartFlowChart(blockName, callback);
        OnLoadAdvContnet?.Invoke(flowchart, blockName);
        Debug.Log("<color=lime>Flowhart Started</color>");
    }
        public void StartFlowChart(string blockName, MenuSelectCallback callback)
        {
            onFlowchartFinished = callback;
            UserSelectedOption.Clear();

            Block _targetBlock = FindBlock(blockName);

            if (_targetBlock == null)
            {
                Debug.LogError("找不到指定 Block ! (" + blockName + ")");
            }
            else
            {
                // Ensure CommandList is not null at "runtime"
                _targetBlock.CommandList.RemoveAll(item => item == null);
                AdvSignals.AdvCheckFlowchartEnd  = null;
                AdvSignals.AdvCheckFlowchartEnd += CheckFlowChartIdle;
                ExecuteBlock(_targetBlock, 0, null);
            }
        }
Exemple #3
0
    //选择菜单项
    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;
    }
Exemple #4
0
 public void LoadContent(FlowchartExtend flowchart, MenuSelectCallback callback)
 {
     LoadContent(flowchart, flowchart.EntranceBlockName, callback);
 }
 public void StartFlowChart(MenuSelectCallback callback)
 {
     StartFlowChart(EntranceBlockName, callback);
 }