using System; using System.Collections; using System.IO; using ET; using FairyGUI; using UI.DressUp; using UnityEngine; namespace GFGGame { public class PhotographSaveView : BaseView { private UI_PhotographSaveUI _ui; protected override void OnInit() { base.OnInit(); packageName = UI_PhotographUI.PACKAGE_NAME; _ui = UI_PhotographSaveUI.Create(); viewCom = _ui.target; isfullScreen = true; _ui.m_btnClose.onClick.Add(this.Hide); _ui.m_btnSave.onClick.Add(this.OnClickBtnSave); } protected override void OnShown() { base.OnShown(); Texture2D tex = this.viewData as Texture2D; _ui.m_imgRes.texture = new NTexture(tex); float width = _ui.m_imgBorder.width; float height = width * tex.height / tex.width; _ui.m_imgRes.SetSize(width, height); _ui.m_imgBorder.SetSize(width, height + 12); } protected override void OnHide() { base.OnHide(); } public override void Dispose() { if (_ui != null) { _ui.Dispose(); _ui = null; } base.Dispose(); } private void OnClickBtnSave() { Texture2D tex = this.viewData as Texture2D; PoemPhotoDataManager.Instance.SavePicturoToLocal(tex); } } }