using System; using SceneEditWindow; using UnityEngine; public class BodySelectCtrl : MonoBehaviour { private void Start() { this.m_sceneEdit = GameObject.Find("__SceneEdit__").GetComponent(); this.oldBodyButtonFrame = UTY.GetChildObject(this.oldBodyButton.gameObject, "Frame", false).GetComponent(); this.newBodyButtonFrame = UTY.GetChildObject(this.newBodyButton.gameObject, "Frame", false).GetComponent(); this.defaultColor = this.oldBodyButton.defaultColor; if (this.m_sceneEdit != null) { this.FrameButtonActive(this.m_sceneEdit.maid); } } private void Update() { if (this.isBusy && !GameMain.Instance.CharacterMgr.IsBusy()) { GameMain.Instance.MainCamera.FadeIn(0.3f, false, null, true, true, default(Color)); if (!this.m_sceneEdit.maid.IsCrcBody) { this.m_sceneEdit.UpdataCollidert(); this.m_sceneEdit.pauseIconWindow.Exec(PoseIconData.itemList[0].id); } this.isBusy = false; } } public void FrameButtonActive(Maid maid) { if (maid.IsCrcBody) { this.FrameChange(true); this.newBodyButton.defaultColor = new Color(this.defaultColor.r, this.defaultColor.g, this.defaultColor.b, 1f); } else { this.FrameChange(false); this.oldBodyButton.defaultColor = new Color(this.defaultColor.r, this.defaultColor.g, this.defaultColor.b, 1f); } } public void NewBodyButtonEnabled(bool hasCrcBody) { this.newBodyButton.isEnabled = hasCrcBody; } public void FrameChange(bool isActive) { this.newBodyButtonFrame.gameObject.SetActive(isActive); this.oldBodyButtonFrame.gameObject.SetActive(!isActive); } public void OnClickOldBody() { if (SceneEdit.Instance.maid.IsCrcBody) { GameMain.Instance.CharacterMgr.SwapNewMaidBody(SceneEdit.Instance.maid.ActiveSlotNo, false); this.newBodyButton.defaultColor = this.defaultColor; this.oldBodyButton.defaultColor = new Color(this.defaultColor.r, this.defaultColor.g, this.defaultColor.b, 1f); this.FrameChange(false); this.m_sceneEdit.PanelOpenClose(); this.m_sceneEdit.UpdateCategoryButton(); if (GameMain.Instance.CharacterMgr.IsBusy()) { GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color)); } this.isBusy = true; } } public void OnClickNewBody() { if (!SceneEdit.Instance.maid.IsCrcBody) { GameMain.Instance.CharacterMgr.SwapNewMaidBody(SceneEdit.Instance.maid.ActiveSlotNo, true); this.oldBodyButton.defaultColor = this.defaultColor; this.newBodyButton.defaultColor = new Color(this.defaultColor.r, this.defaultColor.g, this.defaultColor.b, 1f); this.FrameChange(true); this.m_sceneEdit.PanelOpenClose(); this.m_sceneEdit.UpdateCategoryButton(); if (GameMain.Instance.CharacterMgr.IsBusy()) { GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color)); } this.isBusy = true; } } [SerializeField] private BodySelectMgr bodySelectMgr; [SerializeField] private UIButton oldBodyButton; [SerializeField] private UIButton newBodyButton; private UI2DSprite oldBodyButtonFrame; private UI2DSprite newBodyButtonFrame; private Color defaultColor; private SceneEdit m_sceneEdit; private bool isBusy; }