예제 #1
0
 /// <summary>
 /// Construction.
 /// </summary>
 /// <remarks>
 /// <para>
 /// The scene query will be initialized during construction.
 /// </para>
 /// <para>
 /// If no scene query is provided, the query scope will be all game objects in the scene.
 /// </para>
 /// </remarks>
 /// <param name="sceneQuery">The scene query. (Optional)</param>
 /// <param name="options">Build options.</param>
 public InputBuildContext(ISceneQuery sceneQuery, InputBuildOption options)
 {
     mOptions    = options;
     mSceneQuery = sceneQuery;
     if (sceneQuery != null)
     {
         mSceneQuery.Initialize();
     }
 }
예제 #2
0
        public static InputBuilder Create(ISceneQuery filter
                                          , IInputBuildProcessor[] processors
                                          , InputBuildOption options)
        {
            IInputBuildProcessor[] lprocessors = ArrayUtil.Compress(processors);

            if (lprocessors == null || lprocessors.Length == 0)
            {
                return(null);
            }

            for (int i = lprocessors.Length - 1; i >= 0; i--)
            {
                IInputBuildProcessor processor = lprocessors[i];

                if (processor.DuplicatesAllowed)
                {
                    continue;
                }

                System.Type ta = processor.GetType();

                for (int j = i - 1; j >= 0; j--)
                {
                    System.Type tb = lprocessors[j].GetType();

                    if (ta.IsAssignableFrom(tb) || tb.IsAssignableFrom(ta))
                    {
                        return(null);
                    }
                }
            }

            if (lprocessors == processors)
            {
                lprocessors = (IInputBuildProcessor[])lprocessors.Clone();
            }

            InputBuildContext context = new InputBuildContext(filter, options);

            return(new InputBuilder(context, lprocessors));
        }
예제 #3
0
        public static InputBuilder Create(ISceneQuery filter
            , IInputBuildProcessor[] processors
            , InputBuildOption options)
        {
            IInputBuildProcessor[] lprocessors = ArrayUtil.Compress(processors);

            if (lprocessors == null || lprocessors.Length == 0)
                return null;

            for (int i = lprocessors.Length - 1; i >= 0; i--)
            {
                IInputBuildProcessor processor = lprocessors[i];

                if (processor.DuplicatesAllowed)
                    continue;

                System.Type ta = processor.GetType();

                for (int j = i - 1; j >= 0; j--)
                {
                    System.Type tb = lprocessors[j].GetType();

                    if (ta.IsAssignableFrom(tb) || tb.IsAssignableFrom(ta))
                        return null;
                }
            }

            if (lprocessors == processors)
                lprocessors = (IInputBuildProcessor[])lprocessors.Clone();

            InputBuildContext context = new InputBuildContext(filter, options);

            return new InputBuilder(context, lprocessors);
        }