using System; using System.Collections; using System.Collections.Generic; using MaidStatus; using SceneEditWindow; using UnityEngine; public class PresetButtonCtrl : MonoBehaviour { public void Init(GameObject goPresetButtonPanel, Maid maid) { this.m_goPresetButtonPanel = goPresetButtonPanel; this.m_maid = maid; this.m_goItemPresetsViewer = UTY.GetChildObject(this.m_goPresetButtonPanel, "ItemPresetsViewer", false); this.m_listPresetBtn = new Dictionary(); this.m_listItemPresetBtn = new Dictionary(); IEnumerator enumerator = Enum.GetValues(typeof(PresetButtonCtrl.LeftButtons)).GetEnumerator(); try { while (enumerator.MoveNext()) { object obj = enumerator.Current; this.initBtnList("LeftButtons", ((PresetButtonCtrl.LeftButtons)obj).ToString()); } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } IEnumerator enumerator2 = Enum.GetValues(typeof(PresetButtonCtrl.RightButtons)).GetEnumerator(); try { while (enumerator2.MoveNext()) { object obj2 = enumerator2.Current; this.initBtnList("RightButtons", ((PresetButtonCtrl.RightButtons)obj2).ToString()); } } finally { IDisposable disposable2; if ((disposable2 = (enumerator2 as IDisposable)) != null) { disposable2.Dispose(); } } this.m_goParentItemBtn = UTY.GetChildObject(this.m_goItemPresetsViewer, "Scroll View/Grid", false); UIButton component = UTY.GetChildObject(this.m_goPresetButtonPanel, "PresetButtons/LeftButtons/View", false).GetComponent(); this.activeColor = new Color(component.defaultColor.r, component.defaultColor.g, component.defaultColor.b, 1f); this.inActiveColor = component.defaultColor; this.m_sbScrollBar = UTY.GetChildObject(this.m_goItemPresetsViewer, "Scroll Bar", false).GetComponent(); this.m_goItemScrollView = UTY.GetChildObject(this.m_goPresetButtonPanel, "ItemPresetsViewer/Scroll View", false); this.m_pItemScrollViewPanel = this.m_goItemScrollView.GetComponent(); GameObject childObject = UTY.GetChildObject(this.m_goPresetButtonPanel, "ItemPresetsViewer/BG", false); this.m_spScrollViewBG = childObject.GetComponent(); this.m_maxScrollViewWidth = (int)this.m_pItemScrollViewPanel.baseClipRegion.z; this.m_scrollViewSize = new Vector4(0f, 0f, (float)this.m_maxScrollViewWidth, (float)((int)this.m_pItemScrollViewPanel.baseClipRegion.w)); this.m_scrollViewSoftnessX = (int)this.m_pItemScrollViewPanel.clipSoftness.x; this.m_nguiContentWidth = base.GetComponentInParent().GetComponent().manualWidth; this.m_ajustedNguiContentWidth = this.m_nguiContentWidth - 650; GameObject childObject2 = UTY.GetChildObject(this.m_goPresetButtonPanel, "PresetButtons", false); float x = UTY.GetChildObject(childObject2, "LeftButtons/Pose", false).transform.position.x; float x2 = UTY.GetChildObject(childObject2, "LeftButtons/Clothes", false).transform.position.x; float x3 = UTY.GetChildObject(childObject2, "LeftButtons/PriSave", false).transform.position.x; float x4 = UTY.GetChildObject(childObject2, "RightButtons/Voice", false).transform.position.x; float x5 = UTY.GetChildObject(childObject2, "RightButtons/BG", false).transform.position.x; this.dicBtnPosX = new Dictionary { { "Pose", x }, { "Clothes", x2 }, { "PriSave", x3 }, { "Voice", x4 }, { "BG", x5 } }; this.m_goItemSpriteBtn = (Resources.Load("SceneEdit/PresetButton/Prefabs/ItemSpritePresetButton") as GameObject); this.m_goItemTxtrBtn = (Resources.Load("SceneEdit/PresetButton/Prefabs/ItemTxtrPresetButton") as GameObject); this.m_spItemIcon = this.m_goItemSpriteBtn.GetComponent(); this.m_sceneEdit = GameObject.Find("__SceneEdit__").GetComponent(); this.m_goItemPresetsViewer.SetActive(false); if (this.m_sceneEdit.IsVRComMode) { UIButton component2 = UTY.GetChildObject(childObject2, "RightButtons/BG", false).GetComponent(); component2.disabledColor.a = 0.5f; component2.SetState(UIButtonColor.State.Disabled, true); component2.isEnabled = false; UIButton component3 = UTY.GetChildObject(childObject2, "LeftButtons/View", false).GetComponent(); component3.disabledColor.a = 0.5f; component3.SetState(UIButtonColor.State.Disabled, true); component3.isEnabled = false; } UIButton component4 = UTY.GetChildObject(this.m_goPresetButtonPanel, "HowToName", false).GetComponent(); if (component4.onClick.Count == 0) { EventDelegate.Add(component4.onClick, new EventDelegate.Callback(this.m_sceneEdit.CallHowToNameDialog)); } if (this.m_sceneEdit.modeType == SceneEdit.ModeType.OriginalChara || this.m_sceneEdit.modeType == SceneEdit.ModeType.MainChara || this.m_sceneEdit.modeType == SceneEdit.ModeType.CostumeEdit || maid.status.heroineType == HeroineType.Sub || maid.boNPC) { component4.gameObject.SetActive(false); } else { component4.gameObject.SetActive(true); } UIButton component5 = UTY.GetChildObject(this.m_goPresetButtonPanel, "SettingName", false).GetComponent(); if (component5.onClick.Count == 0) { EventDelegate.Add(component5.onClick, new EventDelegate.Callback(this.m_sceneEdit.CallSettingNamePanel)); } component5.gameObject.SetActive(maid.status.heroineType == HeroineType.Sub); if (this.m_sceneEdit.modeType == SceneEdit.ModeType.CostumeEdit) { UTY.GetChildObject(this.m_goPresetButtonPanel, "WindowVoice/Button", false).GetComponent().isEnabled = false; UTY.GetChildObject(this.m_goPresetButtonPanel, "WindowPresetSave/Button", false).GetComponent().isEnabled = false; } if (maid.boNPC) { UTY.GetChildObject(this.m_goPresetButtonPanel, "WindowVoice/Button", false).GetComponent().isEnabled = false; } } public void CreateItemPresetsViewer(string type, string clickBtnName, string prevActiveBtnName) { if (!string.IsNullOrEmpty(this.last_draw_type_)) { if (this.last_draw_type_ == PresetButtonMgr.ItemTypes.Pose.ToString()) { this.backup_pose_scroll_pos_ = this.m_sbScrollBar.value; } else if (this.last_draw_type_ == PresetButtonMgr.ItemTypes.BG.ToString()) { this.backup_bg_scroll_pos_ = this.m_sbScrollBar.value; } } this.m_dicItem = new Dictionary(); if (type == "PresetButtons" && clickBtnName == PresetButtonMgr.ItemTypes.Pose.ToString()) { this.m_dicItem = this.LoadItemData(clickBtnName); } else if (type == "PresetButtons" && clickBtnName == PresetButtonMgr.ItemTypes.Clothes.ToString()) { this.m_dicItem = this.LoadClothesData(); } else if (type == "PresetButtons" && clickBtnName == PresetButtonMgr.ItemTypes.PriSave.ToString()) { this.m_dicItem = this.LoadPriSaveData(); } else if (type == "PresetButtons" && clickBtnName == PresetButtonMgr.ItemTypes.Voice.ToString()) { this.m_dicItem = this.LoadItemData(clickBtnName); } else if (type == "PresetButtons" && clickBtnName == PresetButtonMgr.ItemTypes.BG.ToString()) { this.m_dicItem = this.LoadItemData(clickBtnName); } this.last_draw_type_ = clickBtnName; List list = new List(); foreach (KeyValuePair keyValuePair in this.m_dicItem) { if (keyValuePair.Key.StartsWith(clickBtnName)) { list.Add(keyValuePair.Value); } } if (list.Count == 0 && clickBtnName != "View") { Debug.LogError(string.Format("アイテムビューワに表示するアイテムが存在しません。押下されたボタン={0}", clickBtnName)); return; } this.LoadItemBtn(list, clickBtnName); this.initItemBtnList(list); this.AdjustItemPresets(type, clickBtnName, prevActiveBtnName); if (type == "PresetButtons" && clickBtnName == PresetButtonMgr.ItemTypes.Pose.ToString()) { this.m_sbScrollBar.value = this.backup_pose_scroll_pos_; } else if (type == "PresetButtons" && clickBtnName == PresetButtonMgr.ItemTypes.BG.ToString()) { this.m_sbScrollBar.value = this.backup_bg_scroll_pos_; } } private void initBtnList(string btnType, string btnName) { string text = null; bool flag = false; PresetButtonCtrl.PresetButton presetButton = new PresetButtonCtrl.PresetButton(); if (btnType == "LeftButtons" || btnType == "RightButtons") { text = "PresetButtons/" + btnType + "/" + btnName; flag = true; } else if (btnType == "itemPresetButtons") { text = "ItemPresetsViewer/Scroll View/Grid/" + btnName; flag = false; } UIButton component = UTY.GetChildObject(this.m_goPresetButtonPanel, text, false).GetComponent(); GameObject childObject = UTY.GetChildObject(this.m_goPresetButtonPanel, text + "/SelectCursor", false); childObject.SetActive(false); if (flag && btnName != "View") { GameObject childObject2 = UTY.GetChildObject(this.m_goPresetButtonPanel, text + "/WindowArrow", false); childObject2.SetActive(false); presetButton.m_goWindowArrow = childObject2; } presetButton.m_btnButton = component; presetButton.m_name = btnName; presetButton.m_goSelectCursor = childObject; if (btnType == "LeftButtons" || btnType == "RightButtons") { this.m_listPresetBtn.Add(presetButton.m_name, presetButton); } else if (btnType == "itemPresetButtons") { this.m_listItemPresetBtn[presetButton.m_name] = presetButton; } } public void LoadItemBtn(List listItemPreset, string clickBtnName) { if (clickBtnName == PresetButtonMgr.ItemTypes.Pose.ToString() || clickBtnName == PresetButtonMgr.ItemTypes.Voice.ToString() || clickBtnName == PresetButtonMgr.ItemTypes.BG.ToString()) { this.m_goItemBtn = this.m_goItemTxtrBtn; } else if (clickBtnName == PresetButtonMgr.ItemTypes.Clothes.ToString() || clickBtnName == PresetButtonMgr.ItemTypes.PriSave.ToString()) { this.m_goItemBtn = this.m_goItemSpriteBtn; } IEnumerator enumerator = this.m_goParentItemBtn.transform.GetEnumerator(); try { while (enumerator.MoveNext()) { object obj = enumerator.Current; Transform transform = (Transform)obj; UnityEngine.Object.Destroy(transform.gameObject); } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } this.m_goParentItemBtn.transform.DetachChildren(); this.m_listItemPresetBtn.Clear(); foreach (PresetButtonCtrl.ItemPreset itemPreset in listItemPreset) { GameObject gameObject = UnityEngine.Object.Instantiate(this.m_goItemBtn); switch (itemPreset.m_itemType) { case PresetButtonMgr.ItemTypes.Pose: case PresetButtonMgr.ItemTypes.Voice: case PresetButtonMgr.ItemTypes.BG: { UITexture component = gameObject.GetComponent(); component.mainTexture = itemPreset.m_txtItemIcon; this.m_currentItemIconWidth = component.width; break; } case PresetButtonMgr.ItemTypes.Clothes: case PresetButtonMgr.ItemTypes.PriSave: { UISprite component2 = gameObject.GetComponent(); string b = null; if (itemPreset.m_atlasName != b) { component2.atlas = Resources.Load(itemPreset.m_atlasName); b = itemPreset.m_atlasName; } component2.spriteName = itemPreset.m_spriteName; this.m_currentItemIconWidth = component2.width; break; } } gameObject.transform.name = itemPreset.m_name; gameObject.transform.parent = this.m_goParentItemBtn.transform; gameObject.transform.localScale = Vector3.one; gameObject.transform.localPosition = Vector3.zero; gameObject.transform.rotation = Quaternion.identity; switch (itemPreset.m_itemType) { case PresetButtonMgr.ItemTypes.Pose: { UIButton component3 = gameObject.GetComponent(); EventDelegate.Add(component3.onClick, new EventDelegate.Callback(this.ClickPose)); break; } case PresetButtonMgr.ItemTypes.Clothes: { UIButton component3 = gameObject.GetComponent(); EventDelegate.Add(component3.onClick, new EventDelegate.Callback(this.ClickClothes)); break; } case PresetButtonMgr.ItemTypes.PriSave: { UIButton component3 = gameObject.GetComponent(); EventDelegate.Add(component3.onClick, new EventDelegate.Callback(this.PresetSave)); break; } case PresetButtonMgr.ItemTypes.Voice: { UIButton component3 = gameObject.GetComponent(); EventDelegate.Add(component3.onClick, new EventDelegate.Callback(this.ClickVoice)); break; } case PresetButtonMgr.ItemTypes.BG: { UIButton component3 = gameObject.GetComponent(); EventDelegate.Add(component3.onClick, new EventDelegate.Callback(this.ClickBG)); break; } } } } public void initItemBtnList(List listItemPreset) { foreach (PresetButtonCtrl.ItemPreset itemPreset in listItemPreset) { this.initBtnList("itemPresetButtons", itemPreset.m_name); } } public void AdjustItemPresets(string type, string clickBtnName, string prevActiveBtnName) { PresetButtonCtrl.PresetButton btn = new PresetButtonCtrl.PresetButton(); PresetButtonCtrl.PresetButton btn2 = new PresetButtonCtrl.PresetButton(); if (type == "PresetButtons") { btn = this.m_listPresetBtn[clickBtnName]; if (prevActiveBtnName != null) { btn2 = this.m_listPresetBtn[prevActiveBtnName]; } } else if (type == "ItemPresetsViewer") { btn = this.m_listItemPresetBtn[clickBtnName]; if (prevActiveBtnName != null) { btn2 = this.m_listItemPresetBtn[prevActiveBtnName]; } } this.SetActiveBtn(btn, true); if (prevActiveBtnName != null) { this.SetActiveBtn(btn2, false); } if (type == "PresetButtons") { if (clickBtnName == PresetButtonCtrl.LeftButtons.View.ToString()) { this.m_goItemPresetsViewer.SetActive(false); } else { this.AdjustScrollViewWidth(); this.m_goItemPresetsViewer.transform.position = new Vector2(this.dicBtnPosX[clickBtnName], this.m_goItemPresetsViewer.transform.position.y); float num = -this.m_goItemPresetsViewer.transform.localPosition.x + (float)(this.m_spScrollViewBG.width / 2) - (float)(this.m_nguiContentWidth / 2); if (num > 0f) { this.m_goItemPresetsViewer.transform.localPosition = new Vector2(this.m_goItemPresetsViewer.transform.localPosition.x + num, this.m_goItemPresetsViewer.transform.localPosition.y); } this.m_goItemPresetsViewer.SetActive(true); this.m_goParentItemBtn.GetComponent().Reposition(); this.AdjustScrollViewItemPos(); if (this.m_scrollViewWidthOver) { this.m_sbScrollBar.value = 0f; } } } } private void AdjustScrollViewItemPos() { UIScrollView component = this.m_goItemScrollView.GetComponent(); component.ResetPosition(); } public void SetDefaultScrollBarPos() { this.m_sbScrollBar.value = 0f; } private void AdjustScrollViewWidth() { this.m_scrollViewWidthOver = false; int num = (this.m_currentItemIconWidth + this.itemIconOffsetX) * this.m_listItemPresetBtn.Count + this.m_scrollViewSoftnessX; if (num > this.m_maxScrollViewWidth) { num = this.m_maxScrollViewWidth; this.m_scrollViewWidthOver = true; } this.m_scrollViewSize.z = (float)(num + 10); this.m_pItemScrollViewPanel.baseClipRegion = this.m_scrollViewSize; int num2 = this.m_currentItemIconWidth * 3; int num3 = num2 + num; if (num3 > this.m_ajustedNguiContentWidth) { num3 = this.m_ajustedNguiContentWidth; } this.m_spScrollViewBG.width = num3; UIGrid component = this.m_goParentItemBtn.GetComponent(); component.cellWidth = (float)(this.m_currentItemIconWidth + this.itemIconOffsetX); } private void SetActiveBtn(PresetButtonCtrl.PresetButton btn, bool active) { if (Enum.IsDefined(typeof(PresetButtonMgr.ItemTypes), btn.m_name)) { btn.m_goSelectCursor.SetActive(active); if (btn.m_goWindowArrow != null) { btn.m_goWindowArrow.SetActive(active); } if (active) { btn.m_btnButton.defaultColor = this.activeColor; } else { btn.m_btnButton.defaultColor = this.inActiveColor; } } } public void SetActiveBtn(string btnName, bool active) { PresetButtonCtrl.PresetButton btn = this.m_listPresetBtn[btnName]; this.SetActiveBtn(btn, active); } private Dictionary LoadPriSaveData() { Dictionary dictionary = new Dictionary(); PresetButtonCtrl.ItemPreset itemPreset = new PresetButtonCtrl.ItemPreset(); itemPreset.m_name = PresetButtonCtrl.PriSaveButton.PriSave_WearAndBody.ToString(); itemPreset.m_atlasName = "SceneEdit/Preset/Atlas/AtlasPreset"; itemPreset.m_spriteName = "cm3d2_edit_priset_buttom_clothes_body"; itemPreset.m_spItemIcon = this.m_spItemIcon; itemPreset.m_itemType = PresetButtonMgr.ItemTypes.PriSave; dictionary.Add(itemPreset.m_name, itemPreset); itemPreset = new PresetButtonCtrl.ItemPreset(); itemPreset.m_name = PresetButtonCtrl.PriSaveButton.PriSave_Wear.ToString(); itemPreset.m_atlasName = "SceneEdit/Preset/Atlas/AtlasPreset"; itemPreset.m_spriteName = "cm3d2_edit_priset_buttom_clothes"; itemPreset.m_spItemIcon = this.m_spItemIcon; itemPreset.m_itemType = PresetButtonMgr.ItemTypes.PriSave; dictionary.Add(itemPreset.m_name, itemPreset); itemPreset = new PresetButtonCtrl.ItemPreset(); itemPreset.m_name = PresetButtonCtrl.PriSaveButton.PriSave_Body.ToString(); itemPreset.m_atlasName = "SceneEdit/Preset/Atlas/AtlasPreset"; itemPreset.m_spriteName = "cm3d2_edit_preset_buttom_body"; itemPreset.m_spItemIcon = this.m_spItemIcon; itemPreset.m_itemType = PresetButtonMgr.ItemTypes.PriSave; dictionary.Add(itemPreset.m_name, itemPreset); return dictionary; } private Dictionary LoadClothesData() { Dictionary dictionary = new Dictionary(); PresetButtonCtrl.ItemPreset itemPreset = new PresetButtonCtrl.ItemPreset(); itemPreset.m_name = PresetButtonCtrl.ClothesButton.Clothes_Dress.ToString(); itemPreset.m_atlasName = "SceneEdit/Preset/Atlas/AtlasPreset"; itemPreset.m_spriteName = "cm3d2_edit_clothesicon_dress"; itemPreset.m_spItemIcon = this.m_spItemIcon; itemPreset.m_itemType = PresetButtonMgr.ItemTypes.Clothes; dictionary.Add(itemPreset.m_name, itemPreset); itemPreset = new PresetButtonCtrl.ItemPreset(); itemPreset.m_name = PresetButtonCtrl.ClothesButton.Clothes_Lingerie.ToString(); itemPreset.m_atlasName = "SceneEdit/Preset/Atlas/AtlasPreset"; itemPreset.m_spriteName = "cm3d2_edit_clothesicon_lingerie"; itemPreset.m_spItemIcon = this.m_spItemIcon; itemPreset.m_itemType = PresetButtonMgr.ItemTypes.Clothes; dictionary.Add(itemPreset.m_name, itemPreset); itemPreset = new PresetButtonCtrl.ItemPreset(); itemPreset.m_name = PresetButtonCtrl.ClothesButton.Clothes_Nude.ToString(); itemPreset.m_atlasName = "SceneEdit/Preset/Atlas/AtlasPreset"; itemPreset.m_spriteName = "cm3d2_edit_clothesicon_nude"; itemPreset.m_spItemIcon = this.m_spItemIcon; itemPreset.m_itemType = PresetButtonMgr.ItemTypes.Clothes; dictionary.Add(itemPreset.m_name, itemPreset); return dictionary; } private Dictionary LoadItemData(string clickBtnName) { Dictionary dictionary = new Dictionary(); Personal.Data personal = this.m_maid.status.personal; SceneEdit.PVBInfo[] array = null; if (clickBtnName == PresetButtonMgr.ItemTypes.Voice.ToString()) { array = this.m_sceneEdit.m_dicVoice[personal].ToArray(); } int num = 0; foreach (SceneEdit.PVBInfo pvbinfo in array) { PresetButtonCtrl.ItemPreset itemPreset = new PresetButtonCtrl.ItemPreset(); itemPreset.m_name = clickBtnName + "_" + num; itemPreset.m_itemType = (PresetButtonMgr.ItemTypes)Enum.Parse(typeof(PresetButtonMgr.ItemTypes), clickBtnName); itemPreset.m_pvbInfo = pvbinfo; itemPreset.m_txtItemIcon = pvbinfo.texIcon; dictionary.Add(itemPreset.m_name, itemPreset); num++; } return dictionary; } public void PresetSaveType(PresetSaveWindow.SaveType type) { PresetMgr.Filter filter = PresetMgr.Filter.None; if (type == PresetSaveWindow.SaveType.All) { Debug.Log("「服/体」が押下されました"); if (Input.GetKey(KeyCode.RightAlt) || Input.GetKey(KeyCode.LeftAlt)) { GameMain.Instance.CharacterMgr.PresetSaveAsQRCode(this.m_maid, CharacterMgr.PresetType.All); GameMain.Instance.SysDlg.Show("QRコードとして保存しました\n(通常の保存を行いたい場合は「Alt」を押さずに保存してください)", SystemDialog.TYPE.OK, null, null); } else { GameMain.Instance.CharacterMgr.PresetSave(this.m_maid, CharacterMgr.PresetType.All); filter = PresetMgr.Filter.All; } } else if (type == PresetSaveWindow.SaveType.ClothesOnly) { Debug.Log("「服」が押下されました"); if (Input.GetKey(KeyCode.RightAlt) || Input.GetKey(KeyCode.LeftAlt)) { GameMain.Instance.CharacterMgr.PresetSaveAsQRCode(this.m_maid, CharacterMgr.PresetType.Wear); GameMain.Instance.SysDlg.Show("QRコードとして保存しました\n(通常の保存を行いたい場合は「Alt」を押さずに保存してください)", SystemDialog.TYPE.OK, null, null); } else { GameMain.Instance.CharacterMgr.PresetSave(this.m_maid, CharacterMgr.PresetType.Wear); filter = PresetMgr.Filter.Wear; } } else if (type == PresetSaveWindow.SaveType.BodyOnly) { if (Input.GetKey(KeyCode.RightAlt) || Input.GetKey(KeyCode.LeftAlt)) { GameMain.Instance.CharacterMgr.PresetSaveAsQRCode(this.m_maid, CharacterMgr.PresetType.Body); GameMain.Instance.SysDlg.Show("QRコードとして保存しました\n(通常の保存を行いたい場合は「Alt」を押さずに保存してください)", SystemDialog.TYPE.OK, null, null); } else { Debug.Log("「体」が押下されました"); GameMain.Instance.CharacterMgr.PresetSave(this.m_maid, CharacterMgr.PresetType.Body); filter = PresetMgr.Filter.Body; } } else { Debug.LogError(string.Format("不適切なボタンが押下されました。ボタン名={0}", type.ToString())); } if (this.isActivePresetPanel()) { float scrollBarValue = BaseMgr.Instance.GetScrollBarValue(); BaseMgr.Instance.UpdatePresetList(); Debug.Log("Call UpdatePresetList"); if (PresetMgr.m_currentActiveFilterBtnName != PresetMgr.Filter.None) { BaseMgr.Instance.UpdateFilterPreset(PresetMgr.m_currentActiveFilterBtnName); Debug.Log("Call UpdateFilterPreset"); if (PresetMgr.m_currentActiveFilterBtnName != PresetMgr.Filter.NotFilter && PresetMgr.m_currentActiveFilterBtnName != filter) { BaseMgr.Instance.SetScrollBar(scrollBarValue); } } } } private void PresetSave() { string name = UIButton.current.name; if (name == PresetButtonCtrl.PriSaveButton.PriSave_WearAndBody.ToString()) { this.PresetSaveType(PresetSaveWindow.SaveType.All); } else if (name == PresetButtonCtrl.PriSaveButton.PriSave_Wear.ToString()) { this.PresetSaveType(PresetSaveWindow.SaveType.ClothesOnly); } else if (name == PresetButtonCtrl.PriSaveButton.PriSave_Body.ToString()) { this.PresetSaveType(PresetSaveWindow.SaveType.BodyOnly); } else { Debug.LogError(string.Format("不適切なボタンが押下されました。ボタン名={0}", name)); } } private bool isActivePresetPanel() { UIRoot componentInParent = base.GetComponentInParent(); GameObject gameObject = componentInParent.transform.Find("PresetPanel").gameObject; return gameObject.activeSelf; } private void ClickClothes() { string name = UIButton.current.name; this.ClickClothesByButtonName(name); } public void ClickClothesByButtonName(string clickBtnName) { if (clickBtnName == "Clothes_Nude") { this.m_sceneEdit.ClothesState(SceneEditInfo.ClothesState.Nude); } else if (clickBtnName == "Clothes_Dress") { this.m_sceneEdit.ClothesState(SceneEditInfo.ClothesState.Wear); } else if (clickBtnName == "Clothes_Lingerie") { this.m_sceneEdit.ClothesState(SceneEditInfo.ClothesState.Underwear); } Debug.Log(string.Format("{0}が押下(実行)されました。", clickBtnName)); } private void ClickBG() { } private void ClickVoice() { string name = UIButton.current.name; PresetButtonCtrl.ItemPreset itemPreset; if (this.m_dicItem.TryGetValue(name, out itemPreset)) { this.m_sceneEdit.Voice(itemPreset.m_pvbInfo); Debug.Log(string.Format("{0}が押下されました。", name)); } else { Debug.LogError(string.Format("不適切なボタンが押下されました。ボタン名={0}", name)); } } private void ClickPose() { } [SerializeField] private int itemIconOffsetX = 15; private Maid m_maid; private SceneEdit m_sceneEdit; private Dictionary m_listPresetBtn; private Dictionary m_listItemPresetBtn; private Dictionary m_dicItem; private GameObject m_goPresetButtonPanel; private GameObject m_goItemBtn; private GameObject m_goItemPresetsViewer; private GameObject m_goItemScrollView; private GameObject m_goParentItemBtn; private UISprite m_spItemIcon; private UISprite m_spScrollViewBG; private UIPanel m_pItemScrollViewPanel; private UIScrollBar m_sbScrollBar; private bool m_scrollViewWidthOver; private GameObject m_goItemSpriteBtn; private GameObject m_goItemTxtrBtn; private Color activeColor; private Color inActiveColor; private int m_currentItemIconWidth; private Vector4 m_scrollViewSize; private int m_maxScrollViewWidth; private int m_scrollViewSoftnessX; private int m_ajustedNguiContentWidth; private int m_nguiContentWidth; private Dictionary dicBtnPosX; private const string ITEM_SPRITE_PRESET_BUTTON_PATH = "SceneEdit/PresetButton/Prefabs/ItemSpritePresetButton"; private const string ITEM_TXTR_PRESET_BUTTON_PATH = "SceneEdit/PresetButton/Prefabs/ItemTxtrPresetButton"; private const string ATLAS_PRESET = "SceneEdit/Preset/Atlas/AtlasPreset"; private const string PRISAVE_CLOTHES_BODY_SPRITE_NAME = "cm3d2_edit_priset_buttom_clothes_body"; private const string PRISAVE_CLOTHES_SPRITE_NAME = "cm3d2_edit_priset_buttom_clothes"; private const string PRISAVE_BODY_SPRITE_NAME = "cm3d2_edit_preset_buttom_body"; private const string CLOTHES_NUDE_SPRITE_NAME = "cm3d2_edit_clothesicon_nude"; private const string CLOTHES_DRESS_SPRITE_NAME = "cm3d2_edit_clothesicon_dress"; private const string CLOTHES_LINGERIE_SPRITE_NAME = "cm3d2_edit_clothesicon_lingerie"; private const int RIGHT_OFFSET = 650; private string last_draw_type_; private float backup_pose_scroll_pos_; private float backup_bg_scroll_pos_; private enum LeftButtons { View, Clothes, PriSave } private enum RightButtons { Voice } private enum PriSaveButton { PriSave_Wear, PriSave_Body, PriSave_WearAndBody } private enum ClothesButton { Clothes_Nude, Clothes_Dress, Clothes_Lingerie } public class ItemPreset { public string m_name { get; set; } public PresetButtonMgr.ItemTypes m_itemType { get; set; } public string m_atlasName { get; set; } public string m_spriteName { get; set; } public UISprite m_spItemIcon { get; set; } public SceneEdit.PVBInfo m_pvbInfo { get; set; } public Texture2D m_txtItemIcon { get; set; } } private class PresetButton { public string m_name { get; set; } public UIButton m_btnButton { get; set; } public GameObject m_goSelectCursor { get; set; } public GameObject m_goWindowArrow { get; set; } } }