private SetText ( string temperature ) : void | ||
temperature | string | |
Результат | void |
void UpdateTimeRemain(float delta) { if (m_PetStat.m_IsDead) { m_ShouldUpdateTime = false; return; } int leftTime = CalculateRemaining(delta); int leftMinutes = 0, leftSeconds = 0; if (leftTime <= 0) { m_PetStat.m_IsDead = true; DelegateManager.UpdateDeadPet(1); //Notify that one pet has died } else { leftMinutes = leftTime / 60; leftSeconds = leftTime - leftMinutes * 60; } m_TextTime = leftMinutes.ToString("00") + ":" + leftSeconds.ToString("00"); m_TimeController.SetText(m_TextTime); }
// Use this for initialization void Start() { // テキストを渡すスクリプトの参照 textMesh = GameObject.Find("Word"); controller = textMesh.GetComponent <TextController>(); // 音声認識セッションの初期化 session = PXCMSession.CreateInstance(); source = session.CreateAudioSource(); PXCMAudioSource.DeviceInfo dinfo = null; source.QueryDeviceInfo(1, out dinfo); source.SetDevice(dinfo); Debug.Log(dinfo.name); session.CreateImpl <PXCMSpeechRecognition>(out sr); PXCMSpeechRecognition.ProfileInfo pinfo; sr.QueryProfile(out pinfo); pinfo.language = PXCMSpeechRecognition.LanguageType.LANGUAGE_JP_JAPANESE; sr.SetProfile(pinfo); handler = new PXCMSpeechRecognition.Handler(); handler.onRecognition = (x) => controller.SetText(x.scores[0].sentence); sr.SetDictation(); sr.StartRec(source, handler); }
void SayMessage(string message) { //Debug.Log (message); //Instantiate(text3D); TextController t = Instantiate(textMesh, transform.position + textSpawnPoint, FindObjectOfType <Camera>().transform.rotation) as TextController; t.SetText(message); }
public void Handle() { textController.SetText("You are free!\n\n" + "Press P to play again"); if (Input.GetKeyDown(KeyCode.P)) { textController.SetState(new CellState(textController)); } }
void UpdateDescriptionText() { string title = GetDescriptionTitle(); descriptionTitle.SetText(title); string text = GetDescriptionText(); descriptionText.SetText(text); }
public void SpawnText(List <Frases> keyNames) { canvas.SetActive(true); List <Frases> list = new List <Frases>(); list.AddRange(keyNames); if (list != null) { textPrefab.SetText(list); } }
public void Handle() { textController.SetText("You lean on your bed, and see your 20 old bedsheets, they are " + "absolutely nasty, and reek really bad. ¿How come you didn't notice them before?\n " + "Press R to Return roaming your cell"); if (Input.GetKeyDown(KeyCode.R)) { textController.SetState(new CellState(textController)); } }
public void Handle() { textController.SetText("You look the sheets trough the reflection\n" + "on your mirror, they look exactly the same: crappy\n" + "Press R to return roaming to your cell"); if (Input.GetKeyDown(KeyCode.R)) { textController.SetState(new CellMirrorState(textController)); } }
public void Handle() { textController.SetText("You lean on your doorlock, it's a combination lock with a few " + "buttons on your side, you press a few at a random order, but nothing really " + "happens.\n" + "Press R to Return roaming your cell"); if (Input.GetKeyDown(KeyCode.R)) { textController.SetState(new CellState(textController)); } }
public void NextDialog() { invoked = false; if (!dialogManager.isActive) { Begin(); } else { dialogManager.Next(); } if (dialogManager.nodeData.isEnd) { UIHolder.SetActive(false); playerUIHolder.SetActive(false); speechDone = true; runSpeech = false; playerUIHolder.gameObject.GetComponent <RectTransform>().localPosition = Vector3.zero; UIHolder.gameObject.GetComponent <RectTransform>().localPosition = Vector3.zero; } else if (dialogManager.nodeData.isPlayer) { UIHolder.SetActive(false); playerUIHolder.SetActive(true); playerTextC.SetText(dialogManager.nodeData.comments[dialogManager.nodeData.commentIndex]); } else { UIHolder.SetActive(true); playerUIHolder.SetActive(false); textC.SetText(dialogManager.nodeData.comments[dialogManager.nodeData.commentIndex]); } }
void SetScoreTexts() { string text1 = "SCORE: " + score.ToString(); scoreText.SetText(text1); string text2 = "HIGH SCORE: " + highScore.ToString(); highScoreText.SetText(text2); if (!isHighScoreUpdated) { highScoreUpdateText.gameObject.SetActive(false); } }
public void Handle() { textController.SetText("You see yourself reflected on the mirror, you are ugly as a sin.\n" + "The mirror seems loose, maybe with a bit of force it can come out of the wall.\n" + "Press T o Take the mirror or R to Return roaming your cell"); if (Input.GetKeyDown(KeyCode.R)) { textController.SetState(new CellState(textController)); } else if (Input.GetKeyDown(KeyCode.T)) { textController.SetState(new CellMirrorState(textController)); } }
public void Handle() { textController.SetText("You are still on your cell, holding the mirror\n" + "There are some dirty sheets on your bed, a spot where the\n" + "mirror used to be, and the door, still locked\n" + "Press S to view the Sheets, or L to view the Lock"); if (Input.GetKeyDown(KeyCode.S)) { textController.SetState(new Sheets1State(textController)); } else if (Input.GetKeyDown(KeyCode.L)) { textController.SetState(new Lock1State(textController)); } }
public void Handle() { textController.SetText("You put your mirror between the bars on\n" + "door, and you can see some fingerprints on the buttons\n" + "on the other side. You try to press them in order and the\n" + "door suddenly opens\n" + "Press O to Open the door, or R to Return to your cell"); if (Input.GetKeyDown(KeyCode.R)) { textController.SetState(new CellMirrorState(textController)); } else if (Input.GetKeyDown(KeyCode.O)) { textController.SetState(new FreedomState(textController)); } }
// Start is called before the first frame update void Start() { for (int i = 0; i < names.Length; i++) { Vector3 position = new Vector3(0, 0, i * spacing); cubes.Add(Instantiate(prefab, position, Quaternion.identity, transform)); } foreach (GameObject cube in cubes) { int index = cubes.IndexOf(cube); TextController textController = cube.GetComponent <TextController>(); textController.SetText(names[index]); MeshRenderer renderer = cube.GetComponent <MeshRenderer>(); renderer.material.color = Color.HSVToRGB((float)index / (float)cubes.Count, 1, 1); } }
public void onClick() { AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource> (); audioSources [1].Play(); if (tabibitoNoticeBtnFlg) { TabibitoNoticeBtn TabibitoNoticeBtn = new TabibitoNoticeBtn(); TabibitoNoticeBtn.onOffTabibitoMove(false); GameObject.Find("NaiseiController").GetComponent <NaiseiController>().stopFlg = false; } if (Application.loadedLevelName == "tutorialMain") { TextController txtScript = GameObject.Find("TextBoard").transform.FindChild("Text").GetComponent <TextController>(); txtScript.SetText(5); txtScript.SetNextLine(); txtScript.tutorialId = 5; txtScript.actOnFlg = false; PlayerPrefs.SetInt("tutorialId", 5); PlayerPrefs.Flush(); } else if (Application.loadedLevelName == "tutorialTouyou" || Application.loadedLevelName == "touyou") { GameObject.Find("Touyou").GetComponent <Canvas>().sortingLayerName = "Default"; } GameObject[] objects = GameObject.FindGameObjectsWithTag("Board"); //配列内のオブジェクトの数だけループ foreach (GameObject obj in objects) { //オブジェクトを削除 Destroy(obj); } GameObject boardBottom = GameObject.FindGameObjectWithTag("BoardBottm"); Destroy(boardBottom); GameObject boardFire = GameObject.FindGameObjectWithTag("BoardFire"); Destroy(boardFire); }
public void NextDialog() { if (textC.typing) { textC.SkipForward(); } else { if (!dialogManager.isActive) { Begin(); } else { dialogManager.Next(); } if (dialogManager.nodeData.isEnd) { UIHolder.SetActive(false); PlayerManager.playerDaddy.player.playerSpeechBubble.UIHolder.SetActive(false); player.DisableControls(false); dialogManager = new VD2(); } else if (dialogManager.nodeData.isPlayer) { UIHolder.SetActive(false); PlayerManager.playerDaddy.player.playerSpeechBubble.UIHolder.SetActive(true); PlayerManager.playerDaddy.player.playerSpeechBubble.textC.SetText(dialogManager.nodeData.comments[dialogManager.nodeData.commentIndex]); } else { UIHolder.SetActive(true); PlayerManager.playerDaddy.player.playerSpeechBubble.UIHolder.SetActive(false); print("Num: " + dialogManager.nodeData.commentIndex); textC.SetText(dialogManager.nodeData.comments[dialogManager.nodeData.commentIndex]); } } }
public void Handle() { textController.SetText("You wake up in your old prison cell, with a few sunrays hitting on your " + "face and gladly warming it up,'I have to escape this prison today'-You " + "say to yourself.\n" + "You look around: There are your old and dirty bedsheets, a mirror on the " + "wall, and in front of you there's the door, obviusly closed.\n" + "Press S to view the Sheets, M to view the mirror, and L to view the doorlock"); if (Input.GetKeyDown(KeyCode.S)) { textController.SetState(new Sheets0State(textController)); } else if (Input.GetKeyDown(KeyCode.M)) { textController.SetState(new MirrorState(textController)); } else if (Input.GetKeyDown(KeyCode.L)) { textController.SetState(new Lock0State(textController)); } }
public void SetText(string text, GameObject forObject) { textController.SetText(text, forObject); }
void SetGameLevelText() { levelText.SetText(gameLevel.ToString()); }
void SetQuestion() { question = Random.Range(Data.QUESTION_NUMBER_MIN, Data.QUESTION_NUMBER_MAX); questionText.SetText(question.ToString()); }
public void RunActions(ConversationAction[] actions, GameObject otherParty) { foreach (ConversationAction action in actions) { if (action.CanExecute()) { // Run action. switch (action.type) { case ConversationAction.ActionType.WalkTo: MapPoint mapPoint = new MapPoint { row = Convert.ToInt32(action.objects[0]), column = Convert.ToInt32(action.objects[1]) }; WalkTo(mapPoint, delegate(bool completed) { if (!completed) { return; } if (action.nextActions != null) { RunActions(action.nextActions, otherParty); } }); break; case ConversationAction.ActionType.RunConversation: RunConversation(action.objects[0], otherParty, delegate(bool completed) { if (!completed) { return; } if (action.nextActions != null) { RunActions(action.nextActions, otherParty); } }); break; case ConversationAction.ActionType.SetFlag: PropertyFactory.Instance.SetPropertyValueForKey(action.objects[0], action.objects[1]); break; case ConversationAction.ActionType.RemoveItem: foreach (string o in action.objects) { Inventory.Instance.RemoveItem(o); } break; case ConversationAction.ActionType.Say: textController.SetText(action.objects[0], player); break; default: break; } } } }
void SetAnswerText(string text) { answerText.SetText(text); }
void SetScoreText() { string text = "SCORE: " + Data.tmpScore.ToString(); scoreText.SetText(text); }
void UpdateScoreText() { string text = "SCORE: " + GetTrueScore().ToString(); scoreText.SetText(text); }
public void OnClick() { AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource> (); //Limit Check int stockLimit = PlayerPrefs.GetInt("stockLimit"); int myBusyoQty = PlayerPrefs.GetInt("myBusyoQty"); char[] delimiterChars = { ',' }; if (myBusyoQty + 1 > stockLimit && Application.loadedLevelName != "tutorialTouyou") { //Error audioSources [4].Play(); Message msg = new Message(); string Text = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { Text = "You can hire samurai by " + stockLimit.ToString() + " members."; } else { Text = "現在の国力では登用出来る武将数は" + stockLimit.ToString() + "人までですぞ。"; } msg.makeMessage(Text); } else { audioSources [3].Play(); audioSources [7].Play(); GameObject.Find("Touyou").GetComponent <Canvas>().sortingLayerName = "Default"; //Track bool tutorialDoneFlg = PlayerPrefs.GetBool("tutorialDoneFlg"); if (!tutorialDoneFlg || Application.loadedLevelName != "tutorialTouyou") { int TrackNewBusyoHireNo = PlayerPrefs.GetInt("TrackNewBusyoHireNo", 0); TrackNewBusyoHireNo = TrackNewBusyoHireNo + 1; PlayerPrefs.SetInt("TrackNewBusyoHireNo", TrackNewBusyoHireNo); /*Add zukan & gacya History Start*/ string zukanBusyoHst = PlayerPrefs.GetString("zukanBusyoHst"); if (zukanBusyoHst != null && zukanBusyoHst != "") { zukanBusyoHst = zukanBusyoHst + "," + busyoId.ToString(); } else { zukanBusyoHst = busyoId.ToString(); } PlayerPrefs.SetString("zukanBusyoHst", zukanBusyoHst); //Daimyo Busyo History Daimyo daimyo = new Daimyo(); if (daimyo.daimyoBusyoCheck(busyoId)) { string gacyaDaimyoHst = PlayerPrefs.GetString("gacyaDaimyoHst"); if (gacyaDaimyoHst != null && gacyaDaimyoHst != "") { gacyaDaimyoHst = gacyaDaimyoHst + "," + busyoId.ToString(); } else { gacyaDaimyoHst = busyoId.ToString(); } PlayerPrefs.SetString("gacyaDaimyoHst", gacyaDaimyoHst); } //sequence string sequenceString = ""; if (sequence == 1) { sequenceString = "1,0,0"; } else if (sequence == 2) { sequenceString = "0,1,0"; } else if (sequence == 3) { sequenceString = "0,0,1"; } PlayerPrefs.SetString("touyouHst", sequenceString); if (rank == "S") { PlayerPrefs.SetBool("questSpecialFlg0", true); } else if (rank == "A") { PlayerPrefs.SetBool("questSpecialFlg1", true); } PlayerPrefs.Flush(); /*Add zukan & gacya History End*/ //My Busyo Exist Check string myBusyoString = PlayerPrefs.GetString("myBusyo"); List <string> myBusyoList = new List <string>(); if (myBusyoString.Contains(",")) { myBusyoList = new List <string>(myBusyoString.Split(delimiterChars)); } else { myBusyoList.Add(myBusyoString); } if (myBusyoList.Contains(busyoId.ToString())) { //add lv string addLvTmp = "addlv" + busyoId.ToString(); int addLvValue = 0; if (PlayerPrefs.HasKey(addLvTmp)) { addLvValue = PlayerPrefs.GetInt(addLvTmp); addLvValue = addLvValue + 1; if (addLvValue >= 100) { addLvValue = 100; } } else { addLvValue = 1; } if (addLvValue < 100) { PlayerPrefs.SetInt(addLvTmp, addLvValue); PlayerPrefs.Flush(); //View Message Box Destroy(GameObject.Find("board(Clone)")); Destroy(GameObject.Find("Back(Clone)")); MessageBusyo msg = new MessageBusyo(); string type = "touyou"; string msgText = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { msgText = "Max Lv of " + busyoName + " increased."; } else { msgText = busyoName + "の最大レベルが1上がりました。"; } msg.makeMessage(msgText, busyoId, type); } else { //Lv up int currentLv = PlayerPrefs.GetInt(busyoId.ToString()); int maxLv = 100 + addLvValue; int newLv = 0; string lvUpText = ""; //Already Lv Max if (currentLv == maxLv) { newLv = currentLv; int busyoDama = 0; if (rank == "S") { busyoDama = 200; } else if (rank == "A") { busyoDama = 50; } else if (rank == "B") { busyoDama = 20; } else if (rank == "C") { busyoDama = 10; } int myBusyoDama = PlayerPrefs.GetInt("busyoDama"); myBusyoDama = myBusyoDama + busyoDama; PlayerPrefs.SetInt("busyoDama", myBusyoDama); if (Application.systemLanguage != SystemLanguage.Japanese) { lvUpText = "You got " + busyoDama + " stone."; } else { lvUpText = "武将珠" + busyoDama + "個を贈呈します。"; } GameObject.Find("BusyoDamaValue").GetComponent <Text> ().text = myBusyoDama.ToString(); } else { newLv = currentLv + 1; if (Application.systemLanguage != SystemLanguage.Japanese) { lvUpText = busyoName + " Lv was increased."; } else { lvUpText = busyoName + "をレベルアップしました。"; } } PlayerPrefs.SetInt(busyoId.ToString(), newLv); if (currentLv != maxLv) { string exp = "exp" + busyoId.ToString(); Exp expCalc = new Exp(); int totalExp = expCalc.getExpforNextLv(currentLv); PlayerPrefs.SetInt(exp, totalExp); } //View Message Box Destroy(GameObject.Find("board(Clone)")); Destroy(GameObject.Find("Back(Clone)")); MessageBusyo msg = new MessageBusyo(); string type = "touyou"; msg.makeMessage(lvUpText, busyoId, type); } } else { int existCheck = PlayerPrefs.GetInt(busyoId.ToString()); if (existCheck != 0 && existCheck != null) { //my Busyo not contain but player used him before daimyo was changed if (myBusyoString == null || myBusyoString == "") { myBusyoString = busyoId.ToString(); } else { myBusyoString = myBusyoString + "," + busyoId.ToString(); } PlayerPrefs.SetString("myBusyo", myBusyoString); //Add Qty myBusyoQty = myBusyoQty + 1; PlayerPrefs.SetInt("myBusyoQty", myBusyoQty); //View Message Box Destroy(GameObject.Find("board(Clone)")); Destroy(GameObject.Find("Back(Clone)")); MessageBusyo msg = new MessageBusyo(); string touyouuText = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { touyouuText = "We hired " + busyoName + "."; } else { touyouuText = busyoName + "を登用しました。"; } string type = "touyou"; msg.makeMessage(touyouuText, busyoId, type); } else { //Add Completely New Data if (myBusyoString == null || myBusyoString == "") { myBusyoString = busyoId.ToString(); } else { myBusyoString = myBusyoString + "," + busyoId.ToString(); } PlayerPrefs.SetString("myBusyo", myBusyoString); PlayerPrefs.SetInt(busyoId.ToString(), 1); string hei = "hei" + busyoId.ToString(); string heiValue = heisyu + ":1:1:1"; PlayerPrefs.SetString(hei, heiValue); string senpou = "senpou" + busyoId.ToString(); PlayerPrefs.SetInt(senpou, 1); //Lv string saku = "saku" + busyoId.ToString(); PlayerPrefs.SetInt(saku, 1); //Lv string kahou = "kahou" + busyoId.ToString(); PlayerPrefs.SetString(kahou, "0,0,0,0,0,0,0,0"); string exp = "exp" + busyoId.ToString(); PlayerPrefs.SetInt(exp, 0); //Add Qty myBusyoQty = myBusyoQty + 1; PlayerPrefs.SetInt("myBusyoQty", myBusyoQty); //View Message Box Destroy(GameObject.Find("board(Clone)")); Destroy(GameObject.Find("Back(Clone)")); MessageBusyo msg = new MessageBusyo(); string touyouuText = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { touyouuText = "We hired " + busyoName + "."; } else { touyouuText = busyoName + "を登用しました。"; } string type = "touyou"; msg.makeMessage(touyouuText, busyoId, type); } } } else { //retry tutorial PlayerPrefs.SetInt("tutorialBusyo", busyoId); PlayerPrefs.Flush(); //View Message Box Destroy(GameObject.Find("board(Clone)")); Destroy(GameObject.Find("Back(Clone)")); MessageBusyo msg = new MessageBusyo(); string touyouuText = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { touyouuText = "We hired " + busyoName + "."; } else { touyouuText = busyoName + "を登用しました。"; } string type = "touyou"; msg.makeMessage(touyouuText, busyoId, type); } } PlayerPrefs.Flush(); //Close Process string gacyaHst = ""; if (Application.loadedLevelName == "tutorialTouyou") { gacyaHst = "4,16,201"; //Set Parametor PlayerPrefs.SetInt("tutorialId", 9); PlayerPrefs.Flush(); TextController txtScript = GameObject.Find("TextBoard").transform.FindChild("Text").GetComponent <TextController>(); txtScript.SetText(8); txtScript.SetNextLine(); txtScript.tutorialId = 8; txtScript.actOnFlg = false; //Center View GameObject centerView = GameObject.Find("CenterView").gameObject; centerView.transform.SetParent(GameObject.Find("tFinished").transform); } else { gacyaHst = PlayerPrefs.GetString("gacyaHst"); } string[] tokens = gacyaHst.Split(delimiterChars); int[] hitBusyo = Array.ConvertAll <string, int>(tokens, int.Parse); Gacya viewBusyo = new Gacya(); viewBusyo.viewBusyo(hitBusyo, false); }
public void OnClick() { AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource> (); if (!doneCyosyuFlg) { audioSources [3].Play(); doneCyosyuFlg = true; MainStageController main = new MainStageController(); /*** season change Start ***/ string yearSeason = PlayerPrefs.GetString("yearSeason"); char[] delimiterChars = { ',' }; string[] yearSeasonList = yearSeason.Split(delimiterChars); int nowYear = int.Parse(yearSeasonList[0]); int nowSeason = int.Parse(yearSeasonList[1]); if (nowSeason == 4) { nowYear = nowYear + 1; nowSeason = 1; } else { nowSeason = nowSeason + 1; } string newYearSeason = nowYear.ToString() + "," + nowSeason.ToString(); PlayerPrefs.DeleteKey("bakuhuTobatsuDaimyoId"); PlayerPrefs.SetString("yearSeason", newYearSeason); string lastSeasonChangeTime = System.DateTime.Now.ToString(); PlayerPrefs.SetString("lastSeasonChangeTime", lastSeasonChangeTime); PlayerPrefs.DeleteKey("usedBusyo"); DoNextSeason DoNextSeason = new DoNextSeason(); DoNextSeason.deleteLinkCut(); DoNextSeason.deleteWinOver(); PlayerPrefs.Flush(); //Change Label GameObject.Find("YearValue").GetComponent <Text>().text = nowYear.ToString(); main.SetSeason(nowSeason); /*** season change End ***/ PlayerPrefs.SetBool("doneCyosyuFlg", doneCyosyuFlg); string targetName = ""; //Cyosyu Handling if (cyosyuTarget == "money") { int nowMoney = PlayerPrefs.GetInt("money"); int resultMoney = nowMoney + totalMoney; if (totalKozanMoney != 0) { resultMoney = resultMoney + totalKozanMoney; } if (resultMoney < 0) { resultMoney = int.MaxValue; } PlayerPrefs.SetInt("money", resultMoney); if (Application.systemLanguage != SystemLanguage.Japanese) { targetName = "Money"; } else { targetName = "金"; } GameObject.Find("MoneyValue").GetComponent <Text> ().text = resultMoney.ToString(); int TrackGetMoneyNo = PlayerPrefs.GetInt("TrackGetMoneyNo", 0); TrackGetMoneyNo = TrackGetMoneyNo + totalMoney + totalKozanMoney; PlayerPrefs.SetInt("TrackGetMoneyNo", TrackGetMoneyNo); } else if (cyosyuTarget == "hyourou") { int nowHyourou = PlayerPrefs.GetInt("hyourou"); int maxHyourou = PlayerPrefs.GetInt("hyourouMax"); int resultHyourou = nowHyourou + totalHyourou; if (resultHyourou > maxHyourou) { resultHyourou = maxHyourou; } PlayerPrefs.SetInt("hyourou", resultHyourou); GameObject.Find("HyourouCurrentValue").GetComponent <Text> ().text = resultHyourou.ToString(); if (Application.systemLanguage != SystemLanguage.Japanese) { targetName = "Stamina"; } else { targetName = "兵糧"; } int TrackGetHyourouNo = PlayerPrefs.GetInt("TrackGetHyourouNo", 0); TrackGetHyourouNo = TrackGetHyourouNo + totalHyourou; PlayerPrefs.SetInt("TrackGetHyourouNo", TrackGetHyourouNo); if (totalKozanMoney != 0) { int nowMoney = PlayerPrefs.GetInt("money"); int resultMoney = nowMoney + totalKozanMoney; if (resultMoney < 0) { resultMoney = int.MaxValue; } PlayerPrefs.SetInt("money", resultMoney); if (Application.systemLanguage != SystemLanguage.Japanese) { targetName = targetName + " and Gold"; } else { targetName = targetName + "と鉱山収入"; } GameObject.Find("MoneyValue").GetComponent <Text> ().text = resultMoney.ToString(); int TrackGetMoneyNo = PlayerPrefs.GetInt("TrackGetMoneyNo", 0); TrackGetMoneyNo = TrackGetMoneyNo + totalKozanMoney; PlayerPrefs.SetInt("TrackGetMoneyNo", TrackGetMoneyNo); } } else if (cyosyuTarget == "gunjyu") { if (Application.systemLanguage != SystemLanguage.Japanese) { targetName = "Weapon"; } else { targetName = "軍需物資"; } //YR if (totalYRL != 0 || totalYRM != 0 || totalYRH != 0) { string cyoheiYRString = PlayerPrefs.GetString("cyouheiYR"); List <string> cyoheiYRList = new List <string>(); cyoheiYRList = new List <string> (cyoheiYRString.Split(delimiterChars)); int newYRL = totalYRL; int newYRM = totalYRM; int newYRH = totalYRH; newYRL = newYRL + int.Parse(cyoheiYRList[0]); newYRM = newYRM + int.Parse(cyoheiYRList[1]); newYRH = newYRH + int.Parse(cyoheiYRList[2]); string newCyoheiYR = newYRL + "," + newYRM + "," + newYRH; PlayerPrefs.SetString("cyouheiYR", newCyoheiYR); } //KB if (totalKBL != 0 || totalKBM != 0 || totalKBH != 0) { string cyoheiKBString = PlayerPrefs.GetString("cyouheiKB"); List <string> cyoheiKBList = new List <string>(); cyoheiKBList = new List <string> (cyoheiKBString.Split(delimiterChars)); int newKBL = totalKBL; int newKBM = totalKBM; int newKBH = totalKBH; newKBL = newKBL + int.Parse(cyoheiKBList[0]); newKBM = newKBM + int.Parse(cyoheiKBList[1]); newKBH = newKBH + int.Parse(cyoheiKBList[2]); string newCyoheiKB = newKBL + "," + newKBM + "," + newKBH; PlayerPrefs.SetString("cyouheiKB", newCyoheiKB); } //YM if (totalYML != 0 || totalYMM != 0 || totalYMH != 0) { string cyoheiYMString = PlayerPrefs.GetString("cyouheiYM"); List <string> cyoheiYMList = new List <string>(); cyoheiYMList = new List <string> (cyoheiYMString.Split(delimiterChars)); int newYML = totalYML; int newYMM = totalYMM; int newYMH = totalYMH; newYML = newYML + int.Parse(cyoheiYMList[0]); newYMM = newYMM + int.Parse(cyoheiYMList[1]); newYMH = newYMH + int.Parse(cyoheiYMList[2]); string newCyoheiYM = newYML + "," + newYMM + "," + newYMH; PlayerPrefs.SetString("cyouheiYM", newCyoheiYM); } //TP if (totalTPL != 0 || totalTPM != 0 || totalTPH != 0) { string cyoheiTPString = PlayerPrefs.GetString("cyouheiTP"); List <string> cyoheiTPList = new List <string>(); cyoheiTPList = new List <string> (cyoheiTPString.Split(delimiterChars)); int newTPL = totalTPL; int newTPM = totalTPM; int newTPH = totalTPH; newTPL = newTPL + int.Parse(cyoheiTPList[0]); newTPM = newTPM + int.Parse(cyoheiTPList[1]); newTPH = newTPH + int.Parse(cyoheiTPList[2]); string newCyoheiTP = newTPL + "," + newTPM + "," + newTPH; PlayerPrefs.SetString("cyouheiTP", newCyoheiTP); } //SNB if (totalSNBL != 0 || totalSNBM != 0 || totalSNBH != 0) { if (totalSNBL != 0) { int SNBQty = PlayerPrefs.GetInt("shinobiGe"); int newQty = SNBQty + totalSNBL; PlayerPrefs.SetInt("shinobiGe", newQty); } if (totalSNBM != 0) { int SNBQty = PlayerPrefs.GetInt("shinobiCyu"); int newQty = SNBQty + totalSNBM; PlayerPrefs.SetInt("shinobiCyu", newQty); } if (totalSNBH != 0) { int SNBQty = PlayerPrefs.GetInt("shinobiJyo"); int newQty = SNBQty + totalSNBH; PlayerPrefs.SetInt("shinobiJyo", newQty); } } int TrackGetSozaiNo = PlayerPrefs.GetInt("TrackGetSozaiNo", 0); TrackGetSozaiNo = TrackGetSozaiNo + totalYRL + totalKBL + totalYML + totalTPL + totalYRM + totalKBM + totalYMM + totalTPM + totalYRH + totalKBH + totalYMH + totalTPH + totalSNBL + totalSNBM + totalSNBH; PlayerPrefs.SetInt("TrackGetSozaiNo", TrackGetSozaiNo); if (totalKozanMoney != 0) { int nowMoney = PlayerPrefs.GetInt("money"); int resultMoney = nowMoney + totalKozanMoney; if (resultMoney < 0) { resultMoney = int.MaxValue; } PlayerPrefs.SetInt("money", resultMoney); if (Application.systemLanguage != SystemLanguage.Japanese) { targetName = targetName + " and Gold"; } else { targetName = targetName + "と鉱山収入"; } GameObject.Find("MoneyValue").GetComponent <Text> ().text = resultMoney.ToString(); int TrackGetMoneyNo = PlayerPrefs.GetInt("TrackGetMoneyNo", 0); TrackGetMoneyNo = TrackGetMoneyNo + totalKozanMoney; PlayerPrefs.SetInt("TrackGetMoneyNo", TrackGetMoneyNo); } } PlayerPrefs.SetBool("questDailyFlg38", true); PlayerPrefs.Flush(); MainStageController mainStage = new MainStageController(); mainStage.questExtension(); //Message Message msg = new Message(); string text = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { text = "My lord, you earned " + targetName + ".\nPlease enrich the country more by development."; } else { text = targetName + "を徴収しましたぞ。\n内政でより国を富ませましょう。"; } msg.makeMessageOnBoard(text); //Restart GameObject.Find("GameController").GetComponent <MainStageController>().doneCyosyuFlg = true; GameObject.Find("GetTimer").GetComponent <GetNaiseiTimer>().Start(); GameObject.Find("GetTimer").GetComponent <GetNaiseiTimer>().timer = GameObject.Find("GameController").GetComponent <MainStageController>().yearTimer; //tutorial if (Application.loadedLevelName == "tutorialMain") { Destroy(GameObject.Find("board").gameObject); Destroy(GameObject.Find("Back(Clone)").gameObject); PlayerPrefs.SetInt("tutorialId", 5); PlayerPrefs.Flush(); TextController txtScript = GameObject.Find("TextBoard").transform.FindChild("Text").GetComponent <TextController>(); txtScript.SetText(5); txtScript.SetNextLine(); txtScript.tutorialId = 5; txtScript.actOnFlg = false; GameObject SubButtonViewLeft = GameObject.Find("SubButtonViewLeft").gameObject; GameObject.Find("SeiryokuInfo").transform.SetParent(SubButtonViewLeft.transform); } } else { audioSources [4].Play(); Message msg = new Message(); string text = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { text = "Season hasn't changed.\nPlease wait a moment for collecting taxes."; } else { text = "まだ季節は変わっておりませぬぞ。\n徴収は今しばらくお待ち下さいませ。"; } msg.makeMessageOnBoard(text); } }
public void ActTutorial(int tutorialId) { if (tutorialId == 1) { //###To Naisei### //1. Kamon & Kuni Focus GameObject tButtonObj = GameObject.Find("tButton").gameObject; GameObject.Find("KuniMap").transform.FindChild("1").SetParent(tButtonObj.transform); GameObject.Find("KuniIconView").transform.FindChild("1").SetParent(tButtonObj.transform); Vector2 vect = new Vector2(20, 20); GameObject animObj = SetPointer(tButtonObj, vect); animObj.transform.localScale = new Vector2(100, 100); } else if (tutorialId == 2) { //2. Naise Shikichi Focus GameObject tButtonObj = GameObject.Find("tButton").gameObject; GameObject.Find("NaiseiView").transform.FindChild("12").SetParent(tButtonObj.transform); Vector2 vect = new Vector2(260, 150); GameObject animObj = SetPointer(tButtonObj, vect); animObj.transform.localScale = new Vector2(200, 200); } else if (tutorialId == 3) { //3. Back to Main Focus GameObject buttonObj = GameObject.Find("Naisei").transform.FindChild("Panel").transform.FindChild("Button").gameObject; buttonObj.transform.SetParent(GameObject.Find("tButton").transform); Vector2 vect = new Vector2(0, 100); GameObject animObj = SetPointer(buttonObj, vect); animObj.transform.localScale = new Vector2(300, 300); } else if (tutorialId == 4) { //4. Cyosyu Focus GameObject SeiryokuInfoObj = GameObject.Find("SeiryokuInfo").gameObject; SeiryokuInfoObj.transform.SetParent(GameObject.Find("tButton").transform); Vector2 vect = new Vector2(0, 50); GameObject animObj = SetPointer(SeiryokuInfoObj, vect); animObj.transform.localScale = new Vector2(120, 120); } else if (tutorialId == 5) { //5. Touyou Focus GameObject btn = SetMainButton("Touyou"); Vector2 vect = new Vector2(0, 50); GameObject animObj = SetPointer(btn, vect); animObj.transform.localScale = new Vector2(200, 200); } else if (tutorialId == 6) { //6. Touyou Button Focus GameObject original = GameObject.Find("BusyoDamaGacya"); GameObject copied = Object.Instantiate(original) as GameObject; copied.name = "BusyoDamaGacya"; copied.transform.SetParent(GameObject.Find("tButton").transform); copied.transform.localPosition = new Vector3(280, -240); copied.transform.localScale = new Vector3(1, 1); Vector2 vect = new Vector2(0, 50); GameObject animObj = SetPointer(copied, vect); animObj.transform.localScale = new Vector2(200, 200); } else if (tutorialId == 8) { //8. Back to Main button GameObject buttonObj = GameObject.Find("Panel").transform.FindChild("Button").gameObject; buttonObj.transform.SetParent(GameObject.Find("tButton").transform); Vector2 vect = new Vector2(0, 100); GameObject animObj = SetPointer(buttonObj, vect); animObj.transform.localScale = new Vector2(300, 300); } else if (tutorialId == 9) { //Busyo at Main GameObject btn = SetMainButton("Busyo"); Vector2 vect = new Vector2(0, 50); GameObject animObj = SetPointer(btn, vect); animObj.transform.localScale = new Vector2(200, 200); } else if (tutorialId == 11) { GameObject btn = SetMainButton("Jinkei"); Vector2 vect = new Vector2(0, 50); GameObject animObj = SetPointer(btn, vect); animObj.transform.localScale = new Vector2(200, 200); } else if (tutorialId == 12) { //jinkei GameObject tBack = GameObject.Find("tBack").gameObject; GameObject sourceObj = GameObject.Find("ScrollView").transform.FindChild("Content").transform.FindChild("Slot").gameObject; sourceObj.transform.SetParent(tBack.transform); GameObject jinkeiView = GameObject.Find("JinkeiView").gameObject; GameObject copied = Object.Instantiate(jinkeiView) as GameObject; copied.transform.SetParent(GameObject.Find("Panel").transform, false); copied.name = "copiedJinkeiView"; foreach (Transform chld in copied.transform) { if (chld.name == "Slot12") { Destroy(chld.transform.FindChild("19").gameObject); } if (chld.name != "Slot13") { chld.gameObject.SetActive(false); } } //Set Arrow string arrowPath = "Prefabs/PostKassen/Arrow"; GameObject arrowObj = Instantiate(Resources.Load(arrowPath)) as GameObject; arrowObj.transform.SetParent(sourceObj.transform); arrowObj.transform.localPosition = new Vector2(120, 0); arrowObj.transform.localScale = new Vector2(100, 100); arrowObj.transform.Rotate(new Vector3(0f, 0f, -30f)); arrowObj.GetComponent <FadeoutArrowMove>().enabled = false; arrowObj.AddComponent <Blinker>().timer = 5; } else if (tutorialId == 14) { //Start Kassen string pathBack = "Prefabs/PreKassen/backGround"; GameObject back = Instantiate(Resources.Load(pathBack)) as GameObject; back.transform.localScale = new Vector2(30, 15); string pathLight = "Prefabs/PreKassen/lightning"; GameObject light = Instantiate(Resources.Load(pathLight)) as GameObject; light.transform.localScale = new Vector2(10, 10); StartEveryObject(); Destroy(GameObject.Find("tBack").gameObject); GameObject.Find("timer").GetComponent <Timer>().paused = false; } else if (tutorialId == 15) { //Finalize bool tutorialDoneFlg = PlayerPrefs.GetBool("tutorialDoneFlg"); if (!tutorialDoneFlg) { AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource>(); audioSources[3].Play(); PlayerPrefs.SetBool("tutorialDoneFlg", true); int busyoDama = PlayerPrefs.GetInt("busyoDama"); busyoDama = busyoDama + 100; PlayerPrefs.SetInt("busyoDama", busyoDama); GameObject busyoDamaObj = GameObject.Find("BusyoDamaValue").gameObject; busyoDamaObj.GetComponent <Text>().text = busyoDama.ToString(); Vector2 vect = new Vector2(500, 500); GameObject anim = SetFadeoutPointer(busyoDamaObj, vect); anim.transform.localScale = new Vector2(1000, 1000); } PlayerPrefs.SetInt("tutorialId", tutorialId); TextController textScript = GameObject.Find("TextBoard").transform.FindChild("Text").GetComponent <TextController>(); tutorialId = tutorialId + 1; textScript.tutorialId = tutorialId; textScript.actOnFlg = false; textScript.SetText(tutorialId); PlayerPrefs.Flush(); } else if (tutorialId == 16) { GameObject.Find("KumoLeft").GetComponent <KumoMove>().runFlg = true; GameObject.Find("KumoRight").GetComponent <KumoMove>().runFlg = true; GameObject.Find("KumoLeft").GetComponent <KumoMove>().tutorialDoneFlg = true; GameObject.Find("KumoRight").GetComponent <KumoMove>().tutorialDoneFlg = true; } }
public void OnClick() { AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource> (); int[] hitBusyo = new int[3]; //Check Message msg = new Message(); if (name == "DailyGacyaButton") { TouyouController script = GameObject.Find("TouyouController").GetComponent <TouyouController>(); int freeGacyaCount = script.freeGacyaCount; if (freeGacyaCount < 5) { audioSources [8].Play(); //Reset Touyou Hist PlayerPrefs.DeleteKey("touyouHst"); PlayerPrefs.Flush(); //Disable GetComponent <Button>().enabled = false; GameObject.Find("BusyoDamaGacyaButton").GetComponent <Button>().enabled = false; //Reduce int countUp = freeGacyaCount + 1; int remain = 5 - countUp; script.freeGacyaCount = countUp; GameObject.Find("Count").GetComponent <Text>().text = remain.ToString(); //Data PlayerPrefs.SetString("freeGacyaDate", System.DateTime.Today.ToString()); PlayerPrefs.SetInt("freeGacyaCounter", countUp); PlayerPrefs.SetBool("questDailyFlg18", true); PlayerPrefs.Flush(); //Gacya viewBusyo(doGacya(), true); } else { audioSources [4].Play(); msg.makeMessage(msg.getMessage(54)); } } else if (name == "BusyoDamaGacyaButton") { //BusyoDama Qty Check if (Application.loadedLevelName == "tutorialTouyou") { audioSources[8].Play(); //Disable GetComponent <Button>().enabled = false; GameObject.Find("DailyGacyaButton").GetComponent <Button>().enabled = false; //Gacya viewBusyo(doTutorialGacya(), true); GameObject tBack = GameObject.Find("tBack"); GameObject.Find("CenterView").transform.SetParent(tBack.transform); TextController textScript = GameObject.Find("TextBoard").transform.FindChild("Text").GetComponent <TextController>(); textScript.tutorialId = 7; textScript.SetText(7); textScript.SetNextLine(); GameObject busyoDamaGacyaBtn = GameObject.Find("tButton").transform.FindChild("BusyoDamaGacya").gameObject; busyoDamaGacyaBtn.transform.SetParent(GameObject.Find("UnderView").transform); busyoDamaGacyaBtn.transform.localPosition = new Vector2(320, -300); Destroy(busyoDamaGacyaBtn.transform.FindChild("point_up").gameObject); } else { int busyoDama = PlayerPrefs.GetInt("busyoDama"); if (busyoDama >= 100) { audioSources [8].Play(); //Reset Touyou Hist PlayerPrefs.DeleteKey("touyouHst"); PlayerPrefs.Flush(); //Disable GetComponent <Button>().enabled = false; GameObject.Find("DailyGacyaButton").GetComponent <Button>().enabled = false; //Reduce Qty int newBusyoDama = busyoDama - 100; PlayerPrefs.SetInt("busyoDama", newBusyoDama); PlayerPrefs.SetBool("questDailyFlg19", true); PlayerPrefs.Flush(); //Change Screen GameObject.Find("BusyoDamaValue").GetComponent <Text>().text = newBusyoDama.ToString(); //Gacya viewBusyo(doGacya(), true); } else { audioSources [4].Play(); msg.makeMessage(msg.getMessage(2)); } } } }
public void OnDrop(PointerEventData eventData) { JinkeiScene jinkeiScene = new JinkeiScene(); //From JinkeiView to ScrollView string path = "Prefabs/Jinkei/Slot"; bool limitFlg = true; bool diffClanFlg = false; AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource> (); if (DragHandler.itemBeginDragged != null) { if (DragHandler.itemBeginDragged.transform.parent != null) { if (DragHandler.itemBeginDragged.transform.parent.name != "Slot") { if (transform.name == "ScrollView" || transform.name == "Slot") { //Drag JinkeiView -> Scroll GameObject prefab = Instantiate(Resources.Load(path)) as GameObject; prefab.transform.parent = GameObject.Find("Content").transform; prefab.transform.localScale = new Vector3(1, 1, 1); prefab.transform.localPosition = new Vector3(0, 0, 0); prefab.name = "Slot"; DragHandler.itemBeginDragged.transform.SetParent(prefab.transform); //Add Busyo Qty if (Application.loadedLevelName == "preKassen") { GameObject.Find("GameScene").GetComponent <preKassen>().busyoCurrentQty = GameObject.Find("GameScene").GetComponent <preKassen>().busyoCurrentQty - 1; prefab.GetComponent <LayoutElement>().minHeight = 110; prefab.GetComponent <LayoutElement>().minWidth = 110; } else if (Application.loadedLevelName == "preKaisen") { GameObject.Find("GameScene").GetComponent <preKaisen>().busyoCurrentQty = GameObject.Find("GameScene").GetComponent <preKaisen>().busyoCurrentQty - 1; prefab.GetComponent <LayoutElement>().minHeight = 110; prefab.GetComponent <LayoutElement>().minWidth = 110; } else { Text busyoQtyObj = GameObject.Find("jinkeiQtyValue").GetComponent <Text>(); int busyoQty = int.Parse(busyoQtyObj.text); busyoQtyObj.text = (busyoQty - 1).ToString(); } } } else if (DragHandler.itemBeginDragged.transform.parent.name == "Slot") { if (transform.name != "ScrollView" && transform.name != "Slot") { //Drag Scroll -> JinkeiView if (busyoLimitFlg != 0) { if (!item) { //hard bool hardFlg = false; if (Application.loadedLevelName != "tutorialHyojyo") { hardFlg = PlayerPrefs.GetBool("hardFlg"); } if (hardFlg) { int myDaimyo = PlayerPrefs.GetInt("myDaimyo"); if (myDaimyo != DragHandler.itemBeginDragged.GetComponent <Senryoku>().belongDaimyoId) { diffClanFlg = true; } } if (diffClanFlg) { audioSources[4].Play(); Message msg = new Message(); msg.makeMessage(msg.getMessage(144)); } else { if (Application.loadedLevelName == "preKassen") { GameObject.Find("GameScene").GetComponent <preKassen>().busyoCurrentQty = GameObject.Find("GameScene").GetComponent <preKassen>().busyoCurrentQty + 1; } else if (Application.loadedLevelName == "preKaisen") { GameObject.Find("GameScene").GetComponent <preKaisen>().busyoCurrentQty = GameObject.Find("GameScene").GetComponent <preKaisen>().busyoCurrentQty + 1; } else { GameObject.Find("jinkeiQtyValue").GetComponent <Text>().text = busyoLimitFlg.ToString(); } audioSources [2].Play(); //Tutorial if (Application.loadedLevelName == "tutorialHyojyo") { GameObject RightView = GameObject.Find("RightView").gameObject; GameObject copied = Object.Instantiate(RightView) as GameObject; copied.transform.SetParent(GameObject.Find("Panel").transform); copied.transform.localScale = new Vector2(1, 1); copied.transform.localPosition = new Vector2(530, -10); foreach (Transform chld in copied.transform.FindChild("JinkeiButton").transform) { chld.gameObject.SetActive(false); } GameObject status = copied.transform.FindChild("Status").gameObject; status.GetComponent <Image>().enabled = false; foreach (Transform chld in status.transform) { chld.gameObject.SetActive(false); } GameObject confirm = copied.transform.FindChild("KakuteiButton").gameObject; Vector2 vect = new Vector2(0, 50); TutorialController tutorialScript = new TutorialController(); GameObject btn = tutorialScript.SetPointer(confirm, vect); btn.transform.localScale = new Vector2(150, 150); TextController txtScript = GameObject.Find("TextBoard").transform.FindChild("Text").GetComponent <TextController>(); txtScript.SetText(13); txtScript.SetNextLine(); txtScript.tutorialId = 13; txtScript.actOnFlg = false; } } } else { audioSources [1].Play(); Debug.Log("NOOOOOO"); } } else { audioSources [4].Play(); limitFlg = false; Message msg = new Message(); msg.makeMessage(msg.getMessage(59)); } } } } if (!item) { if (limitFlg != false) { if (!diffClanFlg) { DragHandler.itemBeginDragged.transform.SetParent(transform); ExecuteEvents.ExecuteHierarchy <IHasChanged> (gameObject, null, (x, y) => x.HasChanged()); audioSources [2].Play(); } } } else { Debug.Log("busyo exist"); } } }