Exemple #1
0
        void Start()
        {
            agent.SetValue("has_weapon", false);
            agent.SetValue("bullet_num", 0);
            agent.SetValue("kill_enemy", 0);

            actions.Add(new ActionPickWeapon());
            actions.Add(new ActionBuyWeapon());
            actions.Add(new ActionBuyBullet());
            actions.Add(new ActionFire());

            actionGoal           = new ActionGoal();
            actionGoal.condition = (Agent a) => { return(a.GetIntValue("kill_enemy") == 2); };

            Path2  path       = Planner.GetPlanning(actions, agent, actionGoal, 50);
            string pathString = "";

            foreach (ActionBase action in path.actions)
            {
                pathString += "->" + action.GetType().Name;
            }
            Debug.Log("start" + pathString);
        }
Exemple #2
0
        void Start()
        {
            agent.hasWeapon = false;
            agent.bulletNum = 0;
            agent.killedNum = 0;

            actions.Add(new ActionPickWeapon3());
            actions.Add(new ActionBuyWeapon3());
            actions.Add(new ActionBuyBullet3());
            actions.Add(new ActionFire3());

            actionGoal           = new ActionGoal();
            actionGoal.condition = (Agent a) => { return(a.killedNum == 2); };

            Path2  path       = Planner.GetPlanning(actions, agent, actionGoal, 50);
            string pathString = "";

            foreach (ActionBase action in path.actions)
            {
                pathString += "->" + action.GetType().Name;
            }
            Debug.Log("start" + pathString);
        }