docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IRelation<T>

    A constraint between two MR objects that is used to filter data in a query

    Inherited Members
    IRelationBase.child1
    IRelationBase.child2
    IConditionBase.enabled
    IRequiresTraits.GetRequiredTraits()
    Namespace: Unity.MARS.Query
    Assembly: Unity.MARS.Interfaces.dll
    Syntax
    public interface IRelation<T> : IRelation, IRelationBase, IConditionBase, IRequiresTraits<T>, IRequiresTraits
    Type Parameters
    Name Description
    T

    The type of data to filter against

    Properties

    child1TraitName

    The trait to test against for the first child

    Declaration
    string child1TraitName { get; }
    Property Value
    Type Description
    string

    child2TraitName

    The trait to test against for the second child

    Declaration
    string child2TraitName { get; }
    Property Value
    Type Description
    string

    Methods

    RateDataMatch(ref T, ref T)

    Compares the given trait data to the filter function

    Declaration
    float RateDataMatch(ref T child1Data, ref T child2Data)
    Parameters
    Type Name Description
    T child1Data

    The data being filtered against for the first child

    T child2Data

    The data being filtered against for the second child

    Returns
    Type Description
    float

    A number from 0 to 1 indicating how well a set of data matches

    Extension Methods

    IRequiresTraitsMethods.ForEachContextIdWithTrait<T>(IRequiresTraits<T>, string, Action<int>)
    IRequiresTraitsMethods.TryGetAllTraitsWithSemanticTag<T>(IRequiresTraits<T>, string, string, out Dictionary<int, T>)
    IRequiresTraitsMethods.TryGetTraitValue<T>(IRequiresTraits<T>, int, string, out T)
    IRelationGenericMethods.PassesRelation<T>(IRelation<T>, ref T, ref T)
    In This Article
    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)