本文整理汇总了C#中Directions.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Directions.Equals方法的具体用法?C# Directions.Equals怎么用?C# Directions.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Directions
的用法示例。
在下文中一共展示了Directions.Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SizeByDirect
public int SizeByDirect(Directions direct)
{
if (direct.Equals(Directions.Front))
{
return width;
}
if (direct.Equals(Directions.Left))
{
return hight;
}
if (direct.Equals(Directions.Bottom))
{
return depth;
}
throw new Exception("Не должно такого быть");
}
示例2: ChangeSlashEffectPosition
void ChangeSlashEffectPosition(Directions direction)
{
if (direction.Equals(Directions.Left))
{
_playerAttackSlash.transform.localPosition = new Vector3(-renderer.bounds.size.x * 0.1f, renderer.bounds.size.y * 0.225f, 0);
}
else if (direction.Equals(Directions.Right))
{
_playerAttackSlash.transform.localPosition = new Vector3(renderer.bounds.size.x * 0.1f, renderer.bounds.size.y * 0.225f, 0);
}
else if (direction.Equals(Directions.Top))
{
_playerAttackSlash.transform.localPosition = new Vector3(renderer.bounds.size.x * 0.1f, renderer.bounds.size.y * 0.1f, 0);
}
else if (direction.Equals(Directions.Bottom))
{
_playerAttackSlash.transform.localPosition = new Vector3(-renderer.bounds.size.x * 0.1f, -renderer.bounds.size.y * 0.1f, 0);
}
}
示例3: Direction2InvariantRotate
public static Rotates Direction2InvariantRotate(Directions direct)
{
if (direct.Equals(Directions.Front) || direct.Equals(Directions.Back))
{
return Rotates.Side;
}
if (direct.Equals(Directions.Left) || direct.Equals(Directions.Right))
{
return Rotates.Forward;
}
if (direct.Equals(Directions.Bottom) || direct.Equals(Directions.Top))
{
return Rotates.Around;
}
return Rotates.Side;
throw new Exception("Такого не должно случаться");
}