Esempio n. 1
0
 public override bool OnSenseEvent2(Sheriff agent, Sense2 sense2)
 {
     if (sense2.Sender == GameObject.FindWithTag("Undertaker"))
     {
         Debug.Log(agent.ID + " Saw " + sense2.Sender + " By Sense:" + sense2.senseType);
         Debug.Log(agent.ID + ": Hope You Doing Your Job Properly " + sense2.Sender);
         return(true);
     }
     return(false);
 }
Esempio n. 2
0
    public static void sight()
    {
        for (int i = 0; i < EntityManager.GetCount(); ++i)
        {
            Agent a1 = EntityManager.GetEntity(i);

            agents = Physics2D.OverlapCircleAll(a1.transform.position, sightrange, 1 << LayerMask.NameToLayer("Agents"));
            foreach (Collider2D c in agents)
            {
                //Debug.Log(a1.ID + " SAW : " + c.gameObject.ToString());
                Sense2 sense2 = new Sense2(c.gameObject, a1.ID, SenseType.Sight);
                a1.HandleSenseEvent2(sense2);
            }
        }
    }
Esempio n. 3
0
    public bool HandleSenseEvent2(Sense2 sense2)
    {
        //first see if the current state is valid and that it can handle
        //the sense
        if (state != null && state.OnSenseEvent2(agent, sense2))
        {
            return(true);
        }

        //if not, and if a global state has been implemented, send
        //the message to the global state
        if (globalState != null && globalState.OnSenseEvent2(agent, sense2))
        {
            return(true);
        }

        return(false);
    }
Esempio n. 4
0
 public virtual bool OnSenseEvent2(T agent, Sense2 sense2)
 {
     return(false);
 }
Esempio n. 5
0
 public override bool HandleSenseEvent2(Sense2 sense2)
 {
     return(stateMachine.HandleSenseEvent2(sense2));
 }
Esempio n. 6
0
 public abstract bool HandleSenseEvent2(Sense2 sense2);