예제 #1
0
    private CallbackThing <bool> Quiz(string text, List <string> possibleAnswers, int actualAnswer)
    {
        var cb = new CallbackThing <bool>();

        Conversation.Instance.StartConversation(c =>
        {
            c.Add("Policeman", text, BoxType.Right);
            c.Add("Alice", "", BoxType.QuestionRight).Answers.AddRange(possibleAnswers);
        })
        .Then(c =>
        {
            if (c.Single() != actualAnswer)
            {
                Conversation.Instance.StartConversation(c =>
                {
                    c.Add("Policeman", "... That's not right. Off to the hoosegow with you!", BoxType.Right);
                })
                .Then(() => DeathCanvas.Instance.Show());
            }
            else
            {
                cb.Callback(true);
            }
        });
        return(cb);
    }
예제 #2
0
        public CallbackThing <bool> Start()
        {
            var cb = new CallbackThing <bool>();

            Assert.IsNull(Coroutine, "Cannot Start tweener while it is active");
            Coroutine = GameObject.StartCoroutine(Begin(() => cb.Callback(true)));
            return(cb);
        }