Commit d7386eda authored by shujianhe's avatar shujianhe

1

parent 8685dd91
...@@ -29,6 +29,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -29,6 +29,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
private int rvalue = -1; private int rvalue = -1;
public GameObject fpsObj = null; public GameObject fpsObj = null;
private DateTime dtime; private DateTime dtime;
private bool autoSwitchGroup = true;
private bool vibration = true;
Dictionary<string, EventChildItemBack> childEventHandlers = new Dictionary<string, EventChildItemBack>(); Dictionary<string, EventChildItemBack> childEventHandlers = new Dictionary<string, EventChildItemBack>();
void onEvent(string name, EventChildItemBack func) void onEvent(string name, EventChildItemBack func)
{ {
...@@ -60,6 +62,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -60,6 +62,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
onEvent("tipShowPosMaxScale", onTipShowPosMaxScaleEvent); onEvent("tipShowPosMaxScale", onTipShowPosMaxScaleEvent);
onEvent("gamePlayerEndHandler", onGamePlayerEndHandlerEvent); onEvent("gamePlayerEndHandler", onGamePlayerEndHandlerEvent);
onEvent("closeGameScene", onCloseGameSceneEvent); onEvent("closeGameScene", onCloseGameSceneEvent);
transform.Find("ingameLoad").gameObject.SetActive(false);
//gameScenUser //gameScenUser
var gridViewList = areaGroupList.GetComponent<gameSceneAreaGroupHandler>(); var gridViewList = areaGroupList.GetComponent<gameSceneAreaGroupHandler>();
gridViewList.gameObject.SetActive(false); gridViewList.gameObject.SetActive(false);
...@@ -268,6 +271,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -268,6 +271,7 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
} }
private void handlerLoadingPosition(Image image) private void handlerLoadingPosition(Image image)
{ {
transform.Find("ingameLoad").gameObject.SetActive(true);
utilsTools.setGDataByKey("downGaoQingBack", utilsTools.getTotalMillisecond()); utilsTools.setGDataByKey("downGaoQingBack", utilsTools.getTotalMillisecond());
float width = image.sprite.texture.width; float width = image.sprite.texture.width;
float height = image.sprite.texture.height; float height = image.sprite.texture.height;
...@@ -315,6 +319,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -315,6 +319,8 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
Sprite sprite = Sprite.Create(texture2d, new Rect(0, 0, texture2d.width, texture2d.height), new Vector2(0.5f, 0.5f)); Sprite sprite = Sprite.Create(texture2d, new Rect(0, 0, texture2d.width, texture2d.height), new Vector2(0.5f, 0.5f));
image.sprite = sprite; image.sprite = sprite;
image.color = Color.white; image.color = Color.white;
autoSwitchGroup = Boolean.Parse(utilsTools.getGDataByKey<string>("auto-switch", autoSwitchGroup.ToString()));
//vibration = Boolean.Parse(utilsTools.getGDataByKey<string>("vibration", autoSwitchGroup.ToString()))
gameShowView.GetComponent<mainGameView>().loadGameImgId(); gameShowView.GetComponent<mainGameView>().loadGameImgId();
this.handlerLoadingPosition(image); this.handlerLoadingPosition(image);
} }
...@@ -511,8 +517,14 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler ...@@ -511,8 +517,14 @@ public class gameSceneLogic : MonoBehaviour, IEventHandler
this.onUpdateGroupGridHandler(gobject, idx, lvbType, groupInfos[idx]); this.onUpdateGroupGridHandler(gobject, idx, lvbType, groupInfos[idx]);
}; };
gridViewList.setDataNoGrid(groupInfos.Count, gradView); gridViewList.setDataNoGrid(groupInfos.Count, gradView);
//震动
if (nowidx >= 0) if (nowidx >= 0)
{ {
if(autoSwitchGroup == false)
{
nowidx = -1;
return;
}
var maingameView = gameShowView.GetComponent<mainGameView>(); var maingameView = gameShowView.GetComponent<mainGameView>();
maingameView.switchShowAreaGroup((short)(groupInfos[nowidx].gid), (int id, bool isOk) => { maingameView.switchShowAreaGroup((short)(groupInfos[nowidx].gid), (int id, bool isOk) => {
}); });
......
...@@ -21,8 +21,8 @@ public class gameUserInfos : MonoBehaviour, IEventHandler ...@@ -21,8 +21,8 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
onEvent("showAreaEventOk", onSelectAreaEvent); onEvent("showAreaEventOk", onSelectAreaEvent);
onEvent("showAreaPalyerEnd", onShowAreaPalyerEndEvent); onEvent("showAreaPalyerEnd", onShowAreaPalyerEndEvent);
onEvent("inGameLoadingBarEnd", onInGameLoadingBarEndEvent); onEvent("inGameLoadingBarEnd", onInGameLoadingBarEndEvent);
utilsTools.addTimer_Update(gameObject,"first", (string name) => //utilsTools.addTimer_Update(gameObject,"first", (string name) =>
{ //{
if (utilsTools.ContainsKeyGDataByKey("NativeGameData") == false) if (utilsTools.ContainsKeyGDataByKey("NativeGameData") == false)
{ {
loadTest(); loadTest();
...@@ -33,14 +33,14 @@ public class gameUserInfos : MonoBehaviour, IEventHandler ...@@ -33,14 +33,14 @@ public class gameUserInfos : MonoBehaviour, IEventHandler
if(jsonData == null) if(jsonData == null)
{ {
Debug.LogError("no valid data"); Debug.LogError("no valid data");
return false; //return false;
} }
utilsTools.setGameScenUserInfo(jsonData.id, jsonData.getLineUrl(), jsonData.getColorUrl(), jsonData.getJsonUrl(), jsonData.file); utilsTools.setGameScenUserInfo(jsonData.id, jsonData.getLineUrl(), jsonData.getColorUrl(), jsonData.getJsonUrl(), jsonData.file);
//string id = utilsTools.getGDataByKey<String>("nowUseGameId", ""); //string id = utilsTools.getGDataByKey<String>("nowUseGameId", "");
startId(jsonData.id); startId(jsonData.id);
} }
return false; //return false;
},3); //},3);
} }
......
...@@ -704,6 +704,7 @@ public class mainGameView : MonoBehaviour ...@@ -704,6 +704,7 @@ public class mainGameView : MonoBehaviour
if (false == gameUserInfo.createWorkDirectory())return false; if (false == gameUserInfo.createWorkDirectory())return false;
utilsTools.sendEventObjectParams("inGameLoadingValue", 3f, false); utilsTools.sendEventObjectParams("inGameLoadingValue", 3f, false);
fillAnimation = Boolean.Parse(utilsTools.getGDataByKey<String>("fillanimation", "false"));
this.gameScenUseInfo = gameUserInfo; this.gameScenUseInfo = gameUserInfo;
for (short i = 0; i < gameUserInfo.areaInfoUseData.Count; i++) for (short i = 0; i < gameUserInfo.areaInfoUseData.Count; i++)
{ {
......
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