コード例 #1
0
ファイル: BoneManager.cs プロジェクト: emorins/PHPlugins
        void ModedCharaList(BMMHuman modedChara)
        {
            if (modedChara == null)
            {
                return;
            }
            GUILayout.BeginHorizontal();
            var selected = ToggleButton(ReferenceEquals(modedChara, selectedChara), new GUIContent(modedChara.Name), x => selectedBone = null);

            GUILayout.FlexibleSpace();
            if (GUILayout.Button(GUIStrings.Reset, buttonstyleNoStretch))
            {
                modedChara.reset = true;
                if (selected)
                {
                    selectedBone = null;
                }
            }
            if (GUILayout.Button(GUIStrings.Save, buttonstyleNoStretch))
            {
                modedChara.SaveProfile();
            }
            GUILayout.EndHorizontal();
            if (selected)
            {
                selectedChara = modedChara;
            }
        }
コード例 #2
0
ファイル: BoneManager.cs プロジェクト: emorins/PHPlugins
        void ModedBoneList(BMMHuman modedChara)
        {
            if (modedChara == null)
            {
                EmptyPage(new GUIContent("Select a character. "));
                selectedBone       = null;
                additionalBonePage = false;
                return;
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label("Bones: ", labelstyle);
            GUILayout.FlexibleSpace();
            additionalBonePage = UIUtils.ToggleButton(additionalBonePage, new GUIContent(" + "), x => selectedBone = null);
            GUILayout.EndHorizontal();

            if (modedChara.boneModifiers == null || modedChara.boneModifiers.Count == 0)
            {
                EmptyPage(new GUIContent("No modified bones. "));
                return;
            }
            scrollPosition[1] = GUILayout.BeginScrollView(scrollPosition[1]);
            foreach (var bone in modedChara.targetBones)
            {
                GUILayout.BeginHorizontal();
                if (UIUtils.ToggleButton(ReferenceEquals(bone, selectedBone), new GUIContent(bone.transform.name)))
                {
                    selectedBone       = bone;
                    additionalBonePage = false;
                }
                GUILayout.FlexibleSpace();
                if (GUILayout.Button(" - ", buttonstyleNoStretch))
                {
                    modedChara.RemoveBoneModifier(bone);
                    if (bone == selectedBone)
                    {
                        selectedBone = null;
                    }
                }
                GUILayout.EndHorizontal();
            }
            GUILayout.EndScrollView();
        }