示例#1
0
    void RenameToNormalNoNumber(Transform t)
    {
        MMD4MecanimBone bone = t.GetComponent <MMD4MecanimBone>();

        if (bone != null)
        {
            string[] tmp = bone.boneData.skeletonName.Split('!');
            if (tmp.Length > 1)
            {
                t.name = tmp[1];
            }
            else
            {
                tmp = bone.boneData.skeletonName.Split('.');
                if (tmp.Length > 1)
                {
                    t.name = tmp[1];
                }
            }
        }
        for (int i = 0; i < t.childCount; i++)
        {
            RenameToNormalNoNumber(t.GetChild(i));
        }
    }
示例#2
0
    void RenameToEng(Transform t)
    {
        MMD4MecanimBone bone = t.GetComponent <MMD4MecanimBone>();

        if (bone != null)
        {
            t.name = bone.boneData.nameEn;
            //Debug.Log();
        }
        for (int i = 0; i < t.childCount; i++)
        {
            RenameToEng(t.GetChild(i));
        }
    }
示例#3
0
    void Start()
    {
        Ref           = this.transform.FindChild("158.!Root").gameObject;
        Hips          = Ref.gameObject.transform.FindChild("8.joint_HipMaster").gameObject;
        LeftUpLeg     = Hips.gameObject.transform.FindChild("12.joint_LeftHip").gameObject;
        LeftLeg       = LeftUpLeg.gameObject.transform.FindChild("13.joint_LeftKnee").gameObject;
        RightUpLeg    = Hips.gameObject.transform.FindChild("9.joint_RightHip").gameObject;
        RightLeg      = RightUpLeg.gameObject.transform.FindChild("10.joint_RightKnee").gameObject;
        LeftShoulder  = Hips.gameObject.transform.FindChild("15.joint_Torso").FindChild("16.joint_Torso2").FindChild("59.joint_LeftShoulder").gameObject;
        LeftArm       = LeftShoulder.gameObject.transform.FindChild("60.joint_LeftArm").FindChild("62.joint_LeftElbow").gameObject;
        RightShoulder = Hips.gameObject.transform.FindChild("15.joint_Torso").FindChild("16.joint_Torso2").FindChild("38.joint_RightShoulder").gameObject;
        RightArm      = RightShoulder.gameObject.transform.FindChild("39.joint_RightArm").FindChild("41.joint_RightElbow").gameObject;
        Neck          = Hips.gameObject.transform.FindChild("15.joint_Torso").FindChild("16.joint_Torso2").FindChild("17.joint_Neck").gameObject;
        Waist         = Ref.gameObject.transform.FindChild("0.!joint_Master").FindChild("1.!joint_Center").FindChild("2.!joint_guru^bu").FindChild("3.!joint_Waist").gameObject;


        HipsBone          = Hips.GetComponent <MMD4MecanimBone>();
        LeftUpLegBone     = LeftUpLeg.GetComponent <MMD4MecanimBone>();
        LeftLegBone       = LeftLeg.GetComponent <MMD4MecanimBone>();
        RightUpLegBone    = RightUpLeg.GetComponent <MMD4MecanimBone>();
        RightLegBone      = RightLeg.GetComponent <MMD4MecanimBone>();
        LeftShoulderBone  = LeftShoulder.GetComponent <MMD4MecanimBone>();
        LeftArmBone       = LeftArm.GetComponent <MMD4MecanimBone>();
        RightShoulderBone = RightShoulder.GetComponent <MMD4MecanimBone>();
        RightArmBone      = RightArm.GetComponent <MMD4MecanimBone>();
        NeckBone          = Neck.GetComponent <MMD4MecanimBone>();
        WaistBone         = Waist.GetComponent <MMD4MecanimBone>();

        HipsVec          = new Vector3(1, 0, 0);
        LeftUpLegVec     = new Vector3(0, 1, 0);
        LeftLegVec       = new Vector3(0, 0, 1);
        RightUpLegVec    = new Vector3(1, 1, 0);
        RightLegVec      = new Vector3(1, 0, 1);
        LeftShoulderVec  = new Vector3(0, 1, 1);
        LeftArmVec       = new Vector3(1, 1, 1);
        RightShoulderVec = new Vector3(1, 1, 1);
        RightArmVec      = new Vector3(1, 1, 1);
        NeckVec          = new Vector3(1, 1, 1);
        WaistVec         = new Vector3(1, 1, 1);
    }