コード例 #1
0
    private IEnumerator WaitingForResponse()
    {
        bar.BeginFilling(playerResponseWaitingTime);
        for (float timer = playerResponseWaitingTime; timer >= 0; timer -= Time.deltaTime)
        {
            if (!string.IsNullOrEmpty(visualController.playerMessage))
            {
                timeLineController.totalTime         += 20f;
                timeLineController.isCurrentEventOver = true;
                visualController.showshipflags        = StartCoroutine(visualController.ShowVisualMessage(GetFlagsFromCode(visualController.GetCodeFromFlags()))); //Player response
                timeLineController.lastTimeEvent      = Time.realtimeSinceStartup;
                yield break;
            }

            yield return(null);
        }
        timeLineController.isCurrentEventOver = true;
        visualController.DeactivateFlagsButtons();
        visualController.ClearFlagImages();
    }