public void Add(PageRecord pageRecord) { var datas = _dataSource.GetData(); datas.pageRecords.Add(pageRecord); Debug.Log("Add Page Records : " + datas.pageRecords.Count); _dataSource.UpdateXMLData(); }
public void Init(PageRecord pageRecord, bool isCover, bool isDefault) { _pageRecord = pageRecord; _manager = GameObject.Find("MainBrain").GetComponent <BCManager>(); if (isDefault) { _defaultContainer.gameObject.SetActive(true); _normalContainer.gameObject.SetActive(false); _coverContainer.gameObject.SetActive(false); } else { _defaultContainer.gameObject.SetActive(false); if (isCover) { _normalContainer.gameObject.SetActive(false); _coverContainer.gameObject.SetActive(true); } else { _coverContainer.gameObject.SetActive(false); if (_bookPageType == BookPageType.Left) { // 设置签名图片 _signImage.sprite = _manager.daoManager.GetImageSprite(_pageRecord.SignAddress); // 设置时间 _cdateText.text = _pageRecord.Cdate.ToString("yyyy.MM.dd"); } else { _normalContainer.gameObject.SetActive(true); Debug.Log(_pageRecord.PhotoAddress); // 设置照片 if (_pageRecord.PhotoAddress == null) { _defaultContainer.gameObject.SetActive(true); _normalContainer.gameObject.SetActive(false); } else { _photoImage.sprite = _manager.daoManager.GetImageSprite(_pageRecord.PhotoAddress); } } } } }
/// <summary> /// 保存签名 /// </summary> private void SaveSign() { DateTime dateTime = DateTime.Now; _signDateTime = dateTime; PageRecord pageRecord = new PageRecord(); pageRecord.Cdate = dateTime; // 保存签名 var texture = _writePadAgent.GetTexture(); var result = _manager.daoManager.SaveTexture(dateTime, texture, SaveTextureType.Sign); string signAddress = (string)result.GetData(); pageRecord.SignAddress = signAddress; _manager.daoManager.GetDaoService().Add(pageRecord); }