summaryrefslogtreecommitdiff
path: root/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsIntPositive.cs
blob: 433e60f7b801dff37bd27ef888ad906702d80eaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using UnityEngine;

namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
{
    [TaskCategory("Basic/Math")]
    [TaskDescription("Is the int a positive value?")]
    public class IsIntPositive : Conditional
    {
        [Tooltip("The int to check if positive")]
        public SharedInt intVariable;

        public override TaskStatus OnUpdate()
        {
            return intVariable.Value > 0 ? TaskStatus.Success : TaskStatus.Failure;
        }

        public override void OnReset()
        {
            intVariable = 0;
        }
    }
}