SA.FullBodyIK._ConfigureRollBones C# (CSharp) Method

_ConfigureRollBones() public method

public _ConfigureRollBones ( Bone bones, List tempBones, Transform transform, Transform excludeTransform, Side side, bool isArm ) : void
bones Bone
tempBones List
transform Transform
excludeTransform Transform
side Side
isArm bool
return void
		void _ConfigureRollBones( Bone[] bones, List<Transform> tempBones, Transform transform, Transform excludeTransform, Side side, bool isArm )
		{
			bool isRollSpecial = false;
			string rollSpecialName = null;
			if( isArm ) {
				rollSpecialName = (side == Side.Left) ? "LeftArmRoll" : "RightArmRoll";
			} else {
				rollSpecialName = (side == Side.Left) ? "LeftElbowRoll" : "RightElbowRoll";
			}

			int childCount = transform.childCount;

			for( int i = 0; i != childCount; ++i ) {
				var childTransform = transform.GetChild( i );
				var name = childTransform.name;
				if( name != null && name.Contains( rollSpecialName ) ) {
					isRollSpecial = true;
					break;
				}
			}

			tempBones.Clear();

			for( int i = 0; i != childCount; ++i ) {
				var childTransform = transform.GetChild( i );
				var name = childTransform.name;
				if( name != null ) {
					if( excludeTransform != childTransform &&
						!excludeTransform.IsChildOf( childTransform ) ) {
						if( isRollSpecial ) {
							if( name.Contains( rollSpecialName ) ) {
								char nameEnd = name[name.Length - 1];
								if( nameEnd >= '0' && nameEnd <= '9' ) {
									tempBones.Add( childTransform );
								}
							}
						} else {
							tempBones.Add( childTransform );
						}
					}
				}
			}

			childCount = Mathf.Min( tempBones.Count, bones.Length );
			for( int i = 0; i != childCount; ++i ) {
				_SetBoneTransform( ref bones[i], tempBones[i] );
			}
		}
FullBodyIK