public static IEnumerable <SearchItem> IsTrue(SearchExpressionContext c)
        {
            foreach (var e in c.args)
            {
                bool isTrue = false;
                foreach (var item in e.Execute(c))
                {
                    if (item == null)
                    {
                        yield return(null);
                    }
                    else
                    {
                        isTrue |= SearchExpression.IsTrue(item);
                        if (!isTrue)
                        {
                            break;
                        }
                    }
                }

                yield return(SearchExpression.CreateItem(isTrue, c.ResolveAlias(e, "IsTrue")));
            }
        }
 public static IEnumerable <SearchItem> ToBoolean(SearchExpressionContext c)
 {
     return(c.args.SelectMany(e => e.Execute(c)).Select(item => SearchExpression.CreateItem(SearchExpression.IsTrue(item))));
 }
Exemple #3
0
        public static IEnumerable <SearchItem> SceneName(SearchExpressionContext c)
        {
            var desc = TaskEvaluatorManager.EvaluateMainThread(() => EditorApplication.GetApplicationTitleDescriptor());

            yield return(SearchExpression.CreateItem(desc.activeSceneName ?? string.Empty, c.ResolveAlias("SceneName")));
        }
Exemple #4
0
        public static IEnumerable <SearchItem> DataPath(SearchExpressionContext c)
        {
            var dataPath = TaskEvaluatorManager.EvaluateMainThread(() => Application.dataPath);

            yield return(SearchExpression.CreateItem(dataPath ?? string.Empty, c.ResolveAlias("DataPath")));
        }
 public static IEnumerable <SearchItem> Empty(SearchExpressionContext c)
 {
     return(c.args.Select(e => SearchExpression.CreateItem(!e.Execute(c).Any())));
 }