Пример #1
0
    public void SetAgent(AgentController ik)
    {
        if (avatarIK != null)
        {
            avatarIK.playAnimationWithoutTalk = false;
        }

        avatarIK = ik;

        PreventSliderChangeUpdate = true;

        slider_O.value = avatarIK.openness;
        slider_C.value = avatarIK.conscientiousness;
        slider_E.value = avatarIK.extraversion;
        slider_A.value = avatarIK.agreeableness;
        slider_N.value = avatarIK.neuroticism;

        avatarIK.InitTextOCEANProbs();
        avatarIK.CalculateTextOCEANProbs();

        text_O.text = avatarIK.text_O;
        text_C.text = avatarIK.text_C;
        text_E.text = avatarIK.text_E;
        text_A.text = avatarIK.text_A;
        text_N.text = avatarIK.text_N;

        avatarIK.playAnimationWithoutTalk = false;

        PreventSliderChangeUpdate = false;
    }
Пример #2
0
    public void OnSliderChange()
    {
        if (PreventSliderChangeUpdate)
        {
            return;
        }
        if (avatarIK == null)
        {
            return;
        }

        avatarIK.openness          = slider_O.value;
        avatarIK.conscientiousness = slider_C.value;
        avatarIK.extraversion      = slider_E.value;
        avatarIK.agreeableness     = slider_A.value;
        avatarIK.neuroticism       = slider_N.value;

        avatarIK.CalculateTextOCEANProbs();

        text_O.text = avatarIK.text_O;
        text_C.text = avatarIK.text_C;
        text_E.text = avatarIK.text_E;
        text_A.text = avatarIK.text_A;
        text_N.text = avatarIK.text_N;
    }
Пример #3
0
    private void DoTextOCEAN()
    {
        if (textOCEAN_init)
        {
            agent.InitTextOCEANProbs();
            textOCEAN_init = false;
        }

        agent.CalculateTextOCEANProbs();

        TextOCEAN_O_pos.color = Color.Lerp(c1, c2, agent.probs[0] * 2f);
        TextOCEAN_O_neg.color = Color.Lerp(c1, c2, agent.probs[1] * 2f);
        TextOCEAN_C_pos.color = Color.Lerp(c1, c2, agent.probs[2] * 2f);
        TextOCEAN_C_neg.color = Color.Lerp(c1, c2, agent.probs[3] * 2f);
        TextOCEAN_E_pos.color = Color.Lerp(c1, c2, agent.probs[4] * 2f);
        TextOCEAN_E_neg.color = Color.Lerp(c1, c2, agent.probs[5] * 2f);
        TextOCEAN_A_pos.color = Color.Lerp(c1, c2, agent.probs[6] * 2f);
        TextOCEAN_A_neg.color = Color.Lerp(c1, c2, agent.probs[7] * 2f);
        TextOCEAN_N_pos.color = Color.Lerp(c1, c2, agent.probs[8] * 2f);
        TextOCEAN_N_neg.color = Color.Lerp(c1, c2, agent.probs[9] * 2f);

        TextOCEAN_O_pos_t.text = agent.probs[0].ToString("F2") + " - " + TextOCEAN_O_pos_bstr;
        TextOCEAN_O_neg_t.text = agent.probs[1].ToString("F2") + " - " + TextOCEAN_O_neg_bstr;
        TextOCEAN_C_pos_t.text = agent.probs[2].ToString("F2") + " - " + TextOCEAN_C_pos_bstr;
        TextOCEAN_C_neg_t.text = agent.probs[3].ToString("F2") + " - " + TextOCEAN_C_neg_bstr;
        TextOCEAN_E_pos_t.text = agent.probs[4].ToString("F2") + " - " + TextOCEAN_E_pos_bstr;
        TextOCEAN_E_neg_t.text = agent.probs[5].ToString("F2") + " - " + TextOCEAN_E_neg_bstr;
        TextOCEAN_A_pos_t.text = agent.probs[6].ToString("F2") + " - " + TextOCEAN_A_pos_bstr;
        TextOCEAN_A_neg_t.text = agent.probs[7].ToString("F2") + " - " + TextOCEAN_A_neg_bstr;
        TextOCEAN_N_pos_t.text = agent.probs[8].ToString("F2") + " - " + TextOCEAN_N_pos_bstr;
        TextOCEAN_N_neg_t.text = agent.probs[9].ToString("F2") + " - " + TextOCEAN_N_neg_bstr;
    }