|
@@ -4,6 +4,7 @@ using UnityEngine;
|
|
|
using System.Collections.Generic;
|
|
|
using System;
|
|
|
using ET;
|
|
|
+using System.Collections;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
@@ -109,7 +110,7 @@ namespace GFGGame
|
|
|
protected override void AddEventListener()
|
|
|
{
|
|
|
base.AddEventListener();
|
|
|
- EventAgent.AddEventListener(ConstMessage.CARD_CHOOSE, StartCalculateScore);
|
|
|
+ EventAgent.AddEventListener(ConstMessage.CARD_CHOOSE, OnClickBtnPhotograph);
|
|
|
EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
|
|
|
EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
|
|
|
EventAgent.AddEventListener(ConstMessage.DRESS_UP_SCORE_CHANGED, UpdateScore);
|
|
@@ -207,7 +208,7 @@ namespace GFGGame
|
|
|
protected override void RemoveEventListener()
|
|
|
{
|
|
|
base.RemoveEventListener();
|
|
|
- EventAgent.RemoveEventListener(ConstMessage.CARD_CHOOSE, StartCalculateScore);
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.CARD_CHOOSE, OnClickBtnPhotograph);
|
|
|
EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
|
|
|
EventAgent.RemoveEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
|
|
|
EventAgent.RemoveEventListener(ConstMessage.DRESS_UP_SCORE_CHANGED, UpdateScore);
|
|
@@ -412,9 +413,35 @@ namespace GFGGame
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- StartCalculateScore();
|
|
|
+ OnClickBtnPhotograph();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void OnClickBtnPhotograph()
|
|
|
+ {
|
|
|
+ Timers.inst.StartCoroutine(ScreenShotTex());
|
|
|
+ }
|
|
|
+ private IEnumerator ScreenShotTex()
|
|
|
+ {
|
|
|
+ ItemCfg bgItemCfg = ItemCfgArray.Instance.GetCfg(EquipDataCache.cacher.bgId);
|
|
|
+ string bgName = string.Format(DressUpUtil.FORMAT_SPRITE_NAME, bgItemCfg.subType, 1);
|
|
|
+ GameObject bg = _sceneObject.transform.Find(bgName).gameObject;
|
|
|
+ bg.SetActive(false);
|
|
|
+
|
|
|
+ GRoot.inst.visible = false;
|
|
|
+ yield return new WaitForEndOfFrame();
|
|
|
+
|
|
|
+ Rect rect = new Rect(0, 0, UnityEngine.Screen.width, UnityEngine.Screen.height);
|
|
|
+ Texture2D tex = new Texture2D((int)rect.width, (int)rect.height, TextureFormat.ARGB32, false);//新建一个Texture2D对象
|
|
|
+ tex.ReadPixels(rect, 0, 0);//读取像素,屏幕左下角为0点
|
|
|
+ tex.Apply();//保存像素信息
|
|
|
+
|
|
|
+ EquipDataCache.cacher.nTexture = new NTexture(tex);
|
|
|
+ GRoot.inst.visible = true;
|
|
|
+ bg.SetActive(true);
|
|
|
+
|
|
|
+ StartCalculateScore();
|
|
|
+ }
|
|
|
private void StartCalculateScore()
|
|
|
{
|
|
|
//不可移动代码位置
|
|
@@ -427,13 +454,7 @@ namespace GFGGame
|
|
|
FieldFightDataManager.Instance.equipDatas = EquipDataCache.cacher.equipDatas;
|
|
|
}
|
|
|
|
|
|
- ItemCfg bgItemCfg = ItemCfgArray.Instance.GetCfg(EquipDataCache.cacher.bgId);
|
|
|
- string bgName = string.Format(DressUpUtil.FORMAT_SPRITE_NAME, bgItemCfg.subType, 1);
|
|
|
- GameObject bg = _sceneObject.transform.Find(bgName).gameObject;
|
|
|
- bg.SetActive(false);
|
|
|
- // Camera camera = _sceneObject.transform.Find("Camera").gameObject.GetComponent<Camera>();
|
|
|
- EquipDataCache.cacher.nTexture = DressUpUtil.GetPrintscreenNTexture(Camera.main);
|
|
|
- bg.SetActive(true);
|
|
|
+
|
|
|
if (hasFightTarget)
|
|
|
{
|
|
|
ViewManager.Show(ViewName.STORY_FIGHT_TARGET_VIEW);
|
|
@@ -445,7 +466,6 @@ namespace GFGGame
|
|
|
this.Hide();
|
|
|
|
|
|
}
|
|
|
-
|
|
|
private void OnClickBtnRecommend()
|
|
|
{
|
|
|
if (this.currentListType == DressUpListType.List4)
|