Ejemplo n.º 1
0
        public override void onAddedToEntity()
        {
            // prep IMGUI for use
            IMGUI.init(Graphics.instance.bitmapFont);

            _miner        = entity.scene.findObjectOfType <BehaviorTreeMiner>();
            _utilityMiner = entity.scene.findObjectOfType <UtilityMiner>();
            _goapMiner    = entity.scene.findObjectOfType <GOAPMiner>();
        }
Ejemplo n.º 2
0
        public override void onAddedToEntity()
        {
            base.onAddedToEntity();

            // setup a Skin and a Table for our UI
            var skin  = Skin.createDefaultSkin();
            var table = stage.addElement(new Table());

            table.defaults().setPadTop(10).setMinWidth(170).setMinHeight(30);
            table.setFillParent(true).center();

            // add a button for each of the actions/AI types we need
            table.add(new TextButton("BT: LowerPriority Abort Tree", skin))
            .getElement <TextButton>()
            .onClicked += onClickBtLowerPriority;
            table.row();

            table.add(new TextButton("BT: Self Abort Tree", skin))
            .getElement <TextButton>()
            .onClicked += onClickBtSelfAbort;
            table.row();

            table.add(new TextButton("Utility AI", skin))
            .getElement <TextButton>()
            .onClicked += onClickUtilityAI;
            table.row();

            table.add(new TextButton("GOAP", skin))
            .getElement <TextButton>()
            .onClicked += onClickGoap;
            table.row().setPadTop(40);

            table.add(new TextButton("Stop All Running AI", skin))
            .getElement <TextButton>()
            .onClicked += onClickStopAllAi;

            // fetch our different AI Components
            _miner        = entity.scene.findObjectOfType <BehaviorTreeMiner>();
            _utilityMiner = entity.scene.findObjectOfType <UtilityMiner>();
            _goapMiner    = entity.scene.findObjectOfType <GOAPMiner>();
        }