コード例 #1
0
ファイル: BotControl.cs プロジェクト: stjordanis/gridworld
 // TODO: ThinkLoop
 public void ThinkLoop()
 {
     if (controlStatus == Status.IDLE && deliberatorOn)
     {
         printMap();
         string nextaction = deliberator.GetNextAction();
         controlStatus = Status.EXECUTING;
         botActions.DoAction(nextaction);
     }
 }
コード例 #2
0
ファイル: ManualControl.cs プロジェクト: stjordanis/gridworld
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         botActions.DoAction("grab");
     }
     if (Input.GetKeyDown(KeyCode.LeftShift))
     {
         botActions.DoAction("drop");
     }
 }
コード例 #3
0
ファイル: BotControl.cs プロジェクト: stjordanis/unity-cogbot
 // TODO: ThinkLoop
 public void ThinkLoop()
 {
     if (controlStatus == Status.IDLE)
     {
         string nextaction = deliberator.GetNextAction();
         Debug.Log("NEXT ACTION: " + nextaction);
         if (nextaction != "")
         {
             controlStatus = Status.EXECUTING;
             botActions.DoAction(nextaction);
         }
     }
 }
コード例 #4
0
ファイル: ClickListener.cs プロジェクト: stjordanis/gridworld
    void OnMouseDown()
    {
        bot = GameObject.Find(botName);
        float      x          = transform.position.x;
        float      z          = transform.position.z;
        BotActions botActions = bot.GetComponent <BotActions>();
        string     command    = action + " " + x + " " + z;

        botActions.DoAction(command);
    }