当前位置: 首页>>代码示例>>C#>>正文


C# Material.TextureID方法代码示例

本文整理汇总了C#中Material.TextureID方法的典型用法代码示例。如果您正苦于以下问题:C# Material.TextureID方法的具体用法?C# Material.TextureID怎么用?C# Material.TextureID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Material的用法示例。


在下文中一共展示了Material.TextureID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetTCoords

 public override List<Vector3> GetTCoords(Vector3 blockPos, Material mat, bool XP, bool XM, bool YP, bool YM, bool TOP, bool BOTTOM)
 {
     List<Vector3> TCoords = new List<Vector3>();
     int tID_XP = mat.TextureID(MaterialSide.XP);
     int tID_XM = mat.TextureID(MaterialSide.XM);
     int tID_YP = mat.TextureID(MaterialSide.YP);
     int tID_YM = mat.TextureID(MaterialSide.YM);
     int tID_ZP = mat.TextureID(MaterialSide.TOP);
     //int tID_ZM = mat.TextureID(MaterialSide.BOTTOM);
     // Sprite 1: 0,0 -> 1,1, side one
     TCoords.Add(new Vector3(0, 1, tID_XM));
     TCoords.Add(new Vector3(1, 1, tID_XM));
     TCoords.Add(new Vector3(0, 0, tID_XM));
     TCoords.Add(new Vector3(1, 1, tID_XM));
     TCoords.Add(new Vector3(1, 0, tID_XM));
     TCoords.Add(new Vector3(0, 0, tID_XM));
     // Sprite 2: 0,0 -> 1,1, side two
     TCoords.Add(new Vector3(0, 0, tID_XP));
     TCoords.Add(new Vector3(1, 0, tID_XP));
     TCoords.Add(new Vector3(1, 1, tID_XP));
     TCoords.Add(new Vector3(0, 0, tID_XP));
     TCoords.Add(new Vector3(1, 1, tID_XP));
     TCoords.Add(new Vector3(0, 1, tID_XP));
     // Sprite 3: 0,1 -> 1,0, side one
     TCoords.Add(new Vector3(0, 1, tID_YP));
     TCoords.Add(new Vector3(1, 1, tID_YP));
     TCoords.Add(new Vector3(0, 0, tID_YP));
     TCoords.Add(new Vector3(1, 1, tID_YP));
     TCoords.Add(new Vector3(1, 0, tID_YP));
     TCoords.Add(new Vector3(0, 0, tID_YP));
     // Sprite 4: 0,1 -> 1,0, side two
     TCoords.Add(new Vector3(0, 0, tID_YM));
     TCoords.Add(new Vector3(1, 0, tID_YM));
     TCoords.Add(new Vector3(1, 1, tID_YM));
     TCoords.Add(new Vector3(0, 0, tID_YM));
     TCoords.Add(new Vector3(1, 1, tID_YM));
     TCoords.Add(new Vector3(0, 1, tID_YM));
     // Sprite 5: 0,0,0.5 -> 1,1,0.5 side one
     TCoords.Add(new Vector3(0, 0, tID_ZP));
     TCoords.Add(new Vector3(0, 1, tID_ZP));
     TCoords.Add(new Vector3(1, 1, tID_ZP));
     TCoords.Add(new Vector3(0, 0, tID_ZP));
     TCoords.Add(new Vector3(1, 1, tID_ZP));
     TCoords.Add(new Vector3(1, 0, tID_ZP));
     // Sprite 6: 0,0,0.5 -> 1,1,0.5 side two
     TCoords.Add(new Vector3(1, 0, tID_ZP));
     TCoords.Add(new Vector3(1, 1, tID_ZP));
     TCoords.Add(new Vector3(0, 0, tID_ZP));
     TCoords.Add(new Vector3(1, 1, tID_ZP));
     TCoords.Add(new Vector3(0, 1, tID_ZP));
     TCoords.Add(new Vector3(0, 0, tID_ZP));
     return TCoords;
 }
开发者ID:Morphan1,项目名称:Voxalia,代码行数:53,代码来源:BSD53_54.cs

示例2: GetTCoords

 public override List<Vector3> GetTCoords(Vector3 blockPos, Material mat, bool XP, bool XM, bool YP, bool YM, bool TOP, bool BOTTOM)
 {
     List<Vector3> TCoords = new List<Vector3>();
     if (!TOP)
     {
         int tID_TOP = mat.TextureID(MaterialSide.TOP);
         TCoords.Add(new Vector3(0, 1, tID_TOP));
         TCoords.Add(new Vector3(1, 1, tID_TOP));
         TCoords.Add(new Vector3(0, 0, tID_TOP));
     }
     if (!BOTTOM)
     {
         int tID_BOTTOM = mat.TextureID(MaterialSide.BOTTOM);
         TCoords.Add(new Vector3(0, 0, tID_BOTTOM));
         TCoords.Add(new Vector3(1, 1, tID_BOTTOM));
         TCoords.Add(new Vector3(0, 1, tID_BOTTOM));
     }
     if (!XM)
     {
         int tID_XM = mat.TextureID(MaterialSide.XM);
         TCoords.Add(new Vector3(1, 1, tID_XM));
         TCoords.Add(new Vector3(0, 1, tID_XM));
         TCoords.Add(new Vector3(0, 0, tID_XM));
         TCoords.Add(new Vector3(1, 1, tID_XM));
         TCoords.Add(new Vector3(0, 0, tID_XM));
         TCoords.Add(new Vector3(1, 0, tID_XM));
     }
     if (!YP)
     {
         int tID_YP = mat.TextureID(MaterialSide.YP);
         TCoords.Add(new Vector3(1, 1, tID_YP));
         TCoords.Add(new Vector3(0, 1, tID_YP));
         TCoords.Add(new Vector3(0, 0, tID_YP));
         TCoords.Add(new Vector3(1, 1, tID_YP));
         TCoords.Add(new Vector3(0, 0, tID_YP));
         TCoords.Add(new Vector3(1, 0, tID_YP));
     }
     int tID_XP = mat.TextureID(MaterialSide.XP);
     TCoords.Add(new Vector3(0, 1, tID_XP));
     TCoords.Add(new Vector3(1, 1, tID_XP));
     TCoords.Add(new Vector3(0, 0, tID_XP));
     TCoords.Add(new Vector3(1, 1, tID_XP));
     TCoords.Add(new Vector3(1, 0, tID_XP));
     TCoords.Add(new Vector3(0, 0, tID_XP));
     return TCoords;
 }
开发者ID:Morphan1,项目名称:Voxalia,代码行数:46,代码来源:BSD58.cs

示例3: Steps

 public void Steps(Location pos, Material mat, Location vel, float vlen)
 {
     const double spread = 0.5f;
     int c = Utilities.UtilRandom.Next(5) + 3;
     Vector3 tvec = vel.ToBVector();
     for (int i = 0; i < c; i++)
     {
         Quaternion quat = Quaternion.CreateFromAxisAngle(Vector3.UnitZ, (float)(Utilities.UtilRandom.NextDouble() * (Math.PI / 2.0)));
         Location nvel = new Location(Quaternion.Transform(tvec, quat));
         nvel.Z += 3;
         double xoff = Utilities.UtilRandom.NextDouble() * spread - spread * 0.5;
         double yoff = Utilities.UtilRandom.NextDouble() * spread - spread * 0.5;
         Location temp = new Location(xoff, yoff, TheClient.TheRegion.PhysicsWorld.ForceUpdater.Gravity.Z * 0.15f);
         float ttl = (float)Utilities.UtilRandom.NextDouble() * 3f + 3f;
         Texture tex = TheClient.Textures.GetTexture(TheClient.TBlock.IntTexs[mat.TextureID(MaterialSide.TOP)]);
         Location size = new Location(0.1, 0.1, 0.1);
         Engine.AddEffect(ParticleEffectType.SQUARE, (o) => pos + temp * (1 - o.TTL / o.O_TTL)
         + new Location(xoff, yoff, 0) * Math.Sqrt(1 - o.TTL / o.O_TTL) + nvel * (1 - o.TTL / o.O_TTL), (o) => size, (o) => 1, ttl, Location.One, Location.One, true, tex, 1);
     }
 }
开发者ID:Morphan1,项目名称:Voxalia,代码行数:20,代码来源:ParticleHelper.cs

示例4: GetTCoords

 public override List<Vector3> GetTCoords(Vector3 blockPos, Material mat, bool XP, bool XM, bool YP, bool YM, bool TOP, bool BOTTOM)
 {
     List<Vector3> TCoords = new List<Vector3>();
     if (!TOP)
     {
         int tID_TOP = mat.TextureID(MaterialSide.TOP);
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_TOP));
         TCoords.Add(new Vector3(1.0f, 0.5f, tID_TOP));
         TCoords.Add(new Vector3(0.85f, 0.15f, tID_TOP));
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_TOP));
         TCoords.Add(new Vector3(0.85f, 0.15f, tID_TOP));
         TCoords.Add(new Vector3(0.5f, 0.0f, tID_TOP));
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_TOP));
         TCoords.Add(new Vector3(0.5f, 0.0f, tID_TOP));
         TCoords.Add(new Vector3(0.15f, 0.15f, tID_TOP));
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_TOP));
         TCoords.Add(new Vector3(0.15f, 0.15f, tID_TOP));
         TCoords.Add(new Vector3(0.0f, 0.5f, tID_TOP));
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_TOP));
         TCoords.Add(new Vector3(0.0f, 0.5f, tID_TOP));
         TCoords.Add(new Vector3(0.15f, 0.85f, tID_TOP));
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_TOP));
         TCoords.Add(new Vector3(0.15f, 0.85f, tID_TOP));
         TCoords.Add(new Vector3(0.5f, 1.0f, tID_TOP));
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_TOP));
         TCoords.Add(new Vector3(0.5f, 1.0f, tID_TOP));
         TCoords.Add(new Vector3(0.85f, 0.85f, tID_TOP));
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_TOP));
         TCoords.Add(new Vector3(0.85f, 0.85f, tID_TOP));
         TCoords.Add(new Vector3(1.0f, 0.5f, tID_TOP));
     }
     if (!BOTTOM)
     {
         int tID_BOTTOM = mat.TextureID(MaterialSide.BOTTOM);
         TCoords.Add(new Vector3(0.85f, 0.15f, tID_BOTTOM));
         TCoords.Add(new Vector3(1.0f, 0.5f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.5f, 0.0f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.85f, 0.15f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.15f, 0.15f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.5f, 0.0f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.0f, 0.5f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.15f, 0.15f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.15f, 0.85f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.0f, 0.5f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.5f, 1.0f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.15f, 0.85f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.85f, 0.85f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.5f, 1.0f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_BOTTOM));
         TCoords.Add(new Vector3(1.0f, 0.5f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.85f, 0.85f, tID_BOTTOM));
         TCoords.Add(new Vector3(0.5f, 0.5f, tID_BOTTOM));
     }
     // 0.9191f, -0.3939f, 0f
     int tID_XP = mat.TextureID(MaterialSide.XP);
     TCoords.Add(new Vector3(0.5f, 1, tID_XP));
     TCoords.Add(new Vector3(0, 0, tID_XP));
     TCoords.Add(new Vector3(0.5f, 0, tID_XP));
     TCoords.Add(new Vector3(0.5f, 1, tID_XP));
     TCoords.Add(new Vector3(0, 1, tID_XP));
     TCoords.Add(new Vector3(0, 0, tID_XP));
     // 0.3939f, -0.9191f, 0f
     int tID_YM = mat.TextureID(MaterialSide.YM);
     TCoords.Add(new Vector3(1, 1, tID_YM));
     TCoords.Add(new Vector3(0.5f, 0, tID_YM));
     TCoords.Add(new Vector3(1, 0, tID_YM));
     TCoords.Add(new Vector3(1, 1, tID_YM));
     TCoords.Add(new Vector3(0.5f, 1, tID_YM));
     TCoords.Add(new Vector3(0.5f, 0, tID_YM));
     // -0.3939f, -0.9191f, 0f
     TCoords.Add(new Vector3(0.5f, 1, tID_YM));
     TCoords.Add(new Vector3(0, 0, tID_YM));
     TCoords.Add(new Vector3(0.5f, 0, tID_YM));
     TCoords.Add(new Vector3(0.5f, 1, tID_YM));
     TCoords.Add(new Vector3(0, 1, tID_YM));
     TCoords.Add(new Vector3(0, 0, tID_YM));
     // -0.9191f, -0.3939f, 0f
     int tID_XM = mat.TextureID(MaterialSide.XM);
     TCoords.Add(new Vector3(1, 1, tID_XM));
     TCoords.Add(new Vector3(0.5f, 0, tID_XM));
     TCoords.Add(new Vector3(1, 0, tID_XM));
     TCoords.Add(new Vector3(1, 1, tID_XM));
     TCoords.Add(new Vector3(0.5f, 1, tID_XM));
     TCoords.Add(new Vector3(0.5f, 0, tID_XM));
     // -0.9191f, 0.3939f, 0f
     TCoords.Add(new Vector3(0, 1, tID_XM));
     TCoords.Add(new Vector3(0.5f, 0, tID_XM));
     TCoords.Add(new Vector3(0, 0, tID_XM));
     TCoords.Add(new Vector3(0, 1, tID_XM));
     TCoords.Add(new Vector3(0.5f, 1, tID_XM));
     TCoords.Add(new Vector3(0.5f, 0, tID_XM));
     // -0.3939f, 0.9191f, 0f
     int tID_YP = mat.TextureID(MaterialSide.YP);
     TCoords.Add(new Vector3(0.5f, 1, tID_YP));
//.........这里部分代码省略.........
开发者ID:Morphan1,项目名称:Voxalia,代码行数:101,代码来源:BSD39a76.cs

示例5: GetTCoordsQuick

 public Vector3[] GetTCoordsQuick(int index, Material mat)
 {
     List<Vector3> set = BSSD.TCrds[index];
     Vector3[] vecs = new Vector3[set.Count];
     for (int i = 0; i < set.Count; i++)
     {
         Vector3 temp = set[i];
         for (int z = 0; z < 6; z++)
         {
             if (temp.Z == Material.DEBUG.TextureID((MaterialSide)z))
             {
                 temp.Z = mat.TextureID((MaterialSide)z);
             }
         }
         vecs[i] = temp;
     }
     return vecs;
 }
开发者ID:Morphan1,项目名称:Voxalia,代码行数:18,代码来源:BlockShapeRegistry.cs


注:本文中的Material.TextureID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。