Пример #1
0
    public void UpdateOptions(string[] text, List <HookControl.IntFunc> callbacks = null, Dictionary <string, string> showEffects = null, Dictionary <string, string> hideEffects = null)
    {
        BubbleSystemData data = bsData[BubbleSystem.Tutor.TutorEnum.User.ToString()];

        data.Clear();
        data.balloonData.text = text.ToList();
        BubbleSystem.Emotion emotion = new BubbleSystem.Emotion();
        emotion.Set(BubbleSystem.Emotion.EmotionEnum.Neutral);
        data.tutor.Set(BubbleSystem.Tutor.TutorEnum.User);
        data.emotions.Add(emotion, 1.0f);
        data.balloonData.options = true;
        if (callbacks != null)
        {
            data.balloonData.callbacks = callbacks;
        }
        if (showEffects != null)
        {
            data.balloonData.effects.showEffects = getEffectsDictionary(showEffects);
        }
        if (hideEffects != null)
        {
            data.balloonData.effects.hideEffects = getEffectsDictionary(hideEffects);
        }
        bubbleSystem.UpdateScene(data);
    }
Пример #2
0
    public void HideBalloon(Tutor tutor)
    {
        BubbleSystemData data = bsData[tutor.Name];

        data.balloonData.show = false;
        bubbleSystem.UpdateScene(data);
    }
Пример #3
0
    /**********************************************************************************************************
    *                                            BUBBLE SYSTEM
    **********************************************************************************************************/

    public void UpdateBackground(Tutor tutor, Reason.ReasonEnum reason)
    {
        BubbleSystemData data = new BubbleSystemData();

        data.Clear();
        BubbleSystem.Emotion emotion = new BubbleSystem.Emotion();
        emotion.Set(tutor.Emotion.Name.ToString());
        data.tutor.Set(tutor.Name);
        data.emotions.Add(emotion, tutor.Emotion.Intensity);
        data.backgroundData.reason.Set(reason);
        bubbleSystem.UpdateScene(data);
    }
Пример #4
0
    public void HideBalloon(string tutor)
    {
        object parsedTutor;

        if (!EnumUtils.TryParse(typeof(BubbleSystem.Tutor.TutorEnum), tutor, out parsedTutor))
        {
            return;
        }
        BubbleSystem.Tutor.TutorEnum tutorEnum = (BubbleSystem.Tutor.TutorEnum)parsedTutor;
        BubbleSystemData             data      = bsData[tutorEnum.ToString()];

        data.balloonData.show = false;
        bubbleSystem.UpdateScene(data);
    }
Пример #5
0
    /**********************************************************************************************************
    *                                               COMMANDS
    **********************************************************************************************************/

    //<< UpdateBackground tutor emotion intensity reason>>
    private void UpdateBackground(string[] info)
    {
        object parsedTutor, parsedReason;

        if (!EnumUtils.TryParse(typeof(BubbleSystem.Tutor.TutorEnum), info[0], out parsedTutor) ||
            !EnumUtils.TryParse(typeof(Reason.ReasonEnum), info[info.Length - 1], out parsedReason))
        {
            return;
        }
        BubbleSystem.Tutor.TutorEnum tutor = (BubbleSystem.Tutor.TutorEnum)parsedTutor;
        BubbleSystemData             data  = new BubbleSystemData();

        data.Clear();
        KeyValuePair <int, Dictionary <BubbleSystem.Emotion, float> > emotions = GetEmotions(info, 1);

        data.tutor.Set(tutor);
        data.emotions = emotions.Value;
        data.backgroundData.reason.Set((Reason.ReasonEnum)parsedReason);
        bubbleSystem.UpdateScene(data);
    }
Пример #6
0
    public void Speak(Tutor tutor, string[] text, Dictionary <string, string> showEffects = null, Dictionary <string, string> hideEffects = null)
    {
        BubbleSystemData data = bsData[tutor.Name];

        data.Clear();
        BubbleSystem.Emotion emotion = new BubbleSystem.Emotion();
        emotion.Set(tutor.Emotion.Name.ToString());
        data.tutor.Set(tutor.Name);
        data.emotions.Add(emotion, tutor.Emotion.Intensity);
        data.balloonData.text = text.ToList();
        if (showEffects != null)
        {
            data.balloonData.effects.showEffects = getEffectsDictionary(showEffects);
        }
        if (hideEffects != null)
        {
            data.balloonData.effects.hideEffects = getEffectsDictionary(hideEffects);
        }
        bubbleSystem.UpdateScene(data);
    }