Esempio n. 1
0
        private ITicker _DistanceWayfindingStrategy()
        {
            var builder = new Regulus.BehaviourTree.Builder();

            var th = new TurnHandler(this);
            var od = new ObstacleDetector();

            od.OutputEvent += th.Input;
            return(builder
                   .Sequence()
                   // 是否碰到障礙物
                   .Action((delta) => _DetectObstacle(delta, _Entiry.GetViewLength() / 2, _GetOffsetDirection(10.31f * 2)))

                   // 停止移動
                   //.Action(_StopMove)

                   // 檢查周遭障礙物
                   .Action((delta) => od.Detect(delta, _DecisionTime, _Entiry, this, _Entiry.GetViewLength(), 180))

                   // 旋轉至出口
                   .Action((delta) => th.Run(delta))
                   .End().Build());
        }
        private ITicker _DistanceWayfindingStrategy()
        {
            var builder = new Regulus.BehaviourTree.Builder();

            var th = new TurnHandler(this);
            var od = new ObstacleDetector();
            od.OutputEvent += th.Input;
            return builder
                .Sequence()
                    // �O�_�I����
                    .Action((delta) => _DetectObstacle(delta, _Entiry.GetViewLength() / 2, _GetOffsetDirection(10.31f * 2)))

                    // �����
                    //.Action(_StopMove)

                    // �ˬd�P�D��ê��
                    .Action((delta) => od.Detect(delta , _DecisionTime, _Entiry, this, _Entiry.GetViewLength(), 180) )

                    // ����ܥX�f
                    .Action((delta) => th.Run(delta) )
                .End().Build();
        }