本文整理汇总了C#中Loader.Find方法的典型用法代码示例。如果您正苦于以下问题:C# Loader.Find方法的具体用法?C# Loader.Find怎么用?C# Loader.Find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Loader
的用法示例。
在下文中一共展示了Loader.Find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Load
public virtual void Load(Loader l, Instruction i)
{
switch (i.Type)
{
case "xaml":
Xaml = l.Find(i.String()).Read();
break;
}
}
示例2: Load
public virtual void Load(Loader l, Instruction i)
{
switch (i.Type)
{
case "adn":
Addons.Add(l.Find(i.String()).Load<AddonTemplate>());
break;
}
}
示例3: ModelObject
public ModelObject(Loader l)
{
GeometryModel3D model = null;
MeshGeometry3D geometry = null;
List<Point3D> vertices = new List<Point3D>();
List<Vector3D> normals = new List<Vector3D>();
List<Point> textures = new List<Point>();
foreach (Instruction i in l.Parse())
{
switch (i.Type)
{
case "mtllib":
MaterialLibrary = l.Find(i.Arg).Load<MaterialLibrary>();
break;
case "usemtl":
model.Material = MaterialLibrary.Materials[i.Arg];
break;
case "o":
model = new GeometryModel3D();
Geometries.Add(i.Arg, model);
model.Geometry = geometry = new MeshGeometry3D();
break;
case "f":
foreach (string index in i.Args)
{
string[] values = index.Split('/');
geometry.Positions.Add(vertices[int.Parse(values[0]) - 1]);
if (values.Length > 1 && values[1] != "")
geometry.TextureCoordinates.Add(
textures[int.Parse(values[1]) - 1]);
if (values.Length > 2)
geometry.Normals.Add(normals[int.Parse(values[2]) - 1]);
}
break;
case "v": // Vertex
vertices.Add(new Point3D(i.Double(), i.Double(), i.Double()));
break;
case "vn": // Vertex normal
normals.Add(new Vector3D(i.Double(), i.Double(), i.Double()));
break;
case "vt": // Vertex texture coordinate
textures.Add(new Point(i.Double(), i.Double()));
break;
case "g": // Group
// TODO: Add support for object groups
break;
case "s": // Smooth
// Not supported, just ignore
break;
default:
break;
}
}
}
示例4: AddonTemplate
public AddonTemplate(Loader l)
{
ID = l.ID;
foreach (Instruction i in l.Parse())
{
switch (i.Type)
{
case "node":
Node = i.String();
break;
case "model":
Model = l.Find(i.String()).Load<ModelObject>();
break;
}
}
}