void InitGameLanguage() { GameTextType type = GlobalData.GetInstance().GetGameTextMode(); LanguageDuiGou[0].enabled = type == GameTextType.Chinese ? true : false; LanguageDuiGou[1].enabled = !LanguageDuiGou[0].enabled; }
public string ProcessText(string text, GameTextType textType, int characterID) { if (text == null) { return string.Empty; } if (text.Trim() == string.Empty) { return text; } switch (textType) { case GameTextType.DialogOption: case GameTextType.Message: return CreateSpeechLine(characterID, text); case GameTextType.DialogScript: return ProcessDialogScript(text); case GameTextType.Script: return ProcessScript(text); case GameTextType.ItemDescription: if (_processHotspotAndObjectDescriptions) { return CreateSpeechLine(characterID, text); } break; } return text; }
// Use this for initialization void Start() { GameTextType gameTextVal = XKGlobalData.GetGameTextMode(); //gameTextVal = GameTextType.English; //test. switch (gameTextVal) { case GameTextType.Chinese: XunZhangTexture = XunZhangTexture_Ch; break; case GameTextType.English: XunZhangTexture = XunZhangTexture_En; break; } switch (PlayerSt) { case PlayerEnum.PlayerOne: InstanceOne = this; break; case PlayerEnum.PlayerTwo: InstanceTwo = this; break; } XunZhangBJ.SetActive(false); XunZhangUITexture.gameObject.SetActive(false); }
// Use this for initialization void Start() { MovieRender = GetComponent <Renderer>(); if (XKGlobalData.GetInstance() != null) { AudioListener.volume = (float)XKGlobalData.GameAudioVolume / 10f; } _instance = this; XkGameCtrl.ResetIsLoadingLevel(); pcvr.CloseGunZhenDongDengJi(); PlayerIPInfo = Network.player.ipAddress; // TimeLast = Time.realtimeSinceStartup; GameTextType gameTextVal = XKGlobalData.GetGameTextMode(); //gameTextVal = GameTextType.English; //test. switch (gameTextVal) { case GameTextType.Chinese: TextureMv = TextureMv_Ch; break; case GameTextType.English: TextureMv = TextureMv_En; break; } if (AudioListCtrl.GetInstance() != null) { AudioListCtrl.GetInstance().CloseGameAudioBJ(); } Cursor.visible = pcvr.bIsHardWare; LoadingGameCtrl.ResetLoadingInfo(); Time.timeScale = 1.0f; CheckClientPortMovieInfo(1); AudioManager.Instance.SetParentTran(null); GameOverCtrl.IsShowGameOver = false; if (!IsTestLJGame) { IsActivePlayer = true; if (IsTestXiaoScreen) { Screen.SetResolution((int)(XkGameCtrl.ScreenWidth / 4), (int)(XkGameCtrl.ScreenHeight / 4), false); //test } } QualitySettings.SetQualityLevel((int)QualityLevelEnum.Fast); AudioSourceObj = transform.GetComponent <AudioSource>(); Invoke("DelayResetIsLoadingLevel", 5f); CountMovie++; if (CountMovie == 1 && IsOpenVR) { Invoke("DelayPlayMovie", 3f); } else { PlayMovie(); } }
public string ProcessText(string text, GameTextType textType, int characterID) { if (text == null) { return(string.Empty); } if (text.Trim() == string.Empty) { return(text); } switch (textType) { case GameTextType.DialogOption: case GameTextType.Message: return(CreateSpeechLine(characterID, text)); case GameTextType.DialogScript: return(ProcessDialogScript(text)); case GameTextType.Script: return(ProcessScript(text)); case GameTextType.ItemDescription: if (_processHotspotAndObjectDescriptions) { return(CreateSpeechLine(characterID, text)); } break; } return(text); }
public static void SetGameTextMode(GameTextType modeVal) { string gmText = modeVal == GameTextType.Chinese ? "0" : "1"; //gmText == "0" -> 中文版, gmText == "1" -> 英文版. handleJsonObj.WriteToFileXml(fileName, "GameTextVal", gmText); GameTextVal = modeVal; }
// Use this for initialization void Start() { GameTextVal = GlobalData.GetGameTextMode(); //GameTextVal = GameTextType.English; //test. //Debug.Log("GameTextVal "+GameTextVal); CheckGameUITexture(); CheckUISpAniCom(); CheckGameUISpCom(); CheckMeshRenderCom(); }
public IGameText GetGameText(GameTextType type) { foreach (GameTextComponent gameTextComponent in _gameTextComponents) { if (type == gameTextComponent.gameTextType) { return(gameTextComponent.gameText); } } return(NullGameText.Instance); }
public IGameText GetGameText(GameTextType type) { foreach (GameTextComponent gameTextComponent in _gameTextComponents) { if (type == gameTextComponent.gameTextType) { return gameTextComponent.gameText; } } return NullGameText.Instance; }
// Use this for initialization void Start() { Instance = this; DongGanTexture = GetComponent <UITexture>(); DongGanTexture.mainTexture = DongGanUI[0]; GameTextType gameTextVal = GlobalData.GetGameTextMode(); if (gameTextVal == GameTextType.Chinese) { DongGanUI = DongGanUICh; } else { DongGanUI = DongGanUIEn; } gameObject.SetActive(false); }
void Start() { GameTextVal = XKGlobalData.GetGameTextMode(); //GameTextVal = GameTextType.English; //test ModeSprite = GetComponent <UISprite>(); switch (AppModeVal) { case GameMode.LianJi: InstanceLianJi = this; break; default: InstanceDanJi = this; break; } InitGameModeImg(); }
// Use this for initialization void Start() { if (GameTextVal != GameTextType.Null) { return; } GameTextVal = GlobalData.GetInstance().GetGameTextMode(); //GameTextVal = GameTextType.English; //test. //Debug.Log("GameTextVal ================== "+GameTextVal); CheckGameUITexture(); CheckUISpAniCom(); CheckGameUISpCom(); CheckMeshRenderCom(); CheckGameAudioClip(); Destroy(this); }
// Use this for initialization void Start() { if (XkGameCtrl.IsTiaoGuoStartCartoon) { HiddenLoadingGame(); return; } GameTextType gameTextVal = XKGlobalData.GetGameTextMode(); //gameTextVal = GameTextType.English; //test. switch (gameTextVal) { case GameTextType.Chinese: LoadText = LoadText_Ch; LoadImg = LoadImg_Ch; break; case GameTextType.English: LoadText = LoadText_En; LoadImg = LoadImg_En; break; } IsHiddenLoadingGame = false; int loadLevel = SceneManager.GetActiveScene().buildIndex - 1; if (XkGameCtrl.GetInstance().IsCartoonShootTest) { if (loadLevel < 1 || loadLevel > 6) { loadLevel = 1; } } LoadTextTextureCom.mainTexture = LoadText[loadLevel]; LoadImgTextureCom.mainTexture = LoadImg[loadLevel]; float timeVal = 0f; if (!XkGameCtrl.GetInstance().IsCartoonShootTest) { timeVal = 6f; } Invoke("HiddenLoadingGame", timeVal); }
// Use this for initialization void Start() { GlobalScript.GetInstance().ShowFinalRankEvent += ShowFinalRankEvent; //UISpriteScript = GetComponent<UISprite>(); UITextureCom = GetComponent <UITexture>(); GameTextType gameTextVal = GlobalData.GetGameTextMode(); if (gameTextVal == GameTextType.Chinese) { TextureArray = TextureArrayCh; } else { TextureArray = TextureArrayEn; } TweenPosScript = GetComponent <TweenPosition>(); RankTran = transform; }
// Use this for initialization void Start() { Instance = this; GameTextType gameTextVal = XKGlobalData.GetGameTextMode(); //gameTextVal = GameTextType.English; //test. switch (gameTextVal) { case GameTextType.Chinese: DongGanUI = DongGanUI_Ch; break; case GameTextType.English: DongGanUI = DongGanUI_En; break; } DongGanCount = 1; DongGanTexture = GetComponent <UITexture>(); DongGanTexture.mainTexture = DongGanUI[0]; gameObject.SetActive(false); }
void Start() { GameTextType gameTextVal = GlobalData.GetGameTextMode(); GlobalScript.GetInstance().ShowTishiEvent += ShowTishiEvent; //ui = GetComponent<UISprite> (); UiTextureCom = GetComponent <UITexture> (); if (gameTextVal == GameTextType.Chinese) { TextureArray = TextureArrayCh; } else { TextureArray = TextureArrayEn; UiTextureCom.mainTexture = TextureArray[0]; } tween = GetComponent <TweenPosition> (); trans = gameObject.transform; oldduation = tween.duration; //speed = Mathf.Abs (to.x - from.x) /tween.duration; }
// Use this for initialization void Start() { GameTextType gameTextVal = XKGlobalData.GetGameTextMode(); //gameTextVal = GameTextType.English; //test. switch (gameTextVal) { case GameTextType.Chinese: LoadText = LoadText_Ch; LoadImg = LoadImg_Ch; break; case GameTextType.English: LoadText = LoadText_En; LoadImg = LoadImg_En; break; } IsHiddenLoadingGame = false; int loadLevel = Application.loadedLevel - 1; if (XkGameCtrl.GetInstance().IsCartoonShootTest) { if (loadLevel < 1 || loadLevel > 6) { loadLevel = 1; } } LoadTextTextureCom.mainTexture = LoadText[loadLevel]; LoadImgTextureCom.mainTexture = LoadImg[loadLevel]; float timeVal = 0f; if (!XkGameCtrl.GetInstance().IsCartoonShootTest) { timeVal = 6f; } Invoke("HiddenLoadingGame", timeVal); }
void showGameTextDuiHao(GameTextType textVal) { switch (textVal) { case GameTextType.Chinese: GameTextChDuiHao.SetActive(true); GameTextEnDuiHao.SetActive(false); break; case GameTextType.English: GameTextChDuiHao.SetActive(false); GameTextEnDuiHao.SetActive(true); break; default: textVal = GameTextType.Chinese; GameTextChDuiHao.SetActive(true); GameTextEnDuiHao.SetActive(false); break; } GlobalData.SetGameTextMode(textVal); }
// Use this for initialization void Awake() { chengJiuScript = GetComponent <ChengJiu>(); chengJiuScript.enabled = false; // uiSpriteScript = GetComponent<UISprite>(); // uiSpriteScript.enabled = false; UITextureCom = GetComponent <UITexture>(); UITextureCom.enabled = false; GameTextType gameTextVal = GlobalData.GetGameTextMode(); if (gameTextVal == GameTextType.Chinese) { TextureArray = TextureArrayCh; } else { TextureArray = TextureArrayEn; } TweenPosScript = GetComponent <TweenPosition>(); TweenScaleScript = GetComponent <TweenScale>(); }
public string ProcessText(string text, GameTextType textType) { return(ProcessText(text, textType, -1)); }
// Use this for initialization void Start() { _Instance = this; GameTextType gameTextVal = GlobalData.GetGameTextMode(); switch (gameTextVal) { case GameTextType.Chinese: Leve1Texture = Leve1TextureCh; Leve2Texture = Leve2TextureCh; LinkTexture = LinkTextureCh; break; case GameTextType.English: Leve1Texture = Leve1TextureEn; Leve2Texture = Leve2TextureEn; LinkTexture = LinkTextureEn; break; } Leve1UITexture = Leve1.GetComponent <UITexture>(); Leve2UITexture = Leve2.GetComponent <UITexture>(); // Leve1UI=Leve1.GetComponent<UISprite>() as UISprite; // Leve2UI=Leve2.GetComponent<UISprite>() as UISprite; Leve1Hover = Leve1.GetComponents <TweenRotation>()[0] as TweenRotation; Leve1Unhover = Leve1.GetComponents <TweenRotation>()[1] as TweenRotation; Leve2Hover = Leve2.GetComponents <TweenRotation>()[0] as TweenRotation; Leve2UnHover = Leve2.GetComponents <TweenRotation>()[1] as TweenRotation; GlobalData.GetInstance().gameLeve = GameLeve.Leve1; Leve1UITexture.mainTexture = Leve1Texture[0]; Leve2UITexture.mainTexture = Leve2Texture[0]; //Leve1UI.spriteName="diYiGuanHuiSe"; //Leve2UI.spriteName="diErGuanHuiSe"; Leve1Hover.ResetToBeginning(); Leve2UnHover.ResetToBeginning(); Leve1Hover.PlayForward(); Leve2UnHover.PlayForward(); Starts.SetActive(false); pcvr.StartLightStateP1 = LedState.Mie; isInitCartoon = false; if (GlobalData.GetInstance().gameMode == GameMode.OnlineMode && NetCtrlScript == null) { GameObject netCtrl = GameObject.Find(GlobalData.netCtrl); if (netCtrl != null) { NetCtrlScript = netCtrl.GetComponent <NetCtrl>(); } } if (GlobalData.GetInstance().gameMode != GameMode.OnlineMode) { OpenCityLevelUI(); } InputEventCtrl.GetInstance().ClickStartBtEvent += clickStartBtEvent; }
string getRankName(string str) { GameTextType gameTextVal = GlobalData.GetGameTextMode(); if (GlobalData.GetInstance().gameMode != GameMode.OnlineMode) { if (gameTextVal == GameTextType.English) { str += "_En"; } return(str); } switch (str) { case "NPC_01NetUnity": case "AiNPC_01NetUnity": str = "NPC_01"; break; case "NPC_02NetUnity": case "AiNPC_02NetUnity": str = "NPC_02"; break; case "NPC_03NetUnity": case "AiNPC_03NetUnity": str = "NPC_03"; break; case "NPC_04NetUnity": case "AiNPC_04NetUnity": str = "NPC_04"; break; case "NPC_05NetUnity": case "AiNPC_05NetUnity": str = "NPC_05"; break; case "NPC_06NetUnity": case "AiNPC_06NetUnity": str = "NPC_06"; break; case "NPC_07NetUnity": case "AiNPC_07NetUnity": str = "NPC_07"; break; case "NPC_08NetUnity": case "AiNPC_08NetUnity": str = "NPC_08"; break; default: str = "NPC_08"; break; } if (gameTextVal == GameTextType.English) { str += "_En"; } //Debug.Log("getRankName -> name " + str); return(str); }
void setGameText(GameTextType textVal) { GameTextVal = textVal; showGameTextDuiHao(textVal); }
public IGameText GetGameText(GameTextType type) { return(gameTextManager.GetGameText(type)); }
public IGameText GetGameText(GameTextType type) { return(_setting.GetGameText(type)); }
public static XKGlobalData GetInstance() { if (Instance == null) { Instance = new XKGlobalData(); Instance.InitInfo(); if (!Directory.Exists(FilePath)) { Directory.CreateDirectory(FilePath); } if (HandleJsonObj == null) { HandleJsonObj = HandleJson.GetInstance(); } string startCoinInfo = HandleJsonObj.ReadFromFileXml(FileName, "START_COIN"); if (startCoinInfo == null || startCoinInfo == "") { startCoinInfo = "1"; HandleJsonObj.WriteToFileXml(FileName, "START_COIN", startCoinInfo); } XKGlobalData.GameNeedCoin = Convert.ToInt32(startCoinInfo); // GameNeedCoin = 1; string modeGame = HandleJsonObj.ReadFromFileXml(FileName, "GAME_MODE"); if (modeGame == null || modeGame == "") { modeGame = "1"; HandleJsonObj.WriteToFileXml(FileName, "GAME_MODE", modeGame); } if (modeGame == "0") { IsFreeMode = true; } string gmText = HandleJsonObj.ReadFromFileXml(FileName, "GameTextVal"); if (gmText == null || gmText == "") { gmText = "0"; //中文版. SetGameTextMode(GameTextType.Chinese); } GameTextVal = gmText == "0" ? GameTextType.Chinese : GameTextType.English; GameTextVal = GameTextType.English; //test. GetGameDiffVal(); string gunZhenDongStr = HandleJsonObj.ReadFromFileXml(FileName, "GunZDP1"); if (gunZhenDongStr == null || gunZhenDongStr == "") { gunZhenDongStr = "5"; } GunZhenDongP1 = Convert.ToInt32(gunZhenDongStr); pcvr.SetGunZhenDongDengJi(GunZhenDongP1, PlayerEnum.PlayerOne); gunZhenDongStr = HandleJsonObj.ReadFromFileXml(FileName, "GunZDP2"); if (gunZhenDongStr == null || gunZhenDongStr == "") { gunZhenDongStr = "5"; } GunZhenDongP2 = Convert.ToInt32(gunZhenDongStr); pcvr.SetGunZhenDongDengJi(GunZhenDongP2, PlayerEnum.PlayerTwo); string val = HandleJsonObj.ReadFromFileXml(FileName, "GameAudioVolume"); if (val == null || val == "") { val = "7"; HandleJsonObj.WriteToFileXml(FileName, "GameAudioVolume", val); } GameAudioVolume = Convert.ToInt32(val); } return(Instance); }
public string ProcessText(string text, GameTextType textType) { return ProcessText(text, textType, -1); }
public IGameText GetGameText(GameTextType type) { return _setting.GetGameText(type); }
public IGameText GetGameText(GameTextType type) { return gameTextManager.GetGameText(type); }
//public static string TestGameFile = "TestGame.info"; // Use this for initialization void Start() { XkGameCtrl.IsLoadingLevel = false; string threeScreen = HandleJson.GetInstance().ReadFromFilePathXml(GameTypeCtrl.TestGameFile, "threeScreen"); if (threeScreen == "") { threeScreen = "0"; HandleJson.GetInstance().WriteToFilePathXml(GameTypeCtrl.TestGameFile, "threeScreen", threeScreen); } IsTestThreeScreen = threeScreen == "0" ? false : true; switch (GameTypeCtrl.AppTypeStatic) { case AppGameType.DanJiFeiJi: case AppGameType.LianJiFeiJi: IsThreeScreenGame = true; if (!IsTestThreeScreen) { IsThreeScreenGame = false; } break; default: IsThreeScreenGame = false; break; } if (XKGlobalData.GetInstance() != null) { if (GameTypeCtrl.AppTypeStatic == AppGameType.LianJiServer) { AudioListener.volume = 0f; } else { AudioListener.volume = (float)XKGlobalData.GameAudioVolume / 10f; } } _instance = this; XkGameCtrl.ResetIsLoadingLevel(); if (pcvr.GetInstance() != null) { pcvr.GetInstance().CloseFangXiangPanPower(PlayerEnum.Null); } pcvr.CloseAllQiNangArray(1); pcvr.CloseGunZhenDongDengJi(); PlayerIPInfo = Network.player.ipAddress; TimeLast = Time.realtimeSinceStartup; GameTextType gameTextVal = XKGlobalData.GetGameTextMode(); //gameTextVal = GameTextType.English; //test. switch (gameTextVal) { case GameTextType.Chinese: TextureMv = TextureMv_Ch; break; case GameTextType.English: TextureMv = TextureMv_En; break; } if (AudioListCtrl.GetInstance() != null) { AudioListCtrl.GetInstance().CloseGameAudioBJ(); } Screen.showCursor = false; LoadingGameCtrl.ResetLoadingInfo(); Time.timeScale = 1.0f; RectMv.width = Screen.width; RectMv.height = Screen.height * 0.93f; float perY = 620f / 768f; float perXA = 180f / 1360f; float perXB = 955f / 1360f; float perXC = 100f / 1360f; float perXD = 875f / 1360f; RectArray[0].y = Screen.height * perY; RectArray[1].y = Screen.height * perY; RectArray[2].y = Screen.height * perY; RectArray[3].y = Screen.height * perY; RectArray[0].x = Screen.width * perXA; RectArray[1].x = Screen.width * perXB; RectArray[2].x = Screen.width * perXC; RectArray[3].x = Screen.width * perXD; AudioManager.Instance.SetParentTran(null); GameOverCtrl.IsShowGameOver = false; //IsTestLJGame = true; //test //IsTestXiaoScreen = true; //test if (!XkGameCtrl.IsGameOnQuit) { if (!IsThreeScreenGame) { if (!Screen.fullScreen || Screen.currentResolution.width != (int)XkGameCtrl.ScreenWidth || Screen.currentResolution.height != (int)XkGameCtrl.ScreenHeight) { if (!IsTestLJGame && !IsTestXiaoScreen) { if (XkGameCtrl.ScreenWidth != 1360f) { Screen.SetResolution(1360, 768, true); } else { Screen.SetResolution((int)XkGameCtrl.ScreenWidth, (int)XkGameCtrl.ScreenHeight, true); } } } } else { if (!Screen.fullScreen || Screen.currentResolution.width != (int)XkGameCtrl.ScreenWidth3 || Screen.currentResolution.height != (int)XkGameCtrl.ScreenHeight3) { if (!IsTestLJGame && !IsTestXiaoScreen) { Screen.SetResolution((int)XkGameCtrl.ScreenWidth3, (int)XkGameCtrl.ScreenHeight3, true); } } } } if (!IsTestLJGame) { IsActivePlayer = true; if (IsTestXiaoScreen) { Screen.SetResolution(680, 384, false); //test } } QualitySettings.SetQualityLevel((int)QualityLevelEnum.Fast); AudioSourceObj = transform.GetComponent <AudioSource>(); Invoke("DelayResetIsLoadingLevel", 4f); PlayMovie(); }
// Use this for initialization void Awake() { IsTestXiaoScreen = pcvr.IsTestXiaoScreen; pcvr.ResetBikeZuLiInfo(); if (!IsServerPort) { int screenW = GetSystemMetrics(SM_CXSCREEN); if (screenW != ClientScreenW) { ClientScreenW = screenW; } if (!IsShowScreenInfo) { IsShowScreenInfo = true; Debug.Log("ClientScreenW " + ClientScreenW); } } ChangeMode.IsClickModeStart = false; CheckIsHavePlayerIp(); //pcvr.ResetPlayerBianMaQiMaxVal(); CountOpenServer++; // TimeClientFullScreen = Time.realtimeSinceStartup; ServerIpInfo = NetworkServerNet.ServerPortIP; if (!pcvr.bIsHardWare) { ServerIpInfo = NetworkServerNet.GetServerPortIp(); } // if (IsServerPort && CountOpenServer == 1) { // if (ServerIpInfo == Network.player.ipAddress) { // Invoke("OpenGameClientPort", 15f); // } // else { // Application.Quit(); // OpenGameClientPort(); // } // } //if (IsServerPort && (!pcvr.bIsHardWare || pcvr.IsTestGetInput)) { //IsTestXiaoScreen = true; //test //} pcvr.CloseGameDongGan(); QualitySettings.SetQualityLevel((int)QualityLevelGame.Good); if (RootObj == null) { gameObject.SetActive(false); } if (Application.loadedLevel > (int)GameLeve.Movie && GlobalData.GetInstance().IsFreeMode) { gameObject.SetActive(true); } Screen.showCursor = false; if (!IsRecordServerInfo) { IsRecordServerInfo = true; IsServer = IsServerPort; if (IsServer) { pcvr.bIsHardWare = false; } if (!IsServer) { if (!IsTestXiaoScreen) { if ((CountOpenServer == 1 && GlobalData.GetInstance().LinkModeState == 0 && ServerIpInfo == Network.player.ipAddress) || (CountOpenServer == 1 && GlobalData.GetInstance().LinkModeState == 1)) { if (IsHavePlayerIp) { Screen.SetResolution(ClientScreenW, 768, false); ChangeClientPortWindow(); } } } else { Screen.SetResolution(680, 384, false); } if (pcvr.bIsHardWare) { pcvr.CloseFangXiangPanPower(); } } else { //Screen.fullScreen = false; if (RootObj != null) { RootObj.SetActive(false); } ChangeWindowPos(); DelayCheckServerIP(); } } SetPanelCtrl.GetInstance(); GameTextType gameTextVal = GlobalData.GetGameTextMode(); //GlobalData.GetInstance().IsFreeMode = true; //test if (GlobalData.GetInstance().IsFreeMode) { if (Application.loadedLevel > (int)GameLeve.Movie && GlobalData.GetInstance().IsFreeMode) { if (gameTextVal == GameTextType.Chinese) { UiSpriteObj.spriteName = "mianFei"; } else { UiSpriteObj.spriteName = "mianFei_En"; } gameObject.SetActive(true); } else { if (gameTextVal == GameTextType.Chinese) { UiSpriteObj.spriteName = "Free"; } else { UiSpriteObj.spriteName = "Free_En"; } } CointInfo.SetActive(false); if (Application.loadedLevel == (int)GameLeve.Movie) { StartBtObj.SetActive(true); pcvr.StartLightStateP1 = LedState.Shan; } } else { if (Application.loadedLevel > (int)GameLeve.Movie && GlobalData.GetInstance().IsFreeMode) { if (gameTextVal == GameTextType.Chinese) { UiSpriteObj.spriteName = "qingTouBi"; } else { UiSpriteObj.spriteName = "qingTouBi_En"; } } else { if (gameTextVal == GameTextType.Chinese) { UiSpriteObj.spriteName = "PushCoin"; } else { UiSpriteObj.spriteName = "PushCoin_En"; } } CointInfo.SetActive(true); StartBtObj.SetActive(false); pcvr.StartLightStateP1 = LedState.Mie; if (Application.loadedLevel != (int)GameLeve.Movie) { gameObject.SetActive(false); } } InputEventCtrl.GetInstance().ClickStartBtEvent += clickStartBtEvent; }
public IGameText GetGameText(GameTextType type) { return(NullGameText.Instance); }
public IGameText GetGameText(GameTextType type) { return NullGameText.Instance; }
void ChangeGameText() { GameTextVal = GameTextVal == GameTextType.Chinese ? GameTextType.English : GameTextType.Chinese; setGameText(GameTextVal); }
public static GlobalData GetInstance() { if (Instance == null) { Instance = new GlobalData(); Instance.InitInfo(); if (!Directory.Exists(FilePath)) { Directory.CreateDirectory(FilePath); } //init gameMode Instance.gameMode = GameMode.OnlineMode; if (Application.loadedLevel == (int)GameLeve.Leve1 || Application.loadedLevel == (int)GameLeve.Leve2) { Instance.gameMode = GameMode.SoloMode; } if (handleJsonObj == null) { handleJsonObj = HandleJson.GetInstance(); } string gmText = handleJsonObj.ReadFromFileXml(fileName, "GameTextVal"); if (gmText == null || gmText == "") { gmText = "0"; //中文版. handleJsonObj.WriteToFileXml(fileName, "GameTextVal", gmText); } GameTextVal = gmText == "0" ? GameTextType.Chinese : GameTextType.English; //GameTextVal = GameTextType.English; //test. //start coin info startCoinInfo = handleJsonObj.ReadFromFileXml(fileName, "START_COIN"); if (startCoinInfo == null || startCoinInfo == "") { startCoinInfo = "1"; handleJsonObj.WriteToFileXml(fileName, "START_COIN", startCoinInfo); } Instance.XUTOUBI = Convert.ToInt32(startCoinInfo); //free mode bool isFreeMode = false; string modeGame = handleJsonObj.ReadFromFileXml(fileName, "GAME_MODE"); if (modeGame == null || modeGame == "") { modeGame = "1"; handleJsonObj.WriteToFileXml(fileName, "GAME_MODE", modeGame); } if (modeGame == "0") { isFreeMode = true; } Instance.IsFreeMode = isFreeMode; //game diff string diffStr = handleJsonObj.ReadFromFileXml(fileName, "GAME_DIFFICULTY"); if (diffStr == null || diffStr == "") { diffStr = "1"; handleJsonObj.WriteToFileXml(fileName, "GAME_DIFFICULTY", diffStr); } Instance.GameDiff = diffStr; string readInfo = handleJsonObj.ReadFromFileXml(fileName, "GameAudioVolume"); if (readInfo == null || readInfo == "") { readInfo = "7"; handleJsonObj.WriteToFileXml(fileName, "GameAudioVolume", readInfo); } int value = Convert.ToInt32(readInfo); if (value < 0 || value > 10) { value = 7; handleJsonObj.WriteToFileXml(fileName, "GameAudioVolume", value.ToString()); } GameAudioVolume = value; //开始设置联机游戏状态参数. readInfo = handleJsonObj.ReadFromFileXml(fileName, "LinkModeState"); if (readInfo == null || readInfo == "") { readInfo = "0"; handleJsonObj.WriteToFileXml(fileName, "LinkModeState", readInfo); } value = Convert.ToInt32(readInfo); if (value < 0 || value > 1) { value = 0; handleJsonObj.WriteToFileXml(fileName, "LinkModeState", value.ToString()); } /** * 此处代码必须放在这里,它是用来设定游戏是否为联机状态的控制接口. */ if (FreeModeCtrl.IsServer) { Instance.LinkModeState = 0; } else { Instance.LinkModeState = value; } //结束设置联机参数. readInfo = handleJsonObj.ReadFromFileXml(fileName, "BikeZuLiDengJi"); if (readInfo == null || readInfo == "") { readInfo = "5"; handleJsonObj.WriteToFileXml(fileName, "BikeZuLiDengJi", readInfo); } value = Convert.ToInt32(readInfo); if (value < 0 || value > 10) { value = 5; handleJsonObj.WriteToFileXml(fileName, "BikeZuLiDengJi", value.ToString()); } Instance.BikeZuLiDengJi = value; string fileNameTmp = "../config/Config.xml"; readInfo = handleJsonObj.ReadFromFileXml(fileNameTmp, "ZuLiDengJiMax"); if (readInfo == null || readInfo == "") { readInfo = "6"; handleJsonObj.WriteToFileXml(fileNameTmp, "ZuLiDengJiMax", readInfo); } value = Convert.ToInt32(readInfo); if (value < 2 || value > 10) { value = 6; handleJsonObj.WriteToFileXml(fileNameTmp, "ZuLiDengJiMax", value.ToString()); } Instance.ZuLiDengJiMax = value; } return(Instance); }
public void InitRenWuSprite() { if (RenWuXinXiObj.activeSelf) { return; } RenWuXinXiObj.SetActive(true); LoadedLevelVal = Application.loadedLevel - 1; if (XkGameCtrl.GetInstance().IsCartoonShootTest) { LoadedLevelVal = 0; //test } int max = RwSpriteInfo.Length; int levelNum = LoadedLevelVal + 1; string spriteNameTmp = ""; int indexTmp = 0; int indexVal = 0; string EnInfoStr = ""; GameTextType gameTextVal = XKGlobalData.GetGameTextMode(); if (gameTextVal == GameTextType.English) { EnInfoStr = "_En"; } for (int i = 0; i < max; i++) { if (LoadedLevelVal == 0) { RwSpriteInfo[i].enabled = false; } RwSpriteInfo[i].fillAmount = 0f; indexTmp = i % 3; if (indexTmp < CountRenWuInfo[LoadedLevelVal]) { if (i > 2) { indexVal = 2; } spriteNameTmp = levelNum + "_" + indexVal + "_" + indexTmp + EnInfoStr; //Debug.Log("name "+spriteNameTmp); RwSpriteInfo[i].spriteName = spriteNameTmp; } } max = RedSprite.Length; for (int i = 0; i < max; i++) { if (LoadedLevelVal == 0) { RedSprite[i].enabled = false; } RedSprite[i].gameObject.SetActive(false); indexTmp = i % 3; if (indexTmp < CountRenWuRedInfo[LoadedLevelVal]) { spriteNameTmp = levelNum + "_1_" + indexTmp + EnInfoStr; //Debug.Log("name ** "+spriteNameTmp); RedSprite[i].spriteName = spriteNameTmp; } } if (LoadedLevelVal == 0) { YouLiangTiShiCtrl.GetInstance().ShowYouLiangTiShi(); } }