예제 #1
0
        void _BoneField(string boneName, ref FullBodyIK.Bone bone, bool isOptional)
        {
            FullBodyIK.SafeNew(ref bone);
            var fbik = this.target as FullBodyIKBehaviourBase;

            EditorGUILayout.BeginHorizontal();
            if (bone.transform == null)
            {
                if (isOptional)
                {
                    GUILayout.Label(boneName + " *", _guiStyle_boneName_Unselected_Optional, GUILayout.Width(boneNameFieldSize));
                }
                else
                {
                    GUILayout.Label(boneName, _guiStyle_boneName_Unselected, GUILayout.Width(boneNameFieldSize));
                }
            }
            else
            {
                GUILayout.Label(boneName, GUILayout.Width(boneNameFieldSize));
            }
            EditorUtil.GUI.PushEnabled(!Application.isPlaying);
            EditorUtil.GUI.TransformField(fbik, "", ref bone.transform, true);
            EditorUtil.GUI.PopEnabled();
            EditorGUILayout.EndHorizontal();
        }
예제 #2
0
        void _FingerBoneField(string boneName, ref FullBodyIK.Bone[] bones, bool isOptional)
        {
            if (bones == null || bones.Length != 4)
            {
                bones = new FullBodyIK.Bone[4];
            }

            for (int i = 0; i < bones.Length; ++i)
            {
                string name = null;
                if (i + 1 == bones.Length)
                {
                    name = boneName + " Tip";
                }
                else
                {
                    name = boneName + " " + (i + 1).ToString();
                }
                _BoneField(name, ref bones[i], isOptional);
            }
        }
		void _FingerBoneField( string boneName, ref FullBodyIK.Bone[] bones, bool isOptional )
		{
			if( bones == null || bones.Length != 4 ) {
				bones = new FullBodyIK.Bone[4];
			}

			for( int i = 0; i < bones.Length; ++i ) {
				string name = null;
				if( i + 1 == bones.Length ) {
					name = boneName + " Tip";
				} else {
					name = boneName + " " + (i + 1).ToString();
				}
				_BoneField( name, ref bones[i], isOptional );
			}
		}