コード例 #1
0
        public override NodeTreeOutput Tick(out ExecutionResult executionResult, ExecutionResult childResult)
        {
            int reps = repetitions.GetValue();

            if (reps == -1 || repDone < reps)
            {
                repDone++;
                if (childResult == ExecutionResult.Success)
                {
                    if (repDone == 0)
                    {
                        executionResult = ExecutionResult.StopExecutionAtMe;
                    }
                    else
                    {
                        executionResult = ExecutionResult.Running;
                    }
                    return(child);
                }
                else
                {
                    executionResult = ExecutionResult.Failure;
                    return(null);
                }
            }
            else
            {
                InterruptExecution();
                executionResult = ExecutionResult.Success;
                return(null);
            }
        }
コード例 #2
0
        public override NodeTreeOutput Tick(out ExecutionResult executionResult, ExecutionResult childResult)
        {
            animator.GetValue().GetCurrentAnimatorClipInfo(animatorLayer.GetValue(), infos);

            var clip = animationClip.GetValue();

            if (infos.Count > 0)
            {
                foreach (var info in infos)
                {
                    if (info.clip == clip)
                    {
                        executionResult = ExecutionResult.StopExecutionAtMe;
                        return(null);
                    }
                }
            }
            executionResult = ExecutionResult.Success;
            return(child);
        }
 public override void Calculate()
 {
     returnVar.value = (UnityEngine.Mathf.Min(a.GetValue(), b.GetValue()));
 }
コード例 #4
0
 public override void Calculate()
 {
     returnVar.value = (UnityEngine.Random.Range(min.GetValue(), max.GetValue()));
 }
コード例 #5
0
 public override void Calculate()
 {
     returnVar.value = (UnityEngine.LayerMask.LayerToName(layer.GetValue()));
 }