예제 #1
0
        public override bool Evaluate(BInput _input = null)
        {
            TargetInput input = _input as TargetInput;
            bool        b     = input.Target.GetProperty("name") == "hero";

            return(b);
        }
예제 #2
0
        public override bool DoEvaluate(BInput _input)
        {
            TargetInput input    = (TargetInput)_input;
            float       distance = Vector3.Distance(input.owner.Transform.position, input.Target.Transform.position);

            return(distance < 10.0f);
        }
예제 #3
0
        /// <summary>
        /// </summary>
        /// <param name="_input"></param>
        /// <returns></returns>
        public override ResultType Execute(BInput _input)
        {
            TargetInput input = (TargetInput)_input;

            input.owner.Transform.LookAt(input.Target.Transform);
            return(ResultType.Success);
        }
예제 #4
0
        public override ResultType Execute(BInput _input)
        {
            TargetInput input = _input as TargetInput;

            input.Target.SetProperty("hp", 100);
            GameInput.DebugLog("do action atk");
            state = State.Exit;
            return(ResultType.Success);
        }
예제 #5
0
        private void Init()
        {
            //_selectorNode = new SelectorNode();
            //_selectorNode = new SequenceNode();
            _selectorNode = new ParallelNode();
            ParallelNode _subParallel = new ParallelNode();

            _actionAtk = new ActionAtk();
            _actionAtk.SetPreCondition(new ActionAtkPreCondition());
            _selectorNode.AddChild(new ActionIdle());
            _selectorNode.AddChild(_actionAtk);

            TargetInput _input = new TargetInput();

            _input.Target = GlobalData.hero.MyEnity;
            _input.state  = 1;
            _selectorNode.RunNode(_input);
            GameInput.Instance.OnUpdate += _selectorNode.Update;
        }
예제 #6
0
        public override bool DoEvaluate(BInput _input)
        {
            TargetInput _i = _input as TargetInput;

            return(_i.state == 1);
        }