Exemple #1
0
    public MultiCharacterAgentController(SingleCharacterDemo.ScenarioData scenarioData, RolePlayCharacterAsset rpc,
                                         IntegratedAuthoringToolAsset iat, UnityBodyImplement archetype, Transform anchor, DialogController dialogCrt)
    {
        m_scenarioData     = scenarioData;
        m_iat              = iat;
        m_rpc              = rpc;
        m_dialogController = dialogCrt;
        _body              = GameObject.Instantiate(archetype);

        UnityEngine.Random.InitState((int)System.DateTime.Now.Ticks);
        var r = UnityEngine.Random.Range(0, 600);

        _body.GetComponentInChildren <Animator>().Play(0, -1, r);

        _body.tag   = rpc.CharacterName.ToString();
        just_talked = false;
        lastAction  = null;
        var t = _body.transform;

        t.SetParent(anchor, false);
        t.localPosition = Vector3.zero;
        t.localRotation = Quaternion.identity;
        t.localScale    = Vector3.one;


        HeadLookController head = _body.GetComponentInChildren <HeadLookController>();

        head._target = GameObject.FindGameObjectWithTag("MainCamera");

        m_dialogController.SetCharacterLabel(m_rpc.CharacterName.ToString());

        //  m_rpc.Perceive(new Name[] { EventHelper.PropertyChange("DialogueState(Player)", "Start", "world") });

        lastDialog = new DialogueStateActionDTO();
    }
Exemple #2
0
    public void updateHeadController(string TargetName)
    {
        HeadLookController head = _body.GetComponentInChildren <HeadLookController>();

        head._target = GameObject.FindGameObjectWithTag(TargetName);
    }