Example #1
0
    IEnumerator goToNextLevel(delay = nextLevelDelay)
    {
        yield return(new WaitForSeconds(delay));

        int nextLevel = SceneManager.GetActiveScene().buildIndex + 1;

        nextLevel = (nextLevel == numLevels)? 0: nextLevel;
        SceneManager.LoadScene(nextLevel);
    }
Example #2
0
    private DateTime _AddTypingBehaviorBox(string finalText, List <Tag> tags, DateTime rawShootTime)
    {
        float basicTypingTime = finalText.Length * _typingSpeed;
        float delaySec        = 0f;

        var typeTags = tags.FindAll(t => t is TypingBehavior);

        Debug.Log(typeTags.Count);
        var delayList = typeTags.Where(t => t is delay);

        foreach (var t in typeTags.Where(t => t is delay))
        {
            delay d = t as delay;
            delaySec += d.length;
        }
        rawShootTime += TimeSpan.FromSeconds(delaySec);

        fast  fast  = typeTags.Find(t => t is fast) as fast;
        slow  slow  = typeTags.Find(t => t is slow) as slow;
        doubt doubt = typeTags.Find(t => t is doubt) as doubt;

        if (!ReferenceEquals(fast, null))
        {
            basicTypingTime *= fast.length;
        }
        if (!ReferenceEquals(slow, null))
        {
            basicTypingTime *= slow.length;
        }

        if (!ReferenceEquals(doubt, null))
        {
            //if final bubble shoot time is before DateTime.Now
            //no effects would be shown
            if (rawShootTime + TimeSpan.FromSeconds(basicTypingTime + doubt.length) < DateTime.Now)
            {
                return(rawShootTime + TimeSpan.FromSeconds(basicTypingTime + doubt.length));
            }

            float doubtTime      = 0f;
            float dotExistLength = 0f;
            while (doubtTime < doubt.length)
            {
                Services.textSequenceTaskRunner.AddTask(DeleteDot, rawShootTime + TimeSpan.FromSeconds(doubtTime));
                doubtTime += UnityEngine.Random.Range(0f, 2f);
                Services.textSequenceTaskRunner.AddTask(AddDot, rawShootTime + TimeSpan.FromSeconds(doubtTime));
                dotExistLength = UnityEngine.Random.Range(0f, 4f);
                doubtTime     += dotExistLength;
            }
            Services.textSequenceTaskRunner.AddTask(DeleteDot, rawShootTime + TimeSpan.FromSeconds(doubtTime - dotExistLength + basicTypingTime));
            return(rawShootTime + TimeSpan.FromSeconds(doubtTime - dotExistLength + basicTypingTime));
        }
        else
        {
            //if final bubble shoot time is before DateTime.Now
            //no effects would be shown
            if (rawShootTime + TimeSpan.FromSeconds(basicTypingTime) < DateTime.Now)
            {
                return(rawShootTime + TimeSpan.FromSeconds(basicTypingTime));
            }

            Services.textSequenceTaskRunner.AddTask(AddDot, rawShootTime);
            Services.textSequenceTaskRunner.AddTask(DeleteDot, rawShootTime + TimeSpan.FromSeconds(basicTypingTime));
            return(rawShootTime + TimeSpan.FromSeconds(basicTypingTime));
        }
    }
Example #3
0
 var(delay, clock, untypedHandler, untypedCompletedHandler) = arg;
Example #4
0
 return(new AllPassFilter(stream, coefficient, delay, rmsBehavior));
Example #5
0
 public Timer(TimeSpan delay) => Init(delay, TimeSpan.Zero, 1);
Example #6
0
 rootCommand.Handler = CommandHandler.Create <string, bool, int, bool, bool>((url, mail, delay, http, debug) => Initialize(url, mail, delay, http, debug));