Commit 7e08d726 authored by shujianhe's avatar shujianhe

1

parent 93c80321
...@@ -572,7 +572,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -572,7 +572,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
utilsTools.setGDataByKey("NativeTempData", "main"); utilsTools.setGDataByKey("NativeTempData", "main");
SceneManager.LoadScene("Scenes/MainGame"); SceneManager.LoadScene("Scenes/MainGame");
return false; return false;
}, 35); }, 40);
} }
public void onTestTemp1() public void onTestTemp1()
......
...@@ -44,6 +44,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler ...@@ -44,6 +44,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
if(isSuccess) if(isSuccess)
{ {
HistoryClick historyClick = JsonUtility.FromJson<HistoryClick>(data as string); HistoryClick historyClick = JsonUtility.FromJson<HistoryClick>(data as string);
if (historyClick == null) return 0;
string history = historyClick.getHistory(); string history = historyClick.getHistory();
gameScenUserInfo.setShowAreaids(history); gameScenUserInfo.setShowAreaids(history);
return 0; return 0;
...@@ -148,8 +149,37 @@ public class gameUserInfos : MonoBehaviour, IEventHandler ...@@ -148,8 +149,37 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
Debug.Log("onCloseScenePrveHandler 2"); Debug.Log("onCloseScenePrveHandler 2");
utilsTools.saveGameScenUserInfo(gameScenUserInfo); utilsTools.saveGameScenUserInfo(gameScenUserInfo);
Debug.Log("onCloseScenePrveHandler 3"); Debug.Log("onCloseScenePrveHandler 3");
string nativeParam1 = utilsTools.getGDataByKey<string>("NativeTempData", "");
if (nativeParam1.Equals("") == false)
{
float allAreaSize = (float)utilsTools.getGDataByKey<int>("allAreaSize", 0);
float schedule1 = (int)(gameScenUserInfo.areaInfoUseData.Count * 100f / allAreaSize);
int schedule = 0;
if (schedule1 < 1.00001)
{
schedule = 1;
}
else if (schedule1 > 98.999999991)
{
if (utilsTools.getGDataByKey<int>("allAreaSize", 0).Equals(gameScenUserInfo.areaInfoUseData.Count))
{
schedule = 100;
}
else
{
schedule = 99;
}
}
else
{
schedule = (int)schedule1;
}
nativeParam1 = nativeParam1 + "_" + schedule.ToString();
utilsTools.setGDataByKey("NativeTempData", nativeParam1);
}
updateProgress(); updateProgress();
Debug.Log("onCloseScenePrveHandler 4"); Debug.Log("onCloseScenePrveHandler 4");
gameScenUserInfo = null;//直接释放如果期间没有保存,就一起丢失 gameScenUserInfo = null;//直接释放如果期间没有保存,就一起丢失
} }
} }
......
...@@ -38,11 +38,11 @@ public class mainGameView : MonoBehaviour ...@@ -38,11 +38,11 @@ public class mainGameView : MonoBehaviour
private GameScenUserInfo gameScenUseInfo = null; private GameScenUserInfo gameScenUseInfo = null;
//x,y aid 当前帧向量 起点终点 等宽度计算扩散 //x,y aid 当前帧向量 起点终点 等宽度计算扩散
private List<AreaAnimationDiffuse> showAreaAnimationDatas = new List<AreaAnimationDiffuse>(); private List<AreaAnimationDiffuse> showAreaAnimationDatas = new List<AreaAnimationDiffuse>();
private Dictionary<short, GroupByAreaPtInfos> groupPtInfos = new Dictionary<short, GroupByAreaPtInfos>(); protected Dictionary<short, GroupByAreaPtInfos> groupPtInfos = new Dictionary<short, GroupByAreaPtInfos>();
private Dictionary<short, GroupByAreaPtInfos> groupPtInfos_All = new Dictionary<short, GroupByAreaPtInfos>();//不管是否涂色都会记录 protected Dictionary<short, GroupByAreaPtInfos> groupPtInfos_All = new Dictionary<short, GroupByAreaPtInfos>();//不管是否涂色都会记录
protected short bianlun = -1; protected short bianlun = -1;
protected short fullShow = -2; protected short fullShow = -2;
private Texture2D thumbnailTexture2d = null; protected Texture2D thumbnailTexture2d = null;
private bool isDebugTestToEnd = false; private bool isDebugTestToEnd = false;
public GameObject clickPosEff = null; public GameObject clickPosEff = null;
Dictionary<string, Color[]> allColor = new Dictionary<string, Color[]>(); Dictionary<string, Color[]> allColor = new Dictionary<string, Color[]>();
...@@ -528,7 +528,7 @@ public class mainGameView : MonoBehaviour ...@@ -528,7 +528,7 @@ public class mainGameView : MonoBehaviour
} }
public void updateScaleView() public void updateScaleView()
{ {
Vector3 vector3 = lineImg.transform.localScale; Vector3 vector3 = areaIdBase.transform.localScale;
float dyMinShowFontSize = utilsTools.getGDataByKey<float>("dyMinShowFontSize", minShowFontSize); float dyMinShowFontSize = utilsTools.getGDataByKey<float>("dyMinShowFontSize", minShowFontSize);
if (areaIdBase != null && perfabPath.Equals("") == false) if (areaIdBase != null && perfabPath.Equals("") == false)
{ {
...@@ -717,17 +717,13 @@ public class mainGameView : MonoBehaviour ...@@ -717,17 +717,13 @@ public class mainGameView : MonoBehaviour
utilsTools.sendEventObjectParams("inGameLoadingValue", 3f, false); utilsTools.sendEventObjectParams("inGameLoadingValue", 3f, false);
fillAnimation = Boolean.Parse(utilsTools.getGDataByKey<String>("fillanimation", "false")); fillAnimation = Boolean.Parse(utilsTools.getGDataByKey<String>("fillanimation", "false"));
int selectId = int.Parse(utilsTools.getGDataByKey<String>("highlight_areas", "0"));
if(selectId < 0 || selectId>= allSelectTexturePaths.Count())
{
selectId = 0;
}
selectTextureIdx = selectId;
this.gameScenUseInfo = gameUserInfo; this.gameScenUseInfo = gameUserInfo;
for (short i = 0; i < gameUserInfo.areaInfoUseData.Count; i++) for (short i = 0; i < gameUserInfo.areaInfoUseData.Count; i++)
{ {
var userAreaData = gameUserInfo.areaInfoUseData[i]; var userAreaData = gameUserInfo.areaInfoUseData[i];
aid2selectOrderIdx.Add(userAreaData.id, i); if(aid2selectOrderIdx.ContainsKey(userAreaData.id) == false)
aid2selectOrderIdx.Add(userAreaData.id, i);
} }
utilsTools.setGDataByKey("loadBinBegin", utilsTools.getTotalMillisecond()); utilsTools.setGDataByKey("loadBinBegin", utilsTools.getTotalMillisecond());
TaskManages.getInstance().insertTask(this, (System.Object[] _) => TaskManages.getInstance().insertTask(this, (System.Object[] _) =>
...@@ -827,7 +823,7 @@ public class mainGameView : MonoBehaviour ...@@ -827,7 +823,7 @@ public class mainGameView : MonoBehaviour
} }
}); });
} }
public void showArea(int areaId, OnAreaHandler onAreaHandler = null) public virtual void showArea(int areaId, OnAreaHandler onAreaHandler = null)
{ {
if (areaId == -1) if (areaId == -1)
{ {
...@@ -845,11 +841,6 @@ public class mainGameView : MonoBehaviour ...@@ -845,11 +841,6 @@ public class mainGameView : MonoBehaviour
{ {
lineTexture2d.SetPixel(item.x,item.y, color);//回放使用 lineTexture2d.SetPixel(item.x,item.y, color);//回放使用
} }
//groupPtInfos_All[areaItem1.gid].getLineByAid(areaItem1.id, ref areaAllPts);
//foreach (var item in areaAllPts)
//{
// lineTexture2d.SetPixel(item.x, item.y, color);
//}
lineTexture2d.Apply(); lineTexture2d.Apply();
} }
else if (onAreaHandler != null) else if (onAreaHandler != null)
...@@ -858,7 +849,7 @@ public class mainGameView : MonoBehaviour ...@@ -858,7 +849,7 @@ public class mainGameView : MonoBehaviour
} }
} }
public bool switchShowAreaGroup(short gid, OnAreaHandler onAreaHandler = null) public virtual bool switchShowAreaGroup(short gid, OnAreaHandler onAreaHandler = null)
{ {
//utilsTools.setGDataByKey("makeThumbnailBegin", utilsTools.getTotalMillisecond()); //utilsTools.setGDataByKey("makeThumbnailBegin", utilsTools.getTotalMillisecond());
if(utilsTools.ContainsKeyGDataByKey("firstSwitchShowAreaBegin") == false) if(utilsTools.ContainsKeyGDataByKey("firstSwitchShowAreaBegin") == false)
...@@ -1268,7 +1259,7 @@ public class mainGameView : MonoBehaviour ...@@ -1268,7 +1259,7 @@ public class mainGameView : MonoBehaviour
} }
} }
public void resetSize() public virtual void resetSize()
{ {
//怎么保持宽高比 //怎么保持宽高比
float width = lineTexture2d.width; float width = lineTexture2d.width;
...@@ -1276,20 +1267,6 @@ public class mainGameView : MonoBehaviour ...@@ -1276,20 +1267,6 @@ public class mainGameView : MonoBehaviour
float bet = width / height; float bet = width / height;
RectTransform rectTransform = lineImg.GetComponent<RectTransform>(); RectTransform rectTransform = lineImg.GetComponent<RectTransform>();
RectTransform baseTransform = rectTransform.transform.parent.GetComponent<RectTransform>(); RectTransform baseTransform = rectTransform.transform.parent.GetComponent<RectTransform>();
Vector2 maxSize = new Vector2(baseTransform.rect.width * 0.95f,baseTransform.rect.height * 0.95f);
float bet1 = 1.0f;
//while (true)
//{
// float tempWidth = rectTransform.rect.width * bet1 * rectTransform.localScale.x;
// float tempHeight = rectTransform.rect.width / bet * bet1 * rectTransform.localScale.y;
// if (tempWidth < maxSize.x && tempHeight < maxSize.y)
// {
// width = tempWidth;
// height = tempHeight;
// break;
// }
// bet1 = bet1 * 0.95f;
//}
if (width.Equals(height)) if (width.Equals(height))
{ {
width = utilsTools.DisplaySize.x * 1; width = utilsTools.DisplaySize.x * 1;
...@@ -1320,7 +1297,7 @@ public class mainGameView : MonoBehaviour ...@@ -1320,7 +1297,7 @@ public class mainGameView : MonoBehaviour
utilsTools.setGDataByKey("sltTextureSize",new Vector2(lowImgTexture2d.width/4,lowImgTexture2d.height/4)); utilsTools.setGDataByKey("sltTextureSize",new Vector2(lowImgTexture2d.width/4,lowImgTexture2d.height/4));
} }
} }
public bool getSize(out int width,out int height) public virtual bool getSize(out int width,out int height)
{ {
width = -1; width = -1;
height = -1; height = -1;
...@@ -1447,7 +1424,7 @@ public class mainGameView : MonoBehaviour ...@@ -1447,7 +1424,7 @@ public class mainGameView : MonoBehaviour
utilsTools.sendEventObjectParams("gamePlayerEndHandler"); utilsTools.sendEventObjectParams("gamePlayerEndHandler");
} }
} }
private void loadSelectImageTexture(Texture2D nowSelectTexture,NotifyEmptParam notify, int width = 0,int height = 0) protected virtual void loadSelectImageTexture(Texture2D nowSelectTexture,NotifyEmptParam notify, int width = 0,int height = 0)
{ {
if(width == 0 || height == 0) if(width == 0 || height == 0)
{ {
...@@ -1506,7 +1483,7 @@ public class mainGameView : MonoBehaviour ...@@ -1506,7 +1483,7 @@ public class mainGameView : MonoBehaviour
}, objects2); }, objects2);
} }
private void loadSelectImageTextureId(int idx = 0, NotifyEmptParam notify = null) protected void loadSelectImageTextureId(int idx = 0, NotifyEmptParam notify = null)
{ {
string path = allSelectTexturePaths[idx]; string path = allSelectTexturePaths[idx];
var req = Resources.LoadAsync<Texture2D>(path); var req = Resources.LoadAsync<Texture2D>(path);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment