本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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));
//.........这里部分代码省略.........
示例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;
}