本文整理汇总了C#中UnityEngine.Transform.Where方法的典型用法代码示例。如果您正苦于以下问题:C# Transform.Where方法的具体用法?C# Transform.Where怎么用?C# Transform.Where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Transform
的用法示例。
在下文中一共展示了Transform.Where方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBonesOfType
/// <summary>
/// Returns only the bones with the specified JointObject.
/// </summary>
public static Transform[] GetBonesOfType(JointObject type, Transform[] bones)
{
return bones.Where(b => (b != null && GetType(b.name) == type)).ToArray();
}
示例2: GetJointsOfSide
/// <summary>
/// Returns only the joints with the specified Side.
/// </summary>
/// <param name="jointSide">The side of the joint</param>
/// <param name="joints">The Transforms where to search</param>
/// <returns>A list of matching Transforms</returns>
public static Transform[] GetJointsOfSide(BodySide jointSide, Transform[] joints)
{
return joints.Where(j => (j != null && GetSideOfJointName(j.name) == jointSide)).ToArray();
}
示例3: FindRigTransformByName
private Transform FindRigTransformByName(string rigName, Transform[] transforms)
{
var targetTransform = transforms.Where((t) => t.name == rigName).FirstOrDefault();
if (targetTransform != null)
{
var pos = targetTransform.localPosition;
var rot = targetTransform.localRotation;
Util.Log("Bone rig " + rigName + " found! Pos: " + pos.x + ", " + pos.y + ", " + pos.z + " Rot: " + rot.x + ", " + rot.y + ", " + rot.z + ", " + rot.w);
}
else
{
Util.Log("Bone rig " + rigName + " not found...");
}
return targetTransform;
}