Ejemplo n.º 1
0
        static public IEnumerable <Vector3> GetTriangleIntersection(this Bounds item, Triangle3 triangle)
        {
            if (triangle.IsDegenerate() == false)
            {
                Plane plane = triangle.GetPlane();

                if (plane.normal != Vector3.zero)
                {
                    if (item.FullyContains(triangle))
                    {
                        return(triangle.GetPoints());
                    }

                    PlaneSpace plane_space = plane.GetPlaneSpace();

                    ConvexPolygon plane_polygon = new ConvexPolygon(
                        plane_space.ProjectPoints(item.GetPlaneIntersection(plane))
                        );

                    ConvexPolygon triangle_polygon = new ConvexPolygon(
                        plane_space.ProjectPoints(triangle.GetPoints())
                        );

                    return(plane_space.InflatePoints(
                               plane_polygon.GetIntersection(triangle_polygon).GetVertexs()
                               ).Narrow(p => item.Contains(p)));
                }
            }

            return(Empty.IEnumerable <Vector3>());
        }
Ejemplo n.º 2
0
        static public IEnumerable <ScriptableObject> GetAllSofabs(Type type)
        {
            if (type.CanBeTreatedAs <ScriptableObject>())
            {
                return(GetAllAssetInfos(type).Convert(i => i.Resolve <ScriptableObject>()));
            }

            return(Empty.IEnumerable <ScriptableObject>());
        }
Ejemplo n.º 3
0
        static public IEnumerable <string> GetExternalCustomAssetPathsOfType(Type type)
        {
            if (type.CanBeTreatedAs <CustomAsset>())
            {
                return(AssetDatabase.FindAssets("t:" + type.Name)
                       .Convert(g => AssetDatabase.GUIDToAssetPath(g))
                       .Skip(p => p.StartsWith(Project.GetInternalAssetDirectory())));
            }

            return(Empty.IEnumerable <string>());
        }
Ejemplo n.º 4
0
        public override IEnumerable <Type> GetOptions()
        {
            Type type;

            if (type_property.TryGetContentValues(out type))
            {
                return(type.GetTypeAndAllBaseTypes());
            }

            return(Empty.IEnumerable <Type>());
        }
Ejemplo n.º 5
0
        public override IEnumerable <Type> GetOptions()
        {
            GameObject game_object;

            if (game_object_property.TryGetContentValues(out game_object))
            {
                return(game_object.GetAllComponents().Convert(c => c.GetType()).Unique());
            }

            return(Empty.IEnumerable <Type>());
        }
Ejemplo n.º 6
0
        public override IEnumerable <MethodInfo> GetOptions(string text)
        {
            Type type;

            if (type_property.TryGetContentValues <Type>(out type))
            {
                return(type.GetFilteredInstanceMethods(
                           Filterer_MethodInfo.DoesNameContain(text)
                           ).Convert <MethodInfoEX, MethodInfo>());
            }

            return(Empty.IEnumerable <MethodInfo>());
        }
Ejemplo n.º 7
0
        public IEnumerable <T> GetItemsWithin(Predicate <Rect> predicate)
        {
            if (predicate.DoesDescribe(rect))
            {
                if (is_subdivided)
                {
                    return(child_rects.Convert(c => c.GetItemsWithin(predicate)).Flatten());
                }

                return(child_items.Narrow(c => predicate.DoesDescribe(get_rect_operation(c))));
            }

            return(Empty.IEnumerable <T>());
        }
Ejemplo n.º 8
0
 public Filterer_ConstructorInfo_CanEffectiveParametersHold() : this(Empty.IEnumerable <Type>())
 {
 }
Ejemplo n.º 9
0
 protected virtual IEnumerable <Attribute> GetAllCustomAttributesInternal(bool inherit)
 {
     return(Empty.IEnumerable <Attribute>());
 }
Ejemplo n.º 10
0
 public MethodReference() : this(null, "", Empty.IEnumerable <Type>())
 {
 }
Ejemplo n.º 11
0
 public virtual IEnumerable <Filterer <Assembly> > GetAssemblyFilters()
 {
     return(Empty.IEnumerable <Filterer <Assembly> >());
 }
Ejemplo n.º 12
0
 public virtual IEnumerable <Type> GetTypes()
 {
     return(Empty.IEnumerable <Type>());
 }
Ejemplo n.º 13
0
 public IEnumerable <GamepadEvent <T> > GetPastEvents(int count)
 {
     return(Empty.IEnumerable <GamepadEvent <T> >());
 }
Ejemplo n.º 14
0
 public Filterer_MethodInfo_CanTechnicalParametersHold() : this(Empty.IEnumerable <Type>())
 {
 }
Ejemplo n.º 15
0
 static public IEnumerable <DropHandler> GetDropHandlers(this UIElement item)
 {
     return(DROP_HANDLER_LIST_FIELD.GetValue(item) ?? Empty.IEnumerable <DropHandler>());
 }
Ejemplo n.º 16
0
 public CmlTargetInfo(object t, RepresentationEngine e) : this(t, t, Empty.IEnumerable <object>(), e)
 {
 }
Ejemplo n.º 17
0
 public Filterer_MethodInfo_CanEffectiveParametersHold() : this(Empty.IEnumerable <Type>())
 {
 }
Ejemplo n.º 18
0
 public ILValue CompileInstanceSystemObject(TyonCompiler compiler)
 {
     return(CompileInstanceSystemObject(compiler, Empty.IEnumerable <ILValue>()));
 }