123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using MaidStatus;
- using UnityEngine;
- public class VRTouchButtonCtrl : 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<string, VRTouchButtonCtrl.PresetButton>();
- this.m_listItemPresetBtn = new Dictionary<string, VRTouchButtonCtrl.PresetButton>();
- IEnumerator enumerator = Enum.GetValues(typeof(VRTouchButtonCtrl.LeftButtons)).GetEnumerator();
- try
- {
- while (enumerator.MoveNext())
- {
- object obj = enumerator.Current;
- this.initBtnList("LeftButtons", ((VRTouchButtonCtrl.LeftButtons)obj).ToString());
- }
- }
- finally
- {
- IDisposable disposable;
- if ((disposable = (enumerator as IDisposable)) != null)
- {
- disposable.Dispose();
- }
- }
- this.m_goParentItemBtn = UTY.GetChildObject(this.m_goItemPresetsViewer, "Scroll View/Grid", false);
- UIButton component = UTY.GetChildObject(this.m_goPresetButtonPanel, "PresetButtons/LeftButtons/BG", false).GetComponent<UIButton>();
- 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<UIScrollBar>();
- this.m_goItemScrollView = UTY.GetChildObject(this.m_goPresetButtonPanel, "ItemPresetsViewer/Scroll View", false);
- this.m_pItemScrollViewPanel = this.m_goItemScrollView.GetComponent<UIPanel>();
- GameObject childObject = UTY.GetChildObject(this.m_goPresetButtonPanel, "ItemPresetsViewer/BG", false);
- this.m_spScrollViewBG = childObject.GetComponent<UISprite>();
- 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 = GameObject.Find("UI Root").GetComponent<UIRoot>().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/BG", false).transform.position.x;
- this.dicBtnPosX = new Dictionary<string, float>
- {
- {
- "Pose",
- x
- },
- {
- "Clothes",
- x2
- },
- {
- "BG",
- x3
- }
- };
- 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<UISprite>();
- if (this.m_goSceneVRTouch == null)
- {
- this.m_goSceneVRTouch = GameObject.Find("_SceneVRTouch_");
- }
- this.m_sceneVRTouch = this.m_goSceneVRTouch.GetComponent<SceneVRTouch>();
- this.m_goItemPresetsViewer.SetActive(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<string, VRTouchButtonCtrl.ItemPreset>();
- 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()))
- {
- if (!(type == "PresetButtons") || !(clickBtnName == PresetButtonMgr.ItemTypes.Voice.ToString()))
- {
- if (type == "PresetButtons" && clickBtnName == PresetButtonMgr.ItemTypes.BG.ToString())
- {
- this.m_dicItem = this.LoadItemData(clickBtnName);
- }
- }
- }
- this.last_draw_type_ = clickBtnName;
- List<VRTouchButtonCtrl.ItemPreset> list = new List<VRTouchButtonCtrl.ItemPreset>();
- foreach (KeyValuePair<string, VRTouchButtonCtrl.ItemPreset> 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;
- VRTouchButtonCtrl.PresetButton presetButton = new VRTouchButtonCtrl.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<UIButton>();
- 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;
- }
- }
- private void LoadItemBtn(List<VRTouchButtonCtrl.ItemPreset> 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 (VRTouchButtonCtrl.ItemPreset itemPreset in listItemPreset)
- {
- GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(this.m_goItemBtn);
- switch (itemPreset.m_itemType)
- {
- case PresetButtonMgr.ItemTypes.Pose:
- case PresetButtonMgr.ItemTypes.Voice:
- case PresetButtonMgr.ItemTypes.BG:
- {
- UITexture component = gameObject.GetComponent<UITexture>();
- component.mainTexture = itemPreset.m_txtItemIcon;
- this.m_currentItemIconWidth = component.width;
- break;
- }
- case PresetButtonMgr.ItemTypes.Clothes:
- case PresetButtonMgr.ItemTypes.PriSave:
- {
- UISprite component2 = gameObject.GetComponent<UISprite>();
- string b = null;
- if (itemPreset.m_atlasName != b)
- {
- component2.atlas = Resources.Load<UIAtlas>(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<UIButton>();
- EventDelegate.Add(component3.onClick, new EventDelegate.Callback(this.ClickPose));
- break;
- }
- case PresetButtonMgr.ItemTypes.Clothes:
- {
- UIButton component3 = gameObject.GetComponent<UIButton>();
- EventDelegate.Add(component3.onClick, new EventDelegate.Callback(this.ClickClothes));
- break;
- }
- case PresetButtonMgr.ItemTypes.PriSave:
- {
- UIButton component3 = gameObject.GetComponent<UIButton>();
- EventDelegate.Add(component3.onClick, new EventDelegate.Callback(this.PresetSave));
- break;
- }
- case PresetButtonMgr.ItemTypes.Voice:
- {
- UIButton component3 = gameObject.GetComponent<UIButton>();
- EventDelegate.Add(component3.onClick, new EventDelegate.Callback(this.ClickVoice));
- break;
- }
- case PresetButtonMgr.ItemTypes.BG:
- {
- UIButton component3 = gameObject.GetComponent<UIButton>();
- EventDelegate.Add(component3.onClick, new EventDelegate.Callback(this.ClickBG));
- break;
- }
- }
- }
- }
- private void initItemBtnList(List<VRTouchButtonCtrl.ItemPreset> listItemPreset)
- {
- foreach (VRTouchButtonCtrl.ItemPreset itemPreset in listItemPreset)
- {
- this.initBtnList("itemPresetButtons", itemPreset.m_name);
- }
- }
- public void AdjustItemPresets(string type, string clickBtnName, string prevActiveBtnName)
- {
- VRTouchButtonCtrl.PresetButton btn = new VRTouchButtonCtrl.PresetButton();
- VRTouchButtonCtrl.PresetButton btn2 = new VRTouchButtonCtrl.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")
- {
- 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<UIGrid>().Reposition();
- this.AdjustScrollViewItemPos();
- if (this.m_scrollViewWidthOver)
- {
- this.m_sbScrollBar.value = 0f;
- }
- }
- }
- private void AdjustScrollViewItemPos()
- {
- UIScrollView component = this.m_goItemScrollView.GetComponent<UIScrollView>();
- 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;
- 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<UIGrid>();
- component.cellWidth = (float)(this.m_currentItemIconWidth + this.itemIconOffsetX);
- }
- private void SetActiveBtn(VRTouchButtonCtrl.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)
- {
- VRTouchButtonCtrl.PresetButton btn = this.m_listPresetBtn[btnName];
- this.SetActiveBtn(btn, active);
- }
- private Dictionary<string, VRTouchButtonCtrl.ItemPreset> LoadClothesData()
- {
- Dictionary<string, VRTouchButtonCtrl.ItemPreset> dictionary = new Dictionary<string, VRTouchButtonCtrl.ItemPreset>();
- VRTouchButtonCtrl.ItemPreset itemPreset = new VRTouchButtonCtrl.ItemPreset();
- itemPreset.m_name = VRTouchButtonCtrl.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 VRTouchButtonCtrl.ItemPreset();
- itemPreset.m_name = VRTouchButtonCtrl.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 VRTouchButtonCtrl.ItemPreset();
- itemPreset.m_name = VRTouchButtonCtrl.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<string, VRTouchButtonCtrl.ItemPreset> LoadItemData(string clickBtnName)
- {
- Dictionary<string, VRTouchButtonCtrl.ItemPreset> dictionary = new Dictionary<string, VRTouchButtonCtrl.ItemPreset>();
- Personal.Data personal = this.m_maid.status.personal;
- SceneEdit.PVBInfo[] array = null;
- if (clickBtnName == PresetButtonMgr.ItemTypes.Pose.ToString())
- {
- array = this.m_sceneVRTouch.m_listPose.ToArray();
- }
- else if (!(clickBtnName == PresetButtonMgr.ItemTypes.Voice.ToString()))
- {
- if (clickBtnName == PresetButtonMgr.ItemTypes.BG.ToString())
- {
- array = this.m_sceneVRTouch.m_listBg.ToArray();
- }
- }
- int num = 0;
- foreach (SceneEdit.PVBInfo pvbinfo in array)
- {
- VRTouchButtonCtrl.ItemPreset itemPreset = new VRTouchButtonCtrl.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;
- }
- private void PresetSave()
- {
- string name = UIButton.current.name;
- PresetMgr.Filter filter = PresetMgr.Filter.None;
- if (name == VRTouchButtonCtrl.PriSaveButton.PriSave_WearAndBody.ToString())
- {
- Debug.Log("「服/体」が押下されました");
- GameMain.Instance.CharacterMgr.PresetSave(this.m_maid, CharacterMgr.PresetType.All);
- filter = PresetMgr.Filter.All;
- }
- else if (name == VRTouchButtonCtrl.PriSaveButton.PriSave_Wear.ToString())
- {
- Debug.Log("「服」が押下されました");
- GameMain.Instance.CharacterMgr.PresetSave(this.m_maid, CharacterMgr.PresetType.Wear);
- filter = PresetMgr.Filter.Wear;
- }
- else if (name == VRTouchButtonCtrl.PriSaveButton.PriSave_Body.ToString())
- {
- Debug.Log("「体」が押下されました");
- GameMain.Instance.CharacterMgr.PresetSave(this.m_maid, CharacterMgr.PresetType.Body);
- filter = PresetMgr.Filter.Body;
- }
- else
- {
- Debug.LogError(string.Format("不適切なボタンが押下されました。ボタン名={0}", name));
- }
- if (this.isActivePresetPanel())
- {
- float scrollBarValue = BaseMgr<PresetMgr>.Instance.GetScrollBarValue();
- BaseMgr<PresetMgr>.Instance.UpdatePresetList();
- Debug.Log("Call UpdatePresetList");
- if (PresetMgr.m_currentActiveFilterBtnName != PresetMgr.Filter.None)
- {
- BaseMgr<PresetMgr>.Instance.UpdateFilterPreset(PresetMgr.m_currentActiveFilterBtnName);
- Debug.Log("Call UpdateFilterPreset");
- if (PresetMgr.m_currentActiveFilterBtnName != PresetMgr.Filter.NotFilter && PresetMgr.m_currentActiveFilterBtnName != filter)
- {
- BaseMgr<PresetMgr>.Instance.SetScrollBar(scrollBarValue);
- }
- }
- }
- }
- private bool isActivePresetPanel()
- {
- GameObject gameObject = GameObject.Find("/UI Root");
- GameObject gameObject2 = gameObject.transform.Find("PresetPanel").gameObject;
- return gameObject2.activeSelf;
- }
- private void ClickClothes()
- {
- string name = UIButton.current.name;
- this.ClickClothesByButtonName(name);
- }
- public void ClickClothesByButtonName(string clickBtnName)
- {
- if (clickBtnName == "Clothes_Nude")
- {
- this.m_sceneVRTouch.ClothesState(SceneEditInfo.ClothesState.Nude);
- }
- else if (clickBtnName == "Clothes_Dress")
- {
- this.m_sceneVRTouch.ClothesState(SceneEditInfo.ClothesState.Wear);
- }
- else if (clickBtnName == "Clothes_Lingerie")
- {
- this.m_sceneVRTouch.ClothesState(SceneEditInfo.ClothesState.Underwear);
- }
- Debug.Log(string.Format("{0}が押下(実行)されました。", clickBtnName));
- }
- private void ClickBG()
- {
- string name = UIButton.current.name;
- VRTouchButtonCtrl.ItemPreset itemPreset;
- if (this.m_dicItem.TryGetValue(name, out itemPreset))
- {
- this.m_sceneVRTouch.Bg(itemPreset.m_pvbInfo);
- Debug.Log(string.Format("{0}が押下されました。", name));
- }
- else
- {
- Debug.LogError(string.Format("不適切なボタンが押下されました。ボタン名={0}", name));
- }
- }
- private void ClickVoice()
- {
- string name = UIButton.current.name;
- VRTouchButtonCtrl.ItemPreset itemPreset;
- if (this.m_dicItem.TryGetValue(name, out itemPreset))
- {
- Debug.Log(string.Format("{0}が押下されました。", name));
- }
- else
- {
- Debug.LogError(string.Format("不適切なボタンが押下されました。ボタン名={0}", name));
- }
- }
- private void ClickPose()
- {
- string name = UIButton.current.name;
- VRTouchButtonCtrl.ItemPreset itemPreset;
- if (this.m_dicItem.TryGetValue(name, out itemPreset))
- {
- this.m_sceneVRTouch.Pose(itemPreset.m_pvbInfo);
- Debug.Log(string.Format("{0}が押下されました。", name));
- }
- else
- {
- Debug.LogError(string.Format("不適切なボタンが押下されました。ボタン名={0}", name));
- }
- }
- public GameObject m_goSceneVRTouch;
- [SerializeField]
- private int itemIconOffsetX = 15;
- private Maid m_maid;
- private SceneVRTouch m_sceneVRTouch;
- private Dictionary<string, VRTouchButtonCtrl.PresetButton> m_listPresetBtn;
- private Dictionary<string, VRTouchButtonCtrl.PresetButton> m_listItemPresetBtn;
- private Dictionary<string, VRTouchButtonCtrl.ItemPreset> 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<string, float> 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
- {
- Pose,
- Clothes,
- BG
- }
- private enum PriSaveButton
- {
- PriSave_Wear,
- PriSave_Body,
- PriSave_WearAndBody
- }
- private enum ClothesButton
- {
- Clothes_Nude,
- Clothes_Dress,
- Clothes_Lingerie
- }
- private 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; }
- }
- }
|