本文整理汇总了C#中GenderType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# GenderType.ToString方法的具体用法?C# GenderType.ToString怎么用?C# GenderType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GenderType
的用法示例。
在下文中一共展示了GenderType.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadClips
public void LoadClips(GameObject skeleton, ZMD zmd, GenderType gender, RigType rig, Dictionary<String, String> zmoPaths)
{
List<AnimationClip> clips = new List<AnimationClip>();
foreach (KeyValuePair<String, String> motion in zmoPaths)
{
string unityPath = "Assets/Resources/Animation/" + gender.ToString() + "/" + rig.ToString() + "/clips/" + motion.Key + ".anim";
AnimationClip clip = new ZMO("Assets/" + motion.Value).buildAnimationClip(zmd);
clip.name = motion.Key;
clip.legacy = true;
clip = (AnimationClip)Utils.SaveReloadAsset(clip, unityPath, ".anim");
clips.Add(clip);
}
Animation animation = skeleton.AddComponent<Animation>();
AnimationUtility.SetAnimationClips(animation, clips.ToArray());
}
示例2: loadSkeleton
public GameObject loadSkeleton(GenderType gender, RigType rig)
{
var prefab = Resources.Load("Animation/" + gender.ToString() + "/" + rig.ToString() + "/skeleton");
var clone = GameObject.Instantiate(prefab);
return clone as GameObject;
}
示例3: GenerateAnimationAsset
public void GenerateAnimationAsset(GenderType gender, RigType rig, Dictionary<String,String> zmoPaths)
{
GameObject skeleton = new GameObject("skeleton");
bool male = (gender == GenderType.MALE);
ZMD zmd = new ZMD(male ? "Assets/3DData/Avatar/MALE.ZMD" : "Assets/3DData/Avatar/FEMALE.ZMD");
zmd.buildSkeleton(skeleton);
BindPoses poses = ScriptableObject.CreateInstance<BindPoses>();
poses.bindPoses = zmd.bindposes;
poses.boneNames = getBoneNames(zmd.boneTransforms);
poses.boneTransforms = zmd.boneTransforms;
LoadClips(skeleton, zmd, gender, rig, zmoPaths);
string path = "Assets/Resources/Animation/" + gender.ToString() + "/" + rig.ToString() + "/skeleton.prefab";
AssetDatabase.CreateAsset(poses, path.Replace("skeleton.prefab", "bindPoses.asset"));
AssetDatabase.SaveAssets();
PrefabUtility.CreatePrefab(path, skeleton);
}
示例4: loadBindPoses
/// <summary>
/// Load bindposes and bones matrices from resources scriptable object
/// </summary>
/// <param name="gender"></param>
/// <param name="weapon"></param>
/// <returns></returns>
public BindPoses loadBindPoses(GameObject skeleton, GenderType gender, WeaponType weapon)
{
BindPoses poses = ScriptableObject.Instantiate<BindPoses>((BindPoses)Resources.Load ("Animation/" + gender.ToString () + "/" + weapon.ToString () + "/bindPoses"));
for (int i = 0; i < poses.boneNames.Length; i++) {
poses.boneTransforms[i] = Utils.findChild(skeleton, poses.boneNames[i]);
}
return poses;
}