本文整理汇总了C#中Skin.GetTexture方法的典型用法代码示例。如果您正苦于以下问题:C# Skin.GetTexture方法的具体用法?C# Skin.GetTexture怎么用?C# Skin.GetTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skin
的用法示例。
在下文中一共展示了Skin.GetTexture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Player
/// <summary>
/// Initialize a new instance of <see cref="Player" />.
/// </summary>
/// <param name="entityId">The Entity ID of this player.</param>
/// <param name="name">Name of the player.</param>
/// <param name="skin">The player skin.</param>
/// <param name="position">World position of the player (X,Y,Z).</param>
/// <param name="direction">The direction the player is looking in (Yaw, Pitch).</param>
/// <param name="stance">The stance of the player.</param>
public Player(int entityId, string name, Texture2D skin = null, Position position = null, LookDirection direction = null, double stance = 0.0)
: base(entityId)
{
Name = name;
_skin = new Skin(skin);
Position = position ?? new Position();
Direction = direction ?? new LookDirection();
Stance = stance;
if (_skin.GetTexture() == null)
return;
if (_skin.GetTexture().Width != SkinWidth || _skin.GetTexture().Height != SkinHeight)
{
// Set the skin to default player skin (Steve)
}
}