Commit fbe1e985 authored by JiangWanZhi's avatar JiangWanZhi

给存数据的key名字放一起

parent 2a07d6a0
......@@ -25,6 +25,28 @@ public static class EventName
public const string Event_showImagePageData = "showImagePageData";
public const string Event_switchPage = "switchPage";
public const string Event_setImageViewLable = "setImageViewLable";
}
public class DataName
{
public const string Data_listViewTempCellSize = "listViewTempCellSize";
public const string Data_doubleTouchScale = "doubleTouchScale";
public const string Data_moveScale = "moveScale";
public const string Data_enableZoomMove = "enableZoomMove";
public const string Data_autoFillColor = "autoFillColor";
public const string Data_dyMinShowFontSize = "dyMinShowFontSize";
public const string Data_fillanimation = "fillanimation";
public const string Data_nowSelectUseData = "nowSelectUseData";
public const string Data_highlight_areas = "highlight_areas";
public const string Data_Native_name = "Native_name";
public const string Data_PhoneOffsetValue = "PhoneOffsetValue";
public const string Data_gameBackJavaData = "gameBackJavaData";
public const string Data_NativeTempData = "NativeTempData";
public const string Data_vibration = "vibration";
public const string Data_NativeGameData = "NativeGameData";
public const string Data_historyNotify = "historyNotify";
public const string Data_urlRoot = "urlRoot";
public const string Data_allAreaSize = "allAreaSize";
}
}
......@@ -239,10 +239,25 @@ public class ScaleToImage : MonoBehaviour
var dis_x = AreaPoint_Right_Up.position.x - AreaPoint_Left_Down.position.x;
var dis_y = AreaPoint_Right_Up.position.y - AreaPoint_Left_Down.position.y;
float offset = 2.6f - 1 / scale;
float offset_y = (dis_y * scale - dis_y) / offset;
float offset_x = (dis_x * scale - dis_x) / offset;
var size = target.GetChild(0).GetComponent<RectTransform>().sizeDelta;
float offset = 1;
float offset_y = dis_y * scale - dis_y;
float offset_x = dis_x * scale - dis_x;
offset = Mathf.Min(size.x / size.y, size.y / size.x);
if (offset == 1&& scale>1)
{
offset_y = offset_y * offset - (scale - 1) * offset;
offset_x = offset_x * offset - (scale - 1) * offset;
offset_y /= 2f;
}
else
{
offset_y = offset_y * offset - (scale - 1) * offset;
offset_x = offset_x * offset - (scale - 1) * offset;
}
if (Target_y < AreaPoint_Left_Down.position.y - offset_y)
{
......
......@@ -57,12 +57,12 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
{
Application.targetFrameRate = 60;
}
utilsTools.setGDataByKey("autoFillColor", false);
utilsTools.setGDataByKey(EventName.DataName.Data_autoFillColor, false);
dtime = DateTime.Now;
if (utilsTools.ContainsKeyGDataByKey("urlRoot") == false)
if (utilsTools.ContainsKeyGDataByKey(EventName.DataName.Data_urlRoot) == false)
{
utilsTools.setGDataByKey("urlRoot", "http://8.218.187.222:19897");
utilsTools.setGDataByKey(EventName.DataName.Data_urlRoot, "http://8.218.187.222:19897");
}
Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);
onEvent(EventName.Event.Event_switchGameAreaGroupId, this.onEvent_switchGameAreaGroupId_Handler); //切换组的ID
......@@ -88,14 +88,14 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
transform.Find("gameEndOperBase").GetComponent<gameEndLogic>().initMember();
transform.Find("areaGroupList/tipSelectGroup").gameObject.SetActive(false);
transform.Find("top").gameObject.SetActive(false);
utilsTools.setGDataByKey("PhoneOffsetValue", 50);
utilsTools.setGDataByKey(EventName.DataName.Data_PhoneOffsetValue, 50);
utilsTools.addTimer_Sec(gameObject, "loopGetHot", (String name) =>
{
addHotParams<float>("TUSE_doubleTouchScale", "doubleTouchScale", float.TryParse);
addHotParams<float>("TUSE_doubleTouchScale", EventName.DataName.Data_doubleTouchScale, float.TryParse);
addHotParams<short>("TUSE_areaOutValue", "areaOutValue", short.TryParse);
addHotParams<float>("TUSE_MoveScale", "moveScale", float.TryParse);
addHotParams<float>("TUSE_dyMinShowFontSize", "dyMinShowFontSize", float.TryParse);
addHotParams<int>("TUSE_PhoneOffsetValue", "PhoneOffsetValue", int.TryParse);
addHotParams<float>("TUSE_MoveScale", EventName.DataName.Data_moveScale, float.TryParse);
addHotParams<float>("TUSE_dyMinShowFontSize", EventName.DataName.Data_dyMinShowFontSize, float.TryParse);
addHotParams<int>("TUSE_PhoneOffsetValue", EventName.DataName.Data_PhoneOffsetValue, int.TryParse);
return true;
}, 3, 0);
//utilsTools.resetGameObjectTreeSize(gameObject, (String path) =>
......@@ -313,7 +313,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
if(groupInfos.Count == 0)
{
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 100f, true);
utilsTools.setGDataByKey("enableZoomMove", false);
utilsTools.setGDataByKey(EventName.DataName.Data_enableZoomMove, false);
return;
}
areaGroupList.SetActive(true);
......@@ -434,7 +434,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
}
else//手机不容易点中
{
short faulTolerant = (short)(utilsTools.getGDataByKey<int>("PhoneOffsetValue",50));
short faulTolerant = (short)(utilsTools.getGDataByKey<int>(EventName.DataName.Data_PhoneOffsetValue, 50));
phoneClickByPos(ref maingameView, x, y, faulTolerant, true);
}
......@@ -509,7 +509,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
image.color = new Color(1,1,1,1);
autoSwitchGroup = true;//Boolean.Parse(utilsTools.getGDataByKey<string>("auto_switch", autoSwitchGroup.ToString()));
if (autoSwitchGroup == false) nowidx = -1;
vibration = Boolean.Parse(utilsTools.getGDataByKey<string>("vibration", vibration.ToString()));
vibration = Boolean.Parse(utilsTools.getGDataByKey<string>(EventName.DataName.Data_vibration, vibration.ToString()));
this.handlerLoadingPosition(image);
}
......@@ -534,7 +534,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
ZipUtility.UnzipFile(zpath, outPath, "tuse" + gameScenUser.id);
utilsTools.setGDataByKey("endUnZip", utilsTools.getTotalMillisecond());
}
utilsTools.setGDataByKey("nowSelectUseData", gameScenUser);
utilsTools.setGDataByKey(EventName.DataName.Data_nowSelectUseData, gameScenUser);
string lineImg = gameScenUser.getLineImgLocalPath();
utilsTools.setGDataByKey("downGaoQing", utilsTools.getTotalMillisecond());
......@@ -817,21 +817,21 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
}
public void onCloseGameSceneEvent(List<UnityEngine.Object> uobjects, List<System.Object> objects)
{
if (utilsTools.getGDataByKey<bool>("autoFillColor", false)) return;
if (utilsTools.getGDataByKey<bool>(EventName.DataName.Data_autoFillColor, false)) return;
Debug.Log("准备关闭");
utilsTools.sendEvent("CloseScenePrve");
utilsTools.addTimer_Update(gameObject, "close", (String name) =>
{
Debug.Log("关闭");
var gameBackJavaData = utilsTools.getGDataByKey<GameBackJavaData>("gameBackJavaData", null);
var gameBackJavaData = utilsTools.getGDataByKey<GameBackJavaData>(EventName.DataName.Data_gameBackJavaData, null);
if (gameBackJavaData == null)
{
utilsTools.setGDataByKey("NativeTempData", "error");
utilsTools.setGDataByKey(EventName.DataName.Data_NativeTempData, "error");
}
else
{
string tempJsondata = JsonUtility.ToJson(gameBackJavaData);
utilsTools.setGDataByKey("NativeTempData", tempJsondata);
utilsTools.setGDataByKey(EventName.DataName.Data_NativeTempData, tempJsondata);
Debug.Log(tempJsondata);
}
gameShowView.GetComponent<mainGameView>().onClear();
......
......@@ -26,20 +26,20 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
onEvent("CloseScenePrve", onCloseScenePrveHandler);
utilsTools.addTimer_Update(gameObject, "first", (string name) =>
{
if (utilsTools.ContainsKeyGDataByKey("NativeGameData") == false)
if (utilsTools.ContainsKeyGDataByKey(EventName.DataName.Data_NativeGameData) == false)
{
string json = "{\"append\":\"\",\"classId\":\"1,8,10,14\",\"displayDate\":\"20221102\",\"enterType\":\"0\",\"extraJson\":\"{\\\"cut_height\\\": 0, \\\"refer_drawer\\\": \\\"DoMyzu\\\"}\",\"extraType\":0,\"file\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H.zip\",\"highImg\":\"https://d21z6ifg4bbv2v.cloudfront.net/tspng/cc--EDgRpc_nHQru7H.png\",\"hybridType\":64,\"id\":\"cc--EDgRpc_nHQru7H\",\"originalJson\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsjson/cc--EDgRpc_nHQru7H.json\",\"picAssets\":\"{\\\"pictureBin\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/zsD2ySwS4pJ25frj.p\\\", \\\"pictureThn4\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/V8ZvUuDlOEB7mifd.png\\\", \\\"pictureColorThn4\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc400\\\", \\\"pictureWallThn8\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/oWqHjCo5mQvXIVP_.png\\\", \\\"pictureWallColorThn8\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc800\\\"}\",\"pictureBin\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H_pictureBin.p\",\"pictureColorThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H_pictureColorThn4.jpg\",\"pictureThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H_pictureThn4.png\",\"schedule\":0,\"seriesName\":\"\",\"sid\":2967,\"sort\":80,\"type\":6}";
json = json.Replace( "cc--EDgRpc_nHQru7H", "cc0ZjIuxBvc0xJZygm");
json = json.Replace( "cc--EDgRpc_nHQru7H", "cc4L6-ygkvYUt8ykZp");
utilsTools.setGDataByKey("NativeGameData", JsonUtility.FromJson<netLableImageItem>(json));
utilsTools.setGDataByKey(EventName.DataName.Data_NativeGameData, JsonUtility.FromJson<netLableImageItem>(json));
}
if (utilsTools.ContainsKeyGDataByKey("NativeGameData") == false)
if (utilsTools.ContainsKeyGDataByKey(EventName.DataName.Data_NativeGameData) == false)
{
loadTest();
}
else
{
netLableImageItem jsonData = utilsTools.getGDataByKey<netLableImageItem>("NativeGameData", null);
netLableImageItem jsonData = utilsTools.getGDataByKey<netLableImageItem>(EventName.DataName.Data_NativeGameData, null);
if (jsonData == null)
{
Debug.LogError("no valid data");
......@@ -48,7 +48,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
utilsTools.setGDataByKey("imgId", jsonData.sid.ToString());
utilsTools.setGameScenUserInfo(jsonData.id, jsonData.getLineUrl(), jsonData.getColorUrl(), jsonData.getJsonUrl(), jsonData.file);
utilsTools.removeGDataByKey("history");
utilsTools.removeGDataByKey("historyNotify");
utilsTools.removeGDataByKey(EventName.DataName.Data_historyNotify);
if (historyInfoFromNet)
{
utilsTools.httpGET(this, "{0}/app/v1/game/ts/imgSchedule?zygt=hzwz&tgtk=1&imgId={1}&uid={2}", true, (string id, string url, bool isSuccess, System.Object data) =>
......@@ -69,7 +69,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
return 0;
}
gameScenUserInfo.setShowAreaids(history);
var back = utilsTools.getGDataByKey<NotifyEmptParam>("historyNotify", null);
var back = utilsTools.getGDataByKey<NotifyEmptParam>(EventName.DataName.Data_historyNotify, null);
if (back != null)
{
back();
......@@ -80,7 +80,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
{
return 1;
}
}, utilsTools.getGDataByKey<String>("urlRoot", ""), jsonData.sid, utilsTools.getGDataByKey<String>("uid", "123456"));
}, utilsTools.getGDataByKey<String>(EventName.DataName.Data_urlRoot, ""), jsonData.sid, utilsTools.getGDataByKey<String>("uid", "123456"));
}
if (historyInfoFromNet)
{
......@@ -129,7 +129,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
public void startId(string id,netLableImageItem jsondata = null)
{
GameBackJavaData gameBackJavaData = new GameBackJavaData();
gameBackJavaData.name = utilsTools.getGDataByKey<string>("Native_name", "main");
gameBackJavaData.name = utilsTools.getGDataByKey<string>(EventName.DataName.Data_Native_name, "main");
gameBackJavaData.schedule = 0;
if(jsondata != null)
{
......@@ -139,7 +139,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
{
gameBackJavaData.sid = id;
}
utilsTools.setGDataByKey("gameBackJavaData", gameBackJavaData);
utilsTools.setGDataByKey(EventName.DataName.Data_gameBackJavaData, gameBackJavaData);
GameScenUserInfo gameScenUser = utilsTools.getGameScenUserInfo(id);
if(gameScenUser == null)
{
......@@ -175,7 +175,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
gameAreaItem gameArea = (gameAreaItem)objects[0];
short x = (short)objects[1];
short y = (short)objects[2];
float allAreaSize = (float)utilsTools.getGDataByKey<int>("allAreaSize", 0);
float allAreaSize = (float)utilsTools.getGDataByKey<int>(EventName.DataName.Data_allAreaSize, 0);
float old = gameScenUserInfo.areaInfoUseData.Count / allAreaSize * 100;
AreaInfoUseData areaInfoUseData = new AreaInfoUseData();
areaInfoUseData.clickX = x;
......@@ -201,7 +201,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
void onInGameLoadingBarEndEvent(List<UnityEngine.Object> uobjects,List<System.Object> objects)
{
if (gameScenUserInfo == null) return;
float allAreaSize = (float)utilsTools.getGDataByKey<int>("allAreaSize", 0);
float allAreaSize = (float)utilsTools.getGDataByKey<int>(EventName.DataName.Data_allAreaSize, 0);
int now = Convert.ToInt32(gameScenUserInfo.areaInfoUseData.Count / allAreaSize * 100);
utilsTools.sendEventObjectParams(EventName.Event.Event_changeGameUserProgress, now);
}
......@@ -211,7 +211,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
if (gameScenUserInfo != null)
{
utilsTools.saveGameScenUserInfo(gameScenUserInfo);
float allAreaSize = (float)utilsTools.getGDataByKey<int>("allAreaSize", 0);
float allAreaSize = (float)utilsTools.getGDataByKey<int>(EventName.DataName.Data_allAreaSize, 0);
float schedule1 = (int)(gameScenUserInfo.areaInfoUseData.Count * 100f / allAreaSize);
int schedule = 0;
if (schedule1 < 1.00001)
......@@ -223,7 +223,7 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
}
else if (schedule1 > 98.999999991)
{
if (utilsTools.getGDataByKey<int>("allAreaSize", 0).Equals(gameScenUserInfo.areaInfoUseData.Count))
if (utilsTools.getGDataByKey<int>(EventName.DataName.Data_allAreaSize, 0).Equals(gameScenUserInfo.areaInfoUseData.Count))
{
schedule = 100;
}
......@@ -236,10 +236,10 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
{
schedule = (int)schedule1;
}
var gameBackJavaData = utilsTools.getGDataByKey<GameBackJavaData>("gameBackJavaData", null);
var gameBackJavaData = utilsTools.getGDataByKey<GameBackJavaData>(EventName.DataName.Data_gameBackJavaData, null);
gameBackJavaData.schedule = schedule;
gameBackJavaData.path = gameScenUserInfo.getLocalThumbnailPath();
utilsTools.setGDataByKey("gameBackJavaData", gameBackJavaData);
utilsTools.setGDataByKey(EventName.DataName.Data_gameBackJavaData, gameBackJavaData);
updateProgress();
gameScenUserInfo = null;//直接释放如果期间没有保存,就一起丢失
......@@ -247,12 +247,12 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
}
public void updateProgress()
{
String urlRoot = utilsTools.getGDataByKey<String>("urlRoot", "");
String urlRoot = utilsTools.getGDataByKey<String>(EventName.DataName.Data_urlRoot, "");
String url = String.Format("{0}/app/v1/game/ts/saveImgSchedule?zygt=hzwz&tgtk=1", urlRoot);
Dictionary<String, System.Object> param1 = new Dictionary<string, System.Object>();
param1.Add("imgId", utilsTools.getGDataByKey<string>("imgId","-1"));
param1.Add("uid", utilsTools.getGDataByKey<string>("uid","123456"));
float allAreaSize = (float)utilsTools.getGDataByKey<int>("allAreaSize", 0);
float allAreaSize = (float)utilsTools.getGDataByKey<int>(EventName.DataName.Data_allAreaSize, 0);
float jindu = gameScenUserInfo.areaInfoUseData.Count / allAreaSize;
param1.Add("schedule",jindu.ToString());
string allShowAreaId = gameScenUserInfo.getAllShowAreaId();
......
......@@ -17,13 +17,13 @@ public class Native : MonoBehaviour
void Start()
{
string param = utilsTools.getGDataByKey<string>("NativeTempData", "splash");
string param = utilsTools.getGDataByKey<string>(EventName.DataName.Data_NativeTempData, "splash");
Debug.Log($"返回给Android的值:{param}");
showHostMainWindow(param);
//#if UNITY_EDITOR
utilsTools.addTimer_Sec(gameObject, "dsfds", (String name) =>
{
utilsTools.setGDataByKey("NativeTempData", "test");
utilsTools.setGDataByKey(EventName.DataName.Data_NativeTempData, "test");
jumpGame("");
return false;
}, 1);
......@@ -88,7 +88,7 @@ public class Native : MonoBehaviour
json = json.Replace("cc--EDgRpc_nHQru7H", name);
//json = "{\"append\":\"\",\"classId\":\"1,8,10,14\",\"displayDate\":\"20221102\",\"enterType\":\"0\",\"extraJson\":\"{\\\"cut_height\\\": 0, \\\"refer_drawer\\\": \\\"DoMyzu\\\"}\",\"extraType\":0,\"file\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/ccnKNH1bTLS-_Mg7A2.zip\",\"highImg\":\"https://d21z6ifg4bbv2v.cloudfront.net/tspng/ccnKNH1bTLS-_Mg7A2.png\",\"hybridType\":64,\"id\":\"ccnKNH1bTLS-_Mg7A2\",\"originalJson\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsjson/ccnKNH1bTLS-_Mg7A2.json\",\"picAssets\":\"{\\\"pictureBin\\\": \\\"ccv1/production-pic/20221027/ccnKNH1bTLS-_Mg7A2/zsD2ySwS4pJ25frj.p\\\", \\\"pictureThn4\\\": \\\"ccv1/production-pic/20221027/ccnKNH1bTLS-_Mg7A2/V8ZvUuDlOEB7mifd.png\\\", \\\"pictureColorThn4\\\": \\\"ccv1/production-pic/20221027/ccnKNH1bTLS-_Mg7A2/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc400\\\", \\\"pictureWallThn8\\\": \\\"ccv1/production-pic/20221027/ccnKNH1bTLS-_Mg7A2/oWqHjCo5mQvXIVP_.png\\\", \\\"pictureWallColorThn8\\\": \\\"ccv1/production-pic/20221027/ccnKNH1bTLS-_Mg7A2/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc800\\\"}\",\"pictureBin\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/ccnKNH1bTLS-_Mg7A2_pictureBin.p\",\"pictureColorThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/ccnKNH1bTLS-_Mg7A2_pictureColorThn4.jpg\",\"pictureThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/ccnKNH1bTLS-_Mg7A2_pictureThn4.png\",\"schedule\":0,\"seriesName\":\"\",\"sid\":2967,\"sort\":80,\"type\":6}";
//#endif
utilsTools.setGDataByKey("NativeGameData", JsonUtility.FromJson<netLableImageItem>(json));
utilsTools.setGDataByKey(EventName.DataName.Data_NativeGameData, JsonUtility.FromJson<netLableImageItem>(json));
SceneManager.LoadScene(utilsTools.getGameSceneName());
}
......@@ -96,11 +96,11 @@ public class Native : MonoBehaviour
{
SettnigToGame settnigToGame = JsonUtility.FromJson<SettnigToGame>(json);
utilsTools.setGDataByKey("auto_switch", settnigToGame.getAutoSwitch());
utilsTools.setGDataByKey("vibration", settnigToGame.getVibration());
utilsTools.setGDataByKey("highlight_areas", settnigToGame.getHighlightId());
utilsTools.setGDataByKey(EventName.DataName.Data_vibration, settnigToGame.getVibration());
utilsTools.setGDataByKey(EventName.DataName.Data_highlight_areas, settnigToGame.getHighlightId());
utilsTools.setGDataByKey("uid", settnigToGame.uid);
utilsTools.setGDataByKey("fillanimation", settnigToGame.getFillAnimation());
utilsTools.setGDataByKey("Native_name", settnigToGame.name);
utilsTools.setGDataByKey(EventName.DataName.Data_fillanimation, settnigToGame.getFillAnimation());
utilsTools.setGDataByKey(EventName.DataName.Data_Native_name, settnigToGame.name);
}
......
......@@ -38,7 +38,7 @@ public class replayerBack : MonoBehaviour, IEventHandler
onEvent(EventName.Event.Event_gameViewOnInitEnd, onGameViewOnInitEndEvent);
onEvent("onClick_saveOptions_msg", onClick_saveOptions_msg_Event);
string json = "{\"append\":\"\",\"classId\":\"1,8,10,14\",\"displayDate\":\"20221102\",\"enterType\":\"0\",\"extraJson\":\"{\\\"cut_height\\\": 0, \\\"refer_drawer\\\": \\\"DoMyzu\\\"}\",\"extraType\":0,\"file\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H.zip\",\"highImg\":\"https://d21z6ifg4bbv2v.cloudfront.net/tspng/cc--EDgRpc_nHQru7H.png\",\"hybridType\":64,\"id\":\"cc--EDgRpc_nHQru7H\",\"originalJson\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsjson/cc--EDgRpc_nHQru7H.json\",\"picAssets\":\"{\\\"pictureBin\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/zsD2ySwS4pJ25frj.p\\\", \\\"pictureThn4\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/V8ZvUuDlOEB7mifd.png\\\", \\\"pictureColorThn4\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc400\\\", \\\"pictureWallThn8\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/oWqHjCo5mQvXIVP_.png\\\", \\\"pictureWallColorThn8\\\": \\\"ccv1/production-pic/20221027/cc--EDgRpc_nHQru7H/IDdMO8yT0fPPhUtU.jpg?x-oss-process\\u003dstyle/cc800\\\"}\",\"pictureBin\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H_pictureBin.p\",\"pictureColorThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H_pictureColorThn4.jpg\",\"pictureThn4\":\"https://d21z6ifg4bbv2v.cloudfront.net/tsgame/cc--EDgRpc_nHQru7H_pictureThn4.png\",\"schedule\":0,\"seriesName\":\"\",\"sid\":2967,\"sort\":80,\"type\":6}";
utilsTools.setGDataByKey("NativeGameData", JsonUtility.FromJson<netLableImageItem>(json));
utilsTools.setGDataByKey(EventName.DataName.Data_NativeGameData, JsonUtility.FromJson<netLableImageItem>(json));
utilsTools.addTimer_Update(gameObject, "_", (string n) =>
{
initData();
......@@ -76,7 +76,7 @@ public class replayerBack : MonoBehaviour, IEventHandler
}
protected void initData()
{
netLableImageItem jsonData = utilsTools.getGDataByKey<netLableImageItem>("NativeGameData", null);
netLableImageItem jsonData = utilsTools.getGDataByKey<netLableImageItem>(EventName.DataName.Data_NativeGameData, null);
if (jsonData == null)
{
Debug.LogError("no valid data");
......@@ -320,16 +320,16 @@ public class replayerBack : MonoBehaviour, IEventHandler
utilsTools.addTimer_Update(gameObject, "close", (String name) =>
{
Debug.Log("�ر�");
var gameBackJavaData = utilsTools.getGDataByKey<GameBackJavaData>("gameBackJavaData", null);
var gameBackJavaData = utilsTools.getGDataByKey<GameBackJavaData>(EventName.DataName.Data_gameBackJavaData, null);
gameBackJavaData.name = "replayer";
if (gameBackJavaData == null)
{
utilsTools.setGDataByKey("NativeTempData", "error");
utilsTools.setGDataByKey(EventName.DataName.Data_NativeTempData, "error");
}
else
{
string tempJsondata = JsonUtility.ToJson(gameBackJavaData);
utilsTools.setGDataByKey("NativeTempData", tempJsondata);
utilsTools.setGDataByKey(EventName.DataName.Data_NativeTempData, tempJsondata);
Debug.Log(tempJsondata);
}
mainGameOneImageView mgoiv = transform.Find("gameEndOperBase/gameShowBase").GetComponent<mainGameOneImageView>();
......
......@@ -22,10 +22,10 @@ public class settingPageHandler : MonoBehaviour, IEventHandler
var Vibration = GetSwitchView("group1/Vibration/switch");
if (Vibration != null)
{
Vibration.isOff = getDBBoolDataByKey("vibration");
Vibration.isOff = getDBBoolDataByKey(EventName.DataName.Data_vibration);
Vibration.onEmptyBack = (GameObject obj) =>
{
setDBBoolDataByKey("vibration", Vibration.isOff);
setDBBoolDataByKey(EventName.DataName.Data_vibration, Vibration.isOff);
};
}
var colorPictures = GetSwitchView("group1/ShowColoredPictures/switch");
......@@ -67,7 +67,7 @@ public class settingPageHandler : MonoBehaviour, IEventHandler
var Vibration = GetSwitchView("group1/Vibration/switch");
if (Vibration != null)
{
Vibration.isOff = getDBBoolDataByKey("vibration");
Vibration.isOff = getDBBoolDataByKey(EventName.DataName.Data_vibration);
}
var colorPictures = GetSwitchView("group1/ShowColoredPictures/switch");
if (colorPictures != null)
......
......@@ -142,7 +142,7 @@ public class gridView : MonoBehaviour
List<Tuple<string, float>> infos = new List<Tuple<string, float>>();
utilsTools.setGDataByKey("listViewTempCellSize", new Vector2(gridLayout.cellSize.x, gridLayout.cellSize.y));
utilsTools.setGDataByKey(EventName.DataName.Data_listViewTempCellSize, new Vector2(gridLayout.cellSize.x, gridLayout.cellSize.y));
for (int i = 0; i < size; i++)
{
string name = $"auto_title_{i}";
......@@ -232,7 +232,7 @@ public class gridView : MonoBehaviour
}
Vector3 vector3 = new Vector3(0, -120, 1);
utilsTools.setGDataByKey("listViewTempCellSize", new Vector2(widthItem,heightItem));
utilsTools.setGDataByKey(EventName.DataName.Data_listViewTempCellSize, new Vector2(widthItem,heightItem));
Vector3 vector31 = new Vector3();
Quaternion quaternion = new Quaternion();
for (int i = 0; i < size; i++)
......
......@@ -122,7 +122,7 @@ public class mainGameOneImageView : mainGameView //回放上面,回放用的
{
TaskManages.getInstance().addTask(this, (System.Object[] parma) =>
{
utilsTools.setGDataByKey("enableZoomMove", false);
utilsTools.setGDataByKey(EventName.DataName.Data_enableZoomMove, false);
if (lowImg != null) lowImg.SetActive(false);
if (areaIdBase != null) areaIdBase.SetActive(false);
utilsTools.sendEventObjectParams(EventName.Event.Event_gamePlayerEndHandler);
......@@ -227,7 +227,7 @@ public class mainGameOneImageView : mainGameView //回放上面,回放用的
{
TaskManages.getInstance().addTask(this, (System.Object[] parma) =>
{
utilsTools.setGDataByKey("enableZoomMove", false);
utilsTools.setGDataByKey(EventName.DataName.Data_enableZoomMove, false);
if (lowImg != null) lowImg.SetActive(false);
if (areaIdBase != null) areaIdBase.SetActive(false);
utilsTools.sendEventObjectParams(EventName.Event.Event_gamePlayerEndHandler);
......@@ -524,7 +524,7 @@ public class mainGameOneImageView : mainGameView //回放上面,回放用的
}
}
gameidJsondata = gameidJsondata1;
utilsTools.setGDataByKey("allAreaSize", gameidJsondata1.getAllValidAreaItemSize());
utilsTools.setGDataByKey(EventName.DataName.Data_allAreaSize, gameidJsondata1.getAllValidAreaItemSize());
utilsTools.setGDataByKey("downJsonAsynTask", utilsTools.getTotalMillisecond());
idHashPosToArrayPosEx();
//onLoadFileOk(typeId);
......@@ -651,7 +651,7 @@ public class mainGameOneImageView : mainGameView //回放上面,回放用的
else
{
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 100f, true);
utilsTools.setGDataByKey("enableZoomMove", true);
utilsTools.setGDataByKey(EventName.DataName.Data_enableZoomMove, true);
}
nowSelectgid = gid;
jsonGroupInfo = gameidJsondata.getRoomGroup(nowSelectgid);
......
......@@ -169,7 +169,7 @@ public class mainGameScaleMove : MonoBehaviour
}
void onDoubleTouchHandler(float nowTouchDistance,Vector2 CenterPos)
{
var nowOffset = (nowTouchDistance - OldTouchCurrDis) * utilsTools.getGDataByKey<float>("doubleTouchScale", 0.002f);
var nowOffset = (nowTouchDistance - OldTouchCurrDis) * utilsTools.getGDataByKey<float>(EventName.DataName.Data_doubleTouchScale, 0.002f);
//var nowOffset = nowTouchDistance * utilsTools.getGDataByKey<float>("doubleTouchScale",0.002f);
if(nowOffset < 0)
{
......@@ -350,7 +350,7 @@ public class mainGameScaleMove : MonoBehaviour
{
return;
}
float scaleBet = utilsTools.getGDataByKey<float>("moveScale", 1.0f);
float scaleBet = utilsTools.getGDataByKey<float>(EventName.DataName.Data_moveScale, 1.0f);
delatPos = delatPos * scaleBet;
tempVector3.x += delatPos.x;
tempVector3.y += delatPos.y;
......@@ -406,7 +406,7 @@ public class mainGameScaleMove : MonoBehaviour
if (checkInput != null)
{
if (utilsTools.getGDataByKey<bool>("enableZoomMove", false))
if (utilsTools.getGDataByKey<bool>(EventName.DataName.Data_enableZoomMove, false))
{
checkInput();
}
......@@ -430,13 +430,13 @@ public class mainGameScaleMove : MonoBehaviour
}
public void onAutoFillHander()
{
if (utilsTools.getGDataByKey<bool>("autoFillColor", false)) return;
if (utilsTools.getGDataByKey<bool>(EventName.DataName.Data_autoFillColor, false)) return;
onResetSizeCenterHandler();
GetComponent<mainGameView>().onAutoFillHandler();
}
public void onTipShowPosMaxScale(gameAreaItem areaItem,float width,float height)
{
if (utilsTools.getGDataByKey<bool>("autoFillColor", false)) return;
if (utilsTools.getGDataByKey<bool>(EventName.DataName.Data_autoFillColor, false)) return;
nowScale = new Vector2(maxScale,maxScale);
Vector3 pos = new Vector3();
float ptx = areaItem.px / width * 1.0f;//百分比
......
......@@ -519,7 +519,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
{
if (areaIdBase == null) return;
Vector3 vector3 = areaIdBase.transform.localScale;
float dyMinShowFontSize = utilsTools.getGDataByKey<float>("dyMinShowFontSize", minShowFontSize);
float dyMinShowFontSize = utilsTools.getGDataByKey<float>(EventName.DataName.Data_dyMinShowFontSize, minShowFontSize);
if (areaIdBase != null && perfabPath.Equals("") == false)
{
//倍数怎么弄 ,后面需要根据相机距离和区域大小去调整字体的大小
......@@ -663,7 +663,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
}
}
this.gameidJsondata = gameidJsondata1;
utilsTools.setGDataByKey("allAreaSize", gameidJsondata1.getAllValidAreaItemSize());
utilsTools.setGDataByKey(EventName.DataName.Data_allAreaSize, gameidJsondata1.getAllValidAreaItemSize());
utilsTools.setGDataByKey("downJsonAsynTask", utilsTools.getTotalMillisecond());
onLoadFileOk(typeId);
......@@ -710,7 +710,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
if (false == gameUserInfo.createWorkDirectory())return false;
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 3f, false);
fillAnimation = Boolean.Parse(utilsTools.getGDataByKey<String>("fillanimation", "true"));
fillAnimation = Boolean.Parse(utilsTools.getGDataByKey<String>(EventName.DataName.Data_fillanimation, "true"));
this.gameScenUseInfo = gameUserInfo;
for (short i = 0; i < gameUserInfo.areaInfoUseData.Count; i++)
......@@ -743,7 +743,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
}
public bool loadGameImgId()
{
GameScenUserInfo data = utilsTools.getGDataByKey<GameScenUserInfo>("nowSelectUseData", null);
GameScenUserInfo data = utilsTools.getGDataByKey<GameScenUserInfo>(EventName.DataName.Data_nowSelectUseData, null);
if(data == null) return false;
if (this.gameScenUseInfo != null)
{
......@@ -752,8 +752,8 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
return true;
}
}
fillAnimation = Boolean.Parse(utilsTools.getGDataByKey<String>("fillanimation", "false"));
int selectId = int.Parse(utilsTools.getGDataByKey<String>("highlight_areas", "0"));
fillAnimation = Boolean.Parse(utilsTools.getGDataByKey<String>(EventName.DataName.Data_fillanimation, "false"));
int selectId = int.Parse(utilsTools.getGDataByKey<String>(EventName.DataName.Data_highlight_areas, "0"));
if (selectId < 0 || selectId >= allSelectTexturePaths.Count())
{
selectId = 0;
......@@ -906,7 +906,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
else
{
utilsTools.sendEventObjectParams(EventName.Event.Event_inGameLoadingValue, 100f, true);
utilsTools.setGDataByKey("enableZoomMove", true);
utilsTools.setGDataByKey(EventName.DataName.Data_enableZoomMove, true);
}
nowSelectgid = gid;
jsonGroupInfo = gameidJsondata.getRoomGroup(nowSelectgid);
......@@ -930,7 +930,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
allColor["low"][pt.y * gameidJsondata.width + pt.x] = color;
}
}
if (utilsTools.getGDataByKey<bool>("autoFillColor", false) == false)
if (utilsTools.getGDataByKey<bool>(EventName.DataName.Data_autoFillColor, false) == false)
{
lowImgTexture2d.SetPixels(0, 0, lowImgTexture2d.width, lowImgTexture2d.height, allColor["low"]);
lowImgTexture2d.Apply();
......@@ -1002,7 +1002,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
{
TaskManages.getInstance().addTask(this, (System.Object[] parma) =>
{
utilsTools.setGDataByKey("enableZoomMove", false);
utilsTools.setGDataByKey(EventName.DataName.Data_enableZoomMove, false);
if (lowImg != null) lowImg.SetActive(false);
if (areaIdBase != null) areaIdBase.SetActive(false);
utilsTools.sendEventObjectParams(EventName.Event.Event_gamePlayerEndHandler);
......@@ -1231,7 +1231,7 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
{
TaskManages.getInstance().addTask(this, (System.Object[] parma) =>
{
utilsTools.setGDataByKey("enableZoomMove", false);
utilsTools.setGDataByKey(EventName.DataName.Data_enableZoomMove, false);
if (lowImg != null) lowImg.SetActive(false);
if (areaIdBase != null) areaIdBase.SetActive(false);
utilsTools.sendEventObjectParams(EventName.Event.Event_gamePlayerEndHandler);
......@@ -1373,8 +1373,8 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
{
//恢复尺寸
//锁定输入
utilsTools.setGDataByKey("enableZoomMove", false);
utilsTools.setGDataByKey("autoFillColor", true);
utilsTools.setGDataByKey(EventName.DataName.Data_enableZoomMove, false);
utilsTools.setGDataByKey(EventName.DataName.Data_autoFillColor, true);
short gid = nowSelectgid < 0 ? gameidJsondata.roomGroupsData[0].id : nowSelectgid;
List<short> aids = new List<short>();
do
......@@ -1432,8 +1432,8 @@ public class mainGameView : MonoBehaviour //大图的处理、具体的玩法
idx++;
if (idx.Equals(aidsLen))
{
utilsTools.setGDataByKey("enableZoomMove", true);
utilsTools.setGDataByKey("autoFillColor", false);
utilsTools.setGDataByKey(EventName.DataName.Data_enableZoomMove, true);
utilsTools.setGDataByKey(EventName.DataName.Data_autoFillColor, false);
return false;
}
return true;
......
......@@ -209,7 +209,7 @@ public class colorItem : MonoBehaviour
{
//if (isSelect == false && isFinish() == false)
{
if (utilsTools.getGDataByKey<bool>("autoFillColor", false)) return;
if (utilsTools.getGDataByKey<bool>(EventName.DataName.Data_autoFillColor, false)) return;
utilsTools.sendEventObjectParams(EventName.Event.Event_switchGameAreaGroupId, index);
}
......
......@@ -75,7 +75,7 @@ public class utilsTools
}
public static string getGameSceneName()
{
if (getGDataByKey<string>("Native_name", "main").Equals("mine") == false)
if (getGDataByKey<string>(EventName.DataName.Data_Native_name, "main").Equals("mine") == false)
{
return "Scenes/gameScene";
}
......
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