示例#1
0
    void Update()
    {
        if (_showImageFade)
        {
            _showImageCanvasGroup.alpha = Mathf.MoveTowards(_showImageCanvasGroup.alpha, _targetAlpha, imageFadeSpeed * Time.deltaTime);
            if (_showImageCanvasGroup.alpha == _targetAlpha)
            {
                _showImageFade = false;
            }
        }

        if (_waitInput)
        {
            ControlWindowItem controlWindow = FindObjectOfType(typeof(ControlWindowItem)) as ControlWindowItem;
            if (controlWindow != null)
            {
                InputField input = controlWindow.GetComponentInChildren <InputField>();
                if (input != null)
                {
                    string blockName = (int)LevelMgr.instance.curLevel + "-" + input.text;
                    if (_flowchart.HasBlock(blockName))
                    {
                        _flowchart.ExecuteBlock(blockName);
                        input.text = "";
                        controlWindow.Hide();
                        _waitInput = false;
                    }
                }
            }
        }
    }
示例#2
0
 void Say()
 {
     if (canChat)
     {
         Flowchart flowchart = GameObject.Find("Flowchart").GetComponent <Flowchart>();
         if (flowchart.HasBlock(ChatName))
         {
             flowchart.ExecuteBlock(ChatName);
         }
     }
 }
示例#3
0
 private void Say()
 {
     if (blockNames.Length == 0)
     {
         return;
     }
     if (flowchart.HasBlock(blockNames[currentSayIndex]))
     {
         Debug.Log(blockNames[currentSayIndex]);
         flowchart.ExecuteBlock(blockNames[currentSayIndex]);
     }
     currentSayIndex++;
 }
示例#4
0
    IEnumerator loadScene()
    {
        var asyncLoadScene = SceneManager.LoadSceneAsync(sceneName);

        while (!asyncLoadScene.isDone)
        {
            yield return(null);
        }

        Flowchart flowchart = GameObject.Find("Flowchart").GetComponent <Flowchart>();

        Debug.Log(flowchart.HasBlock("onWin"));
        flowchart.ExecuteBlock((result) ? "onWin" : "onLose");
    }
示例#5
0
 private void ExecuteBlock(string name)
 {
     if (flowchart.HasBlock(name))
     {
         flowchart.ExecuteBlock(name);
         executingBlock.OnNext(flowchart.FindBlock(name));
     }
     else
     {
         if (Debug.isDebugBuild)
         {
             Debug.Log($"No Block");
         }
     }
 }
示例#6
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Q))
        {
            Say();
        }

        if (count == 4)
        {
            Flowchart flowchart = GameObject.Find("Flowchart").GetComponent <Flowchart>();
            if (flowchart.HasBlock("over"))
            {
                flowchart.ExecuteBlock("over");
            }
        }
    }
示例#7
0
    public void Say()
    {
        if (flowchart == null)
        {
            return;
        }
        if (EventCenter.Boardcast <int>(GameEventType.GetGameProgress) >= 11 && !hasComplete)
        {
            hasComplete = true;
            CompleteAllQuestion();
        }
        if (hasComplete)
        {
            return;
        }
        //Debug.Log("当前游戏进度:" + EventCenter.Boardcast<int>(GameEventType.GetGameProgress));
        string name = blockName + EventCenter.Boardcast <int>(GameEventType.GetCurrentQueIndex);

        //string name = blockName + "0";
        if (flowchart.HasBlock(name))
        {
            flowchart.ExecuteBlock(name);
        }
    }
示例#8
0
    // Use this for initialization
    void Start()
    {
        Flowchart flowchart = GameObject.Find("Flowchart").GetComponent <Flowchart>();

        Debug.Log("tmp:" + flowchart.HasBlock("onWin"));
    }