docs.unity3d.com
    Show / Hide Table of Contents

    Class SemanticTagCondition

    Represents a situation that depends on the existence or lack of a certain trait

    Inheritance
    Object
    ConditionBase
    Condition
    Condition<Boolean>
    SemanticTagCondition
    Inherited Members
    Condition.traitName
    ConditionBase.proxy
    ConditionBase.drawWarning
    ConditionBase.OnValidate()
    Namespace: Unity.MARS.Conditions
    Syntax
    public class SemanticTagCondition : Condition<bool>, ISimulatable, ISemanticTagCondition, ICondition<bool>, ICondition, IConditionBase, IRequiresTraits<bool>, IRequiresTraits, ICreateFromData

    Properties

    matchRule

    Whether to require the presence or absence of the tag

    Declaration
    public SemanticTagMatchRule matchRule { get; set; }
    Property Value
    Type Description
    SemanticTagMatchRule
    Implements
    ISemanticTagCondition.matchRule

    Methods

    FormatDataString(TraitDataSnapshot)

    Formats data into a string that is human-readable and appropriate for the condition

    Declaration
    public string FormatDataString(TraitDataSnapshot data)
    Parameters
    Type Name Description
    TraitDataSnapshot data

    The data

    Returns
    Type Description
    String

    The formatted string

    Implements
    ICreateFromData.FormatDataString(TraitDataSnapshot)

    GetConditionRatingForData(TraitDataSnapshot)

    Return the rating this condition has for the given data snapshot

    Declaration
    public float GetConditionRatingForData(TraitDataSnapshot data)
    Parameters
    Type Name Description
    TraitDataSnapshot data

    The data

    Returns
    Type Description
    Single

    The result of the condition's data rate matching method

    Implements
    ICreateFromData.GetConditionRatingForData(TraitDataSnapshot)

    GetRequiredTraits()

    Get the TraitRequirements that are required by this object

    Declaration
    public override TraitRequirement[] GetRequiredTraits()
    Returns
    Type Description
    TraitRequirement[]

    The required traits

    Overrides
    Condition.GetRequiredTraits()
    Implements
    IRequiresTraits.GetRequiredTraits()

    IncludeData(TraitDataSnapshot)

    Modifies the properties so that the data is acceptable for this condition

    Declaration
    public void IncludeData(TraitDataSnapshot data)
    Parameters
    Type Name Description
    TraitDataSnapshot data

    The data that should pass this condition after this method is called

    Implements
    ICreateFromData.IncludeData(TraitDataSnapshot)

    OptimizeForData(TraitDataSnapshot)

    Modifies the properties so that the data is the optimal data for this condition

    Declaration
    public void OptimizeForData(TraitDataSnapshot data)
    Parameters
    Type Name Description
    TraitDataSnapshot data

    The data that should be optimal for the condition after this method is called

    Implements
    ICreateFromData.OptimizeForData(TraitDataSnapshot)

    RateDataMatch(ref Boolean)

    Describe how well a given piece of data matches a condition. 0 means the match is unacceptable, 1 means a perfect match

    Declaration
    public override float RateDataMatch(ref bool data)
    Parameters
    Type Name Description
    Boolean data
    Returns
    Type Description
    Single

    A number from 0 to 1 indicating how well a piece of data watches this condition

    Overrides
    Unity.MARS.Condition<System.Boolean>.RateDataMatch(System.Boolean)
    Implements
    ICondition<T>.RateDataMatch(ref T)

    SetTraitName(String)

    Declaration
    public void SetTraitName(string newName)
    Parameters
    Type Name Description
    String newName
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023