コード例 #1
0
        public override void Run(IReGoapAction <string, object> previous, IReGoapAction <string, object> next, ReGoapState <string, object> settings, ReGoapState <string, object> goalState, Action <IReGoapAction <string, object> > done, Action <IReGoapAction <string, object> > fail)
        {
            base.Run(previous, next, settings, goalState, done, fail);

            if (settings.HasKey("ObjectivePosition"))
            {
                smsGoto.GoTo((Vector3)settings.Get("ObjectivePosition"), OnDoneMovement, OnFailureMovement);
            }
            else
            {
                failCallback(this);
            }
        }
コード例 #2
0
    public override void Run(IReGoapAction previous, IReGoapAction next, IReGoapActionSettings settings, ReGoapState goalState, Action <IReGoapAction> done, Action <IReGoapAction> fail)
    {
        base.Run(previous, next, settings, goalState, done, fail);

        SetObjective(settings);
        if (objectivePosition != default(Vector3))
        {
            smsGoto.GoTo(objectivePosition, OnDoneMovement, OnFailureMovement);
        }
        else
        {
            failCallback(this);
        }
    }
コード例 #3
0
ファイル: GenericGoToAction.cs プロジェクト: sosan/ReGoap
        public override void Run(IReGoapAction <string, object> previous, IReGoapAction <string, object> next, IReGoapActionSettings <string, object> settings, ReGoapState <string, object> goalState, Action <IReGoapAction <string, object> > done, Action <IReGoapAction <string, object> > fail)
        {
            base.Run(previous, next, settings, goalState, done, fail);

            var localSettings = (GenericGoToSettings)settings;

            if (localSettings.ObjectivePosition.HasValue)
            {
                smsGoto.GoTo(localSettings.ObjectivePosition, OnDoneMovement, OnFailureMovement);
            }
            else
            {
                failCallback(this);
            }
        }
コード例 #4
0
        public override void Run(IReGoapActionSettings settings, Action <ReGoapAction> done, Action <ReGoapAction> fail)
        {
            base.Run(settings, done, fail);

            GenericGoToSettings localSettings = (GenericGoToSettings)settings;

            if (localSettings.ObjectivePosition.HasValue)
            {
                smsGoto.GoTo(localSettings.ObjectivePosition, OnDoneMovement, OnFailureMovement);
            }
            else
            {
                failCallback(this);
            }
        }