private void BtnStartClick() { SoundManager.Instance.PlayClip(ClipButton); LeanTween.alphaCanvas(canvasGroup, 0, 0.25f).setOnComplete(() => { gameObject.SetActive(false); this.GameScreen.SetActive(true); horizontalScrollSnap.GoToScreen(0); }); }
private void BtnBackClick() { SoundManager.Instance.PlayClip(ClipButton); LeanTween.alphaCanvas(canvas, 0, 0.25f).setOnComplete(() => { this.playScreen.SetActive(true); gameObject.SetActive(false); horizontalScrollSnap.GoToScreen(0); }); BgManager.Instance.SetAllIconsWhiteColor(false); }
public void OnPointerClick(PointerEventData eventData) { if (hss != null) { hss.GoToScreen(Page); } }
public void GoToScreen(int indexPage) { _horizontalScrollSnap.GoToScreen(indexPage); var phoneNumber = _phoneNumberPanel.GetPhoneNumber(); if (indexPage == 0) { } else if (indexPage == 1) { _verificationPanel.Initialize(phoneNumber); _verificationPanel.InitTimer(); PhoneManager.Instance.VerifyPhoneNumber(phoneNumber); } else if (indexPage == 2) { _profilePanel.Initialize(phoneNumber); } }
// Levels void GoToLevel(Level level) { // show close button backButton.SetActive(true); _nextButton.SetActive(false); PrepareRankForLevel(level); ChangeSignText(LocaliseText.Get(_currentPack.JsonData.GetString("name"))); _showingLevels = true; _scrollSnap.GoToScreen(1); }
// Update is called once per frame void Update() { //see if a machine is open for (int i = 0; i < AllMachines.WasherControllerList.Count; i++) { if (!AllMachines.WasherControllerList[i].pressOK) { machineOpen = true; break; } else { machineOpen = false; } } //code below doesn't work because it doesn't tell if is touch a button but UI element // Check if there is a touch if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began) { // Check if finger is over a UI element if (EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId)) { //Debug.Log("Touched the UI"); } else { // //touch anywhere on screen, close Karara UI // Hide(clothCG); // Hide(messageCG); // isShown = false; // //close fish talking // Hide(fishTalk); } } //hide shout if (!isTutorial && LevelManager.isInstruction) { if (mySubwayState == SubwayState.One) { //LevelManager.isInstruction = false; Hide(fishShoutCG); } else { Show(fishShoutCG); } } //disable swipe before player click the poster if (isTutorial) { if (TutorialManager.tutorialNumber == 0 && mySubwayState == SubwayState.Four) { //myHSS.GoToScreen(4); //myHSS.enabled = false; } else if (TutorialManager.tutorialNumber == 2 && mySubwayState == SubwayState.One) { //myHSS.GoToScreen(1); //myHSS.enabled = false; } } //add a beginning and an end for the subway background scene if (HorizontalScrollSnap.CurrentPage == 5) { myHSS.GoToScreen(4); } else if (HorizontalScrollSnap.CurrentPage == 0) { myHSS.GoToScreen(1); } if (lateReturnComic) { // GoSubwayPart(); // lateReturnImage.enabled = true; // ChangeToSubway(); // myHSS.GoToScreen(1); // Show(fishTalk); // fishTalkText.text = "Return your customers' clothes in time! How can you have such bad memory!"; // lateReturnComic = false; } else { } if (TouchController.isSwiping == true) { isSwipping = true; } else { isSwipping = false; } if (isSwipping && !machineOpen) { CancelAllUI(false); } //print(HorizontalScrollSnap.CurrentPage); //change camera state to page number if (myCameraState == CameraState.Subway && !isSwipping) { CheckScreenNum(); Show(subwayBackground); } //if changing clothes, don't show some UIs if (myCameraState == CameraState.Map || myCameraState == CameraState.App || myCameraState == CameraState.Ad) { if (myCameraState == CameraState.App) { Hide(inventory); //Hide(basicUI); Show(appBackground); } else { Hide(inventory); //Hide(basicUI); Hide(appBackground); } } else if (myCameraState == CameraState.Closet) { Show(inventory); //Hide(basicUI); Hide(subwayBackground); Hide(appBackground); } else { Hide(inventory); //Show(basicUI); Hide(appBackground); } //如果没到达30fo if (chapterOneFail) { StartCoroutine(ChapterOneFailComic()); } }
public void GoToPage(int _index) { ScreenAnimal.GetComponent <AnimalView>().ShowPage(false); MenuObject.GoToScreen(_index); CheckCurrentPage(); }
// Update is called once per frame void Update() { // //set hint arrow visibility // if (showHintArrow) // { // Show(hintArrowCG); // } // else // { // Hide(hintArrowCG); // } //decide which dialogue should be shown on screen using the state machine // if(stopDisappear && tutorialNumber != 9 && tutorialNumber != 10 && tutorialNumber != 11 && tutorialNumber != 12) // { if (tutorialDialogueState == DialogueState.fish) { DialogueBubbleAC.SetBool("isOut", false); DoFishDialogue(true); DoKararaDialogue(false); } else if (tutorialDialogueState == DialogueState.karara) { DoFishDialogue(false); DoKararaDialogue(true); } else if (tutorialDialogueState == DialogueState.fishElse) { DialogueBubbleAC.SetBool("isOut", true); NameTagImage.enabled = false; DoFishDialogue(true); DoKararaDialogue(false); } else if (tutorialDialogueState == DialogueState.none) { DoFishDialogue(false); DoKararaDialogue(false); } else if (tutorialDialogueState == DialogueState.all) { DoFishDialogue(true); DoKararaDialogue(true); } // } //don't show fish dialogue if not in fish page if (FinalCameraController.myCameraState == FinalCameraController.CameraState.Subway) { if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.Two) { kararaDialogueRT.anchoredPosition = new Vector3(0, -570); kararaTextRT.localScale = new Vector3(2f, -2f, 2f); kararaDialogueRT.localScale = new Vector3(0.5f, -0.5f, 0.5f); } else if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.Four || FinalCameraController.mySubwayState == FinalCameraController.SubwayState.Three) { // if (tutorialNumber == 0) // { // kararaDialogueRT.anchoredPosition = leftPosition - new Vector2(100, 0); // // } // else { kararaDialogueRT.anchoredPosition = leftPosition;} kararaDialogueRT.anchoredPosition = leftPosition; kararaTextRT.localScale = new Vector3(2f, 2f, 2f); kararaDialogueRT.localScale = new Vector3(0.5f, 0.5f, 0.5f); } else if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.One || myHSS.CurrentPage == 1)//在第一个画面里永远出现鱼的对话框 { //tutorialDialogueState = DialogueState.fish;//always show fish dialogue in scene1 screamImage.enabled = false;//no noise image Hide(GestureCG); //karara dialogue position needs to be adjusted kararaDialogueRT.anchoredPosition = rightPosition; kararaTextRT.localScale = new Vector3(2f, 2f, 2f); kararaDialogueRT.localScale = new Vector3(0.5f, 0.5f, 0.5f); } else if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.None) { if (tutorialNumber == 0) { kararaDialogueRT.anchoredPosition = leftPosition; } } } else if (FinalCameraController.myCameraState == FinalCameraController.CameraState.Ad) { //exception is when taking photo in the beginning of the tutorial if (!pause) { tutorialDialogueState = DialogueState.none; } } else if (FinalCameraController.myCameraState == FinalCameraController.CameraState.Closet) { screamImage.enabled = false; //在换装界面set好位置 kararaDialogueRT.anchoredPosition = new Vector2(-80, 600); kararaTextRT.localScale = new Vector3(2f, 2f, 2f); kararaDialogueRT.localScale = new Vector3(0.5f, 0.5f, 0.5f); } if (nameTag.text == "Goldfish" || nameTag.text == "?????") { //print("goldfish"); if (FinalCameraController.mySubwayState != FinalCameraController.SubwayState.One) { //DialogueRT.anchoredPosition = lowerPosition; } else { //DialogueRT.anchoredPosition = higherPosition; } } else { //DialogueRT.anchoredPosition = higherPosition; } //make sure that karara only appears at the end and start when player is taught to swipe // if (tutorialNumber == 1 && FinalCameraController.myCameraState == FinalCameraController.CameraState.Subway) // { // if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.Four || // FinalCameraController.mySubwayState == FinalCameraController.SubwayState.One) // { // KararaImage.enabled = true; // } // else // { // KararaImage.enabled = false; // } // } //disable go back button when it is not needed if (tutorialNumber < 12) { gobackButton.SetActive(false); } if (tutorialNumber == 1) { Hide(arrowButton); } else if (tutorialNumber == 2) { if (clicktime == 7 && lastTextFinish && !temp2) { bag = Instantiate(clothBag, bagPos, Quaternion.identity) as GameObject; bag.transform.SetParent(clothBagGroup.transform, false); // arrow.enabled = false; Hide(arrowButton);//so the bag can be picked //show the arrow after the bag has been instantiated Show(hintArrowCG); hintArrow.transform.SetParent(bag.transform); hintArrow.GetComponent <RectTransform>().anchoredPosition = bagV; lastTextFinish = false; temp2 = true; } } else if (tutorialNumber == 3) { //stop moving // myHSS.GoToScreen(2); if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.Two) { scrollControl(false); print("number == 3, stop screen"); } if (clicktime == 7) { //包已经在洗衣机下面 tutorialDialogueState = DialogueState.fishElse; StartCoroutine(AnimateText(fishText, "Tap the bag! Put the clothes into the machine!", true, bag, bagV)); //now clicktime = 8; // fishText.text = "Click the bag! Put the cloth into the machine!"; } } else if (tutorialNumber == 4) { myHSS.GoToScreen(2); if (clicktime == 8) { //衣服已经进了洗衣机,还没开始洗 tutorialDialogueState = DialogueState.fishElse; StartCoroutine(AnimateText(fishText, "Tap the button to start!", true, startButton, machineV)); tutorialNumber = 5; FinalCameraController.mySubwayState = FinalCameraController.SubwayState.Two; } } else if (tutorialNumber == 6)//此时衣服开始洗 { myHSS.GoToScreen(2); tutorialDialogueState = DialogueState.none; Hide(hintArrowCG); //enable sitting Show(KararaSittingCanvasGroup); } else if (tutorialNumber == 8) { // myHSS.GoToScreen(2); //洗衣机洗好了之后自然出现了这个 if (clicktime == 9) { tutorialDialogueState = DialogueState.karara; StartCoroutine(AnimateText(kararaText, "Open Door", true, door, doorV));//clicktime == 10 } } //如果打开了门 else if (tutorialNumber == 9)//如果karara把门第一次打开了 { stopDisappear = false; if (clicktime == 10 && lastTextFinish) { if (!temp) { temp = true; StartCoroutine(FishCloseDoor()); } else { if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.One) { tutorialDialogueState = DialogueState.fishElse; // StartCoroutine(AnimateText(fishText, "What are you doing? Close the door!",false, null, Vector2.zero)); fishText.text = "What are you doing? Close the door!"; screamImage.enabled = false; Hide(arrowButton); tempn = false; } else if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.Two) { tempn = true; scrollControl(true); //出现鱼对话制止karara开门,karara对话框消失 tutorialDialogueState = DialogueState.karara; fishText.text = "What are you doing? Close the door!"; // StartCoroutine(AnimateText(kararaText, "Get cloth",true, ClothUI, clothV)); kararaText.text = "Get cloth"; screamImage.enabled = true; Hide(arrowButton); //show hint arrow Show(hintArrowCG); hintArrow.transform.SetParent(ClothUI.transform); hintArrow.GetComponent <RectTransform>().anchoredPosition = clothV; } else if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.None) { tutorialDialogueState = DialogueState.none; } } } } else if (tutorialNumber == 10)//如果karara把门关上了 { if (clicktime == 10) { tutorialDialogueState = DialogueState.karara; StartCoroutine(AnimateText(kararaText, "Open door", true, door, doorV)); //clicktime = 11 // fishText.text = "open door"; } if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.One) { tutorialDialogueState = DialogueState.fishElse; fishText.text = "Don't open the door!"; screamImage.enabled = false; Hide(arrowButton); } else if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.Two) { //出现鱼对话制止karara开门,karara对话框消失 tutorialDialogueState = DialogueState.karara; kararaText.text = "open door"; screamImage.enabled = true; Hide(arrowButton); //show hint arrow Show(hintArrowCG); hintArrow.transform.SetParent(door.transform); hintArrow.GetComponent <RectTransform>().anchoredPosition = doorV; } else if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.None) { tutorialDialogueState = DialogueState.none; } } else if (tutorialNumber == 11)//如果又把门打开了 { kararaText.text = "Get cloth"; if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.One) { tutorialDialogueState = DialogueState.fishElse; fishText.text = "Don't you dare touch your customer's cloth!"; screamImage.enabled = false; Hide(arrowButton); } else if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.Two) { //出现鱼对话制止karara开门,karara对话框消失 tutorialDialogueState = DialogueState.karara; screamImage.enabled = true; Hide(arrowButton); //show hint arrow Show(hintArrowCG); hintArrow.transform.SetParent(ClothUI.transform); hintArrow.GetComponent <RectTransform>().anchoredPosition = clothV; } else if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.None) { tutorialDialogueState = DialogueState.none; } } // else if(tutorialNumber == 12)//如果点了衣服 // { // if (clicktime == 12 || clicktime == 11) // { // StartCoroutine(AnimateText(kararaText, "One more", true, ClothUI, clothV)); //clicktime = 13 // } // } else if (tutorialNumber == 12)//如果点了第二件衣服 { clicktime = 14; // if (clicktime == 11|| clicktime == 12 || clicktime == 10) // { // StartCoroutine(AnimateText(kararaText, "Put on", true, closet, closetV)); //clicktime = 13 //// //箭头给到换衣界面的衣服UI //// Show(hintArrowCG); //// tutorialDialogueState = DialogueState.none; //// hintArrow.transform.SetParent(closet.transform f11); //// hintArrow.GetComponent<RectTransform>().anchoredPosition = closetV; // } if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.One) { tutorialDialogueState = DialogueState.fishElse; fishText.text = "Karara! Put that cloth back into the machine Now!"; screamImage.enabled = false; Hide(arrowButton); } else if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.Two) { //出现鱼对话制止karara开门,karara对话框消失 tutorialDialogueState = DialogueState.karara; screamImage.enabled = true; Hide(arrowButton); Show(closetCG); //show closet button // Show(closet.GetComponent<CanvasGroup>()); } else { tutorialDialogueState = DialogueState.none; } } else if (tutorialNumber == 13) { //点进了换衣服的界面 // kararaText.text = "Disco"; //箭头给到换衣界面的衣服UI Show(hintArrowCG); //新方式给箭头,有两个箭头,其中一个专门给closet Show(hintArrowInventory); tutorialDialogueState = DialogueState.none; hintArrow.transform.SetParent(Inventory.transform); hintArrow.GetComponent <RectTransform>().anchoredPosition = inventoryV; } else if (tutorialNumber == 14 && clicktime == 14)//穿上disco衣服 { // kararaText.text = "Cool"; Hide(hintArrowInventory); StartCoroutine(AnimateText(kararaText, "Cool", true, Inventory, subwayV)); //clicktime = 15 tutorialDialogueState = DialogueState.karara; // arrow.enabled = true; Hide(arrowButton); } else if (tutorialNumber == 15)//回到地铁scene { // kararaText.text = "Poster"; if (clicktime == 15) { FinalCameraController.DisableInput(true); StartCoroutine(AnimateText(kararaText, "Disco", true, poster, posterV)); //clicktime = 16 myHSS.GoToScreen(4); Hide(arrowButton); Hide(KararaSittingCanvasGroup); KararaStandingImage.enabled = true; KararaStandingImage.sprite = KararaDisco; //show karara KararaStanding.transform.SetParent(ScreenFour.transform); KararaRectT.anchoredPosition = new Vector3(-72, KararaRectT.anchoredPosition.y); // var RectTransform = KararaStanding.GetComponent<RectTransform>(); // RectTransform.anchoredPosition = new Vector3(85, RectTransform.anchoredPosition.y); KararaStandingImage.enabled = true; KararaDisappear(false); } else if (clicktime == 16) { if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.Four) { scrollControl(false); FinalCameraController.DisableInput(false); } } //disable swipping screen } else if (tutorialNumber == 16)//从海报出来 { if (clicktime == 16) { scrollControl(true); //show karara KararaRectT.anchoredPosition = new Vector3(85, KararaRectT.anchoredPosition.y); KararaStanding.transform.SetParent(ScreenZero.transform); var RectTransform = KararaStanding.GetComponent <RectTransform>(); RectTransform.anchoredPosition = new Vector3(85, RectTransform.anchoredPosition.y); KararaStandingImage.enabled = true; KararaDisappear(false); //fish talking tutorialDialogueState = DialogueState.fish; // fishText.text = "What are you doing with your customer's clothes?"; StartCoroutine(AnimateText(fishText, "What are you doing with your customer's clothes?", false, null, Vector2.zero)); //clicktime = 17 nameTag.text = "GoldFish"; //clicktime = 17 Show(arrowButton); } else if (clicktime == 18 && FinalCameraController.mySubwayState == FinalCameraController.SubwayState.Two) { StartCoroutine(AnimateText(fishText, "Tap the bag to return it!", true, door, bagdoorV)); //clicktime = 19 scrollControl(false); } } else if (tutorialNumber == 17) { //还好包了 KararaStandingImage.sprite = KararaWorkCloth; // myHSS.GoToScreen(1); if (clicktime == 19) { Hide(hintArrowCG); print("clicktime = 19, tutorialNumber = 17"); //如果转到第一个页面,那么鱼老板讲话 if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.One) { tutorialDialogueState = DialogueState.fish; scrollControl(false); // fishText.text = "Lucky you! All clothes are automatically returned!"; StartCoroutine(AnimateText(fishText, "Lucky you! All clothes are automatically returned!", false, null, Vector2.zero)); //clicktime = 20 screamImage.enabled = false; Show(arrowButton); } else { screamImage.enabled = true; tutorialDialogueState = DialogueState.none; } } } //only show Karara when she's in the subway scene if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.One || FinalCameraController.mySubwayState == FinalCameraController.SubwayState.Two || FinalCameraController.mySubwayState == FinalCameraController.SubwayState.Three || FinalCameraController.mySubwayState == FinalCameraController.SubwayState.Four || FinalCameraController.mySubwayState == FinalCameraController.SubwayState.None ) { } else { Hide(KararaSittingCanvasGroup); KararaStandingImage.enabled = false; } //take a photo scene if (FinalCameraController.myCameraState == FinalCameraController.CameraState.Ad) { // touchImage.enabled = true; // // touch.transform.position = TakeScreenshot.transform.position; } //if the player has already pressed screenshot button //only need to do this once? if (pressScreenshot) { pause = true; if (tutorialNumber == 0) { // StartCoroutine(FishCallout()); //pressScreenshot = false; if (temp) { FinalCameraController.ChangeToSubway(); DialogueRT.anchoredPosition -= new Vector2(0, 300); temp = false; tutorialDialogueState = DialogueState.fish; //clicktime = 1 StartCoroutine(AnimateText(fishText, "Hey you! Over here!", false, null, new Vector2(0, 0))); } print("pressscreenshot is true, should go a lot of times"); //this is specifically for the taking picture process, some images should be cancelled screamImage.enabled = true; NameTagImage.enabled = false; //fishText.text = "Hey you! Over here!"; //scrollControl(true);//enable player to swipe // arrow.enabled = false; // clicktime = 1; backToSubway = true; Show(arrowButton); } else if (tutorialNumber > 12) { DoFishDialogue(false); fishText.text = ""; nameTag.text = ""; myFlash.alpha = myFlash.alpha - Time.deltaTime; if (myFlash.alpha <= 0) { myFlash.alpha = 0; pressScreenshot = false; KararaDisappear(false); } } } if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.None && tutorialNumber == 1) { //show karara KararaRectT.anchoredPosition = new Vector3(205, KararaRectT.anchoredPosition.y); KararaStanding.transform.SetParent(ScreenZero.transform); var RectTransform = KararaStanding.GetComponent <RectTransform>(); RectTransform.anchoredPosition = new Vector3(85, RectTransform.anchoredPosition.y); KararaStandingImage.enabled = true; KararaDisappear(false); Hide(arrowButton); } else if (FinalCameraController.mySubwayState == FinalCameraController.SubwayState.One && tutorialNumber == 1) { //don't let the dialogue disappear if swipe stopDisappear = true; //show fish dialogue tutorialDialogueState = DialogueState.fish; StartCoroutine(AnimateText(fishText, "Karara! You're finally here!", false, null, Vector2.zero));//结束之后clicktime = 3 // arrow.enabled = true; //enable click the screen Show(arrowButton); Hide(GestureCG); tutorialNumber = 2; ChangeDialogue("Goldfish"); } }
private void btnTrocarPainel(int indexPainel) { HorizontalScrollSnap.GoToScreen(indexPainel); }