Beispiel #1
0
    private Status controlStatus;                       // Controller Status.

    // Use this for initialization
    protected override void Awake()
    {
        base.Awake();
        controlStatus = Status.IDLE;
        int[] sizes = mapWorld.GetMapSize();
        rsize = sizes[0];
        csize = sizes[1];
        myMap = new char[rsize * csize];
        // Initialize to " " space.
        for (int i = 0; i < rsize; i++)
        {
            for (int j = 0; j < csize; j++)
            {
                myMap[i * csize + j] = ' ';
            }
        }
        // --
        objectInFov = new List <GameObject>();
        botActions  = gameObject.GetComponent <BotActions>();
        deliberator = gameObject.GetComponent(deliberatorName) as IBotDeliberator;
        // Disable deliberator if deliberator exist or manual control is enabled.
        ManualControl mc = gameObject.GetComponent <ManualControl>();

        deliberatorOn = (deliberator != null) &&
                        (mc != null) &&
                        !gameObject.GetComponent <ManualControl>().enabled;
        // Update current position in myMap
        Vector3 current = gameObject.transform.position;

        int[] idxs = mapWorld.GetIndexesFromWorld(current.x, current.z);
        mapWorld.CopyRegion(myMap, idxs[0] - 1, idxs[1] - 1, 3, 3);
        // Run Thread Function Every `n` second
        InvokeRepeating("ThinkLoop", 3, thinkTick);
    }
Beispiel #2
0
    private Status controlStatus;                       // Controller Status.

    //public StateBook internalKnowledge;

    // Use this for initialization
    protected void Awake()
    {
        controlStatus = Status.IDLE;
        objectInFov   = new List <GameObject>();
        botActions    = gameObject.GetComponent <BotActions>();
        deliberator   = gameObject.GetComponent(deliberatorName) as IBotDeliberator;
        // Run Thread Function Every `n` second
        if (!onDemand)
        {
            InvokeRepeating("ThinkLoop", 0, thinkTick);
        }
    }
Beispiel #3
0
 // Use this for initialization
 protected override void Awake()
 {
     base.Awake();
     controlStatus = Status.IDLE;
     int[] sizes = mapWorld.GetMapSize();
     rsize = sizes[0];
     csize = sizes[1];
     myMap = new char[rsize * csize];
     // Initialize to " " space.
     for (int i = 0; i < rsize; i++)
     {
         for (int j = 0; j < csize; j++)
         {
             myMap[i * csize + j] = ' ';
         }
     }
     // --
     objectInFov = new List<GameObject>();
     botActions = gameObject.GetComponent<BotActions>();
     deliberator = gameObject.GetComponent(deliberatorName) as IBotDeliberator;
     // Disable deliberator if deliberator exist or manual control is enabled.
     ManualControl mc = gameObject.GetComponent<ManualControl>();
     deliberatorOn = (deliberator != null) &&
         (mc != null) &&
         !gameObject.GetComponent<ManualControl>().enabled;
     // Update current position in myMap
     Vector3 current = gameObject.transform.position;
     int[] idxs = mapWorld.GetIndexesFromWorld(current.x, current.z);
     mapWorld.CopyRegion(myMap, idxs[0] - 1, idxs[1] - 1, 3, 3);
     // Run Thread Function Every `n` second
     InvokeRepeating("ThinkLoop", 3, thinkTick);
 }
Beispiel #4
0
 //public StateBook internalKnowledge;
 // Use this for initialization
 protected void Awake()
 {
     controlStatus = Status.IDLE;
     objectInFov = new List<GameObject>();
     botActions = gameObject.GetComponent<BotActions>();
     deliberator = gameObject.GetComponent(deliberatorName) as IBotDeliberator;
     // Run Thread Function Every `n` second
     if (!onDemand) {
         InvokeRepeating("ThinkLoop", 0, thinkTick);
     }
 }