public override void init(Behavior specif, InstanceSpecification host, Dictionary <string, ValueSpecification> p, bool sync)
    {
        base.init(specif, host, p, sync);

        ui = GameObject.Find("Canvas").GetComponent <EE_UI>();
        if (Host.name == "PlayerAuto")
        {
            agent = GameObject.Find("Player").GetComponent <AgentController>();
        }
        else
        {
            agent = GameObject.Find(Host.name).GetComponent <AgentController>();
        }


        foreach (KeyValuePair <string, ValueSpecification> kvp in p)
        {
            if (kvp.Key == "Animation")
            {
                animation = stringUtils.CleanString(kvp.Value.getStringFromValue());
            }
        }

        PrintSingleton.Instance.log("==================================== PLAY ANIMATION ==========================================");
        PrintSingleton.Instance.log(agent.name + " --> " + animation);
    }
    public override void init(Behavior specif, InstanceSpecification host, Dictionary <string, ValueSpecification> p, bool sync)
    {
        base.init(specif, host, p, sync);

        webCom = GameObject.Find("webglCom").GetComponent <webGLCommunication>();

        ui = GameObject.Find("Canvas").GetComponent <EE_UI>();
        PrintSingleton.Instance.log("==================================== FINAL OPERATION ==========================================");
    }
    public override void init(Behavior specif, InstanceSpecification host, Dictionary <string, ValueSpecification> p, bool sync)
    {
        base.init(specif, host, p, sync);

        ui = GameObject.Find("Canvas").GetComponent <EE_UI>();
        if (Host.name == "PlayerAuto")
        {
            agent = GameObject.Find("Player").GetComponent <AgentController>();
        }

        else
        {
            agent = GameObject.Find(Host.name).GetComponent <AgentController>();
        }


        foreach (KeyValuePair <string, ValueSpecification> kvp in p)
        {
            if (kvp.Key == "Message")
            {
                message = stringUtils.CleanString(kvp.Value.getStringFromValue());
            }
            else if (kvp.Key == "Specification")
            {
                specification = cleanSpec(stringUtils.CleanString(kvp.Value.getStringFromValue()));
            }
        }

        if (message != "")
        {
            string[] s = message.Split('_');
            if (stringUtils.checkStringStart(s[0], "AUDIO:", out audioName))
            {
                audioplay = true;
                message   = s[1];
            }
            else
            {
                message = s[0];
            }
        }

        PrintSingleton.Instance.log("====================================SPEAK==========================================");
        PrintSingleton.Instance.log(agent.name + " --> " + message);


        if (agent is AndroidController)
        {
            PrintSingleton.Instance.log("STRATEGY --> " + specification);
            ui.CurrentECAStrategy = specification;
        }
    }
    string jsonFormatString(string input)
    {
        EE_UI  ui   = GameObject.Find("Canvas").GetComponent <EE_UI>();
        string json = "{";

        json += "\"input_emotion\":\"" + ui.CurrentECAEmotion + "\",\n";
        json += "\"input_tone\":\"" + "in_tone" + "\",\n";
        json += "\"input_strategy\":\"" + ui.CurrentECAStrategy + "\",\n";

        json += "\"output_emotion\":\"" + ui.CurrentUserEmotion + "\",\n";
        json += "\"output_tone\":\"" + "in_tone" + "\",\n";
        json += "\"output_strategy\":\"" + input + "\"";


        json += "}";
        return(json);
    }
Exemple #5
0
    public override void init(Behavior specif, InstanceSpecification host, Dictionary <string, ValueSpecification> p, bool sync)
    {
        base.init(specif, host, p, sync);
        agent = (Agent)host;
        ui    = GameObject.Find("Canvas").GetComponent <EE_UI>();



        ui.DecisionAgent = agent;
        if (agent.name == "PlayerAuto")
        {
            ui.DecisionAgent = MascaretUtils.getAgent("Player");
        }

        agentC = GameObject.Find(ui.DecisionAgent.name).GetComponent <AgentController>();

        ui = GameObject.Find("Canvas").GetComponent <EE_UI>();
    }
    public override void init(Behavior specif, InstanceSpecification host, Dictionary <string, ValueSpecification> p, bool sync)
    {
        base.init(specif, host, p, sync);

        android = GameObject.Find(host.name).GetComponent <AndroidController>();

        foreach (KeyValuePair <string, ValueSpecification> kvp in p)
        {
            if (kvp.Key == "Expression")
            {
                expression = stringUtils.CleanString(kvp.Value.getStringFromValue());
            }
        }

        ui = GameObject.Find("Canvas").GetComponent <EE_UI>();
        PrintSingleton.Instance.log("==================================== SET FACIAL EXPRESSION ========================================== " + expression);
        ui.CurrentECAEmotion = expression;
    }