docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Condition

    The base class for conditions used in Conditional and Abort nodes.

    Inheritance
    object
    Condition
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Behavior
    Assembly: Unity.Behavior.dll
    Syntax
    [Serializable]
    public abstract class Condition

    Properties

    GameObject

    The game object associated with the behavior graph.

    Declaration
    public GameObject GameObject { get; }
    Property Value
    Type Description
    GameObject

    Methods

    IsTrue()

    IsTrue checks if the implemented condition is true.

    Declaration
    public abstract bool IsTrue()
    Returns
    Type Description
    bool

    The result of the condition.

    OnEnd()

    OnEnd is called as a cleanup method for the Condition after it completes its logic check.

    Declaration
    public virtual void OnEnd()

    OnStart()

    OnStart is called as a setup method for the Condition before it begins checking its logic.

    Declaration
    public virtual void OnStart()
    In This Article
    • Properties
      • GameObject
    • Methods
      • IsTrue()
      • OnEnd()
      • OnStart()
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)