123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- using System;
- using System.Collections.Generic;
- using MaidStatus;
- using SceneEditWindow;
- using UnityEngine;
- using wf;
- public class BodyStatusMgr : BaseMgr<BodyStatusMgr>
- {
- private void Start()
- {
- this.Init();
- }
- private void OnDestroy()
- {
- foreach (KeyValuePair<string, Texture2D> keyValuePair in this.texDic)
- {
- UnityEngine.Object.DestroyImmediate(keyValuePair.Value);
- }
- this.texDic.Clear();
- }
- private void Init()
- {
- this.m_goPanel = base.GetComponentInParent<UIRoot>().transform.Find("BodyStatusPanel").gameObject;
- this.m_BodyPanel = UTY.GetChildObject(this.m_goPanel, "Panel1", false);
- this.m_MotionPanel = UTY.GetChildObject(this.m_goPanel, "Panel2", false);
- EventDelegate.Add(UTY.GetChildObject(this.m_MotionPanel, "Close", false).GetComponent<UIButton>().onClick, new EventDelegate.Callback(this.CloseMotionPanel));
- EventDelegate.Add(this.CreateItemObject(UTY.GetChildObject(this.m_MotionPanel, "Grid", false), "com3d2_poseicon0001.tex").onClick, new EventDelegate.Callback(this.PlayMotionYure1));
- EventDelegate.Add(this.CreateItemObject(UTY.GetChildObject(this.m_MotionPanel, "Grid", false), "com3d2_poseicon0002.tex").onClick, new EventDelegate.Callback(this.PlayMotionYure2));
- EventDelegate.Add(this.CreateItemObject(UTY.GetChildObject(this.m_MotionPanel, "Grid", false), "cm3d2_poseicon01.tex").onClick, new EventDelegate.Callback(this.PlayMotionNormal));
- UTY.GetChildObject(this.m_MotionPanel, "Grid", false).GetComponent<UIGrid>().Reposition();
- this.m_ctrl = base.GetCtrl<BodyStatusCtrl>();
- this.m_ctrl.Init(this, this.m_BodyPanel);
- this.ClosePanel();
- }
- public void OpenPanel(bool muneYurePanel)
- {
- this.UpdateBodyStatus();
- this.m_goPanel.SetActive(true);
- this.m_BodyPanel.SetActive(true);
- if (muneYurePanel)
- {
- this.m_MotionPanel.SetActive(true);
- }
- }
- public void UpdateBodyStatus()
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
- BodyStatusCtrl.Status data = this.LoadData(maid);
- this.m_ctrl.SetData(data);
- }
- private BodyStatusCtrl.Status LoadData(Maid maid)
- {
- Status status = maid.status;
- status.UpdateBodyParam();
- return new BodyStatusCtrl.Status
- {
- height = status.body.height,
- weight = status.body.weight,
- bust = status.body.bust,
- cup = status.body.cup,
- waist = status.body.waist,
- hip = status.body.hip
- };
- }
- public void PlayMotionNormal()
- {
- WindowManager component = base.GetComponentInParent<UIRoot>().transform.Find("Window").gameObject.GetComponent<WindowManager>();
- PoseIconWindow component2 = component.GetWindow("ポーズ").GetComponent<PoseIconWindow>();
- bool visibleAutoCam = SceneEdit.Instance.viewReset.GetVisibleAutoCam();
- SceneEdit.Instance.viewReset.SetVisibleAutoCam(false);
- component2.Exec(this.normalPoseId);
- SceneEdit.Instance.viewReset.SetVisibleAutoCam(visibleAutoCam);
- }
- public void PlayMotionYure1()
- {
- WindowManager component = base.GetComponentInParent<UIRoot>().transform.Find("Window").gameObject.GetComponent<WindowManager>();
- PoseIconWindow component2 = component.GetWindow("ポーズ").GetComponent<PoseIconWindow>();
- bool visibleAutoCam = SceneEdit.Instance.viewReset.GetVisibleAutoCam();
- SceneEdit.Instance.viewReset.SetVisibleAutoCam(false);
- component2.Exec(this.yure1PoseId);
- SceneEdit.Instance.viewReset.SetVisibleAutoCam(visibleAutoCam);
- }
- public void PlayMotionYure2()
- {
- WindowManager component = base.GetComponentInParent<UIRoot>().transform.Find("Window").gameObject.GetComponent<WindowManager>();
- PoseIconWindow component2 = component.GetWindow("ポーズ").GetComponent<PoseIconWindow>();
- bool visibleAutoCam = SceneEdit.Instance.viewReset.GetVisibleAutoCam();
- SceneEdit.Instance.viewReset.SetVisibleAutoCam(false);
- component2.Exec(this.yure2PoseId);
- SceneEdit.Instance.viewReset.SetVisibleAutoCam(visibleAutoCam);
- }
- public void CloseBodyPanel()
- {
- this.m_BodyPanel.SetActive(false);
- }
- public void CloseMotionPanel()
- {
- this.m_MotionPanel.SetActive(false);
- }
- public void ClosePanel()
- {
- this.m_BodyPanel.SetActive(false);
- this.m_MotionPanel.SetActive(false);
- this.m_goPanel.SetActive(false);
- }
- protected UIWFTabButton CreateItemObject(GameObject parent, string iconTexName)
- {
- GameObject gameObject = Utility.CreatePrefab(parent, "SceneEdit/WindowParts/PoseIconItem", true);
- if (!this.texDic.ContainsKey(iconTexName))
- {
- this.texDic.Add(iconTexName, ImportCM.CreateTexture(iconTexName));
- }
- UITexture component = gameObject.GetComponent<UITexture>();
- component.mainTexture = this.texDic[iconTexName];
- return gameObject.GetComponent<UIWFTabButton>();
- }
- [SerializeField]
- private int normalPoseId = 100;
- [SerializeField]
- private int yure1PoseId = 1000;
- [SerializeField]
- private int yure2PoseId = 1010;
- private BodyStatusCtrl m_ctrl;
- private GameObject m_BodyPanel;
- private GameObject m_MotionPanel;
- private Dictionary<string, Texture2D> texDic = new Dictionary<string, Texture2D>();
- }
|