public void IncludeData(TraitDataSnapshot data)
 {
     if (m_TraitName != null && data.TryGetTrait(m_TraitName, out bool value))
     {
         m_MatchRule = value ? SemanticTagMatchRule.Match : SemanticTagMatchRule.Exclude;
     }
     else
     {
         m_MatchRule = SemanticTagMatchRule.Exclude;
     }
 }
 public void OptimizeForData(TraitDataSnapshot data)
 {
     if (m_TraitName != null && data.TryGetTrait(m_TraitName, out bool value))
     {
         m_MatchRule = value ? SemanticTagMatchRule.Match : SemanticTagMatchRule.Exclude;
     }
     else
     {
         enabled = false;
     }
 }
Пример #3
0
        // this one adds a real tag condition, not one of the mocked ones.
        // mostly this is because a tag condition is very simple already and there are tests for them.
        internal static SemanticTagCondition AddSemanticTagCondition(this GameObject go,
                                                                     string traitName = "", SemanticTagMatchRule rule = SemanticTagMatchRule.Match)
        {
            var condition = go.AddComponent <SemanticTagCondition>();

            condition.SetTraitName(traitName);
            condition.matchRule = rule;
            return(condition);
        }