Exemplo n.º 1
0
    void OnTriggerEnter(Collider other)
    {
        GameObject go = other.gameObject;

        TalkativeController talkativeController = go.GetComponent <TalkativeController>();

        if (!talkativeController)
        {
            return;
        }

        bool isInRange = false;

        foreach (GameObject g in GOInTalkingRange)
        {
            isInRange = (g.Equals(go));
        }
        if (!isInRange)
        {
            GOInTalkingRange.Add(go);
        }
    }
Exemplo n.º 2
0
    int InitDialog(GameObject colliderGO)
    {
        Debug.Log(".... Talking --- INIT ");

        Debug.Log("Talking to : " + colliderGO.name);
        TalkativeController talkativeNPC = colliderGO.GetComponent <TalkativeController>();

        if (!!talkativeNPC)
        {
            talkativeNPC.ping();
            isTalking = !talkativeNPC.isDialogOver();
            if (!isTalking)
            {
                _currentDialogTarget = null;
            }
            else
            {
                _currentDialogTarget = talkativeNPC;
            }
            DialogRefTime = Time.time;
        }

        return(0);
    }