1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- using System.Collections.Generic;
- using ET;
- using FairyGUI;
- using UI.Poem;
- using UnityEngine;
- namespace GFGGame
- {
- public class PoemPhotoShareView : BaseWindow
- {
- private UI_PoemPhotoShareUI _ui;
- private List<PoemPhotoData> _photoInfos;
- private PoemPhotoData _curPhotoData;
- private int _curIndex = 0;
- private int _sourceType = 0;
- public override void Dispose()
- {
- if (_ui != null)
- {
- _ui.Dispose();
- _ui = null;
- }
- base.Dispose();
- }
- protected override void OnInit()
- {
- base.OnInit();
- packageName = UI_PoemPhotoShareUI.PACKAGE_NAME;
- _ui = UI_PoemPhotoShareUI.Create();
- this.viewCom = _ui.target;
- isfullScreen = true;
- _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("xc_bjbj");
- _ui.m_btnback.onClick.Add(OnBtnBackClick);
- _ui.m_btnSave.onClick.Add(OnBtnSaveClick);
- _ui.m_btnShare.onClick.Add(OnBtnShareClick);
- }
- protected override void AddEventListener()
- {
- base.AddEventListener();
- }
- protected override void OnShown()
- {
- base.OnShown();
- _curPhotoData = this.viewData as PoemPhotoData;
- _ui.m_loaBg.texture = _curPhotoData.Ntexture;
- _ui.m_loaBg.SetSize(_ui.m_loaBg.width, _ui.m_loaBg.texture.height * _ui.m_loaBg.width / _ui.m_loaBg.texture.width);
- }
- protected override void OnHide()
- {
- base.OnHide();
- }
- protected override void RemoveEventListener()
- {
- base.RemoveEventListener();
- }
- private void OnBtnBackClick()
- {
- ViewManager.GoBackFrom(typeof(PoemPhotoShareView).FullName);
- }
- private void OnBtnSaveClick()
- {
- byte[] bytes = _curPhotoData.Bytes;
- string fileName = "wsj" + TimeHelper.ServerNowSecs + ".jpg";
- PhotographDataManager.Instance.SavePicturoToLocal(bytes, fileName);
- }
- private void OnBtnShareClick()
- {
- }
- }
- }
|