Ejemplo n.º 1
0
    public BlackBoardEntry HasSeen(GameObject obj)
    {
        BlackBoardEntry entry = null;

        if (knowledgeBlackboard.TryGetValue(obj.name, out entry))
        {
            return(entry);
        }
        return(null);
    }
Ejemplo n.º 2
0
    public void LostVision(GameObject obj)
    {
        BlackBoardEntry entry = null;

        knowledgeBlackboard.TryGetValue(obj.name, out entry);
        if (entry != null)
        {
            entry.pastMemory = true;
        }
        else
        {
            Debug.LogError("AI Lost vision of something they didn't see.");
        }
    }
Ejemplo n.º 3
0
    void SeeingObject(GameObject gameObject)
    {
        BlackBoardEntry entry = HasSeen(gameObject);

        if (entry != null)
        {
            //Updates entry
            entry.position   = gameObject.transform.position;
            entry.timestamp  = Time.time;
            entry.pastMemory = false;
        }
        else
        {
            //Creates new entry
            entry = new BlackBoardEntry(gameObject, gameObject.transform.position);
            knowledgeBlackboard.Add(gameObject.name, entry);
        }
    }