public void clickBackground() { InstagramController.currentBackground = gameObject.name; //reset everything to the first posture being able to use in this background if (FinalCameraController.alreadyClothUI == false) { if (FinalCameraController.isSwipping == false && !FinalCameraController.isTutorial) { InstagramController.CalculateInventory.resetPosture(); FinalCameraController.CancelAllUI(false); photoBackground.sprite = InstagramController.allBackAd[transform.name]; InstagramController.currentBackground = transform.name; FinalCameraController.GoAdvertisement(); } else if (FinalCameraController.isSwipping == false && FinalCameraController.isTutorial) { // if (InstagramController.AdAlreadyTakenList[transform.name]) // { if (FinalCameraController.TutorialManager.tutorialNumber == 0) { //cancel dialogues and the touch tutorial //TutorialManager.tutorialDialogueState = TutorialManager.DialogueState.none; FinalCameraController.Show(TutorialManager.hintArrowCG); TutorialManager.hintArrow.transform.SetParent(TutorialManager.screenshot.transform); TutorialManager.hintArrow.GetComponent <RectTransform>().anchoredPosition = new Vector2(-0.5f, 0f); photoBackground.sprite = InstagramController.allBackAd[transform.name]; InstagramController.currentBackground = transform.name; FinalCameraController.GoAdvertisement(); } else if (FinalCameraController.TutorialManager.tutorialNumber == 2 || FinalCameraController.TutorialManager.tutorialNumber == 3) { TutorialManager.fishText.text = "Don't touch it! Come over here!"; TutorialManager.KararaStandingImage.enabled = true; } else if (FinalCameraController.TutorialManager.tutorialNumber == 15) { print("transform name = " + transform.name); photoBackground.sprite = InstagramController.allBackAd[transform.name]; InstagramController.currentBackground = transform.name; FinalCameraController.GoAdvertisement(); } // } } } else { Destroy(FinalCameraController.generatedNotice); Destroy(FinalCameraController.currentClothUI); FinalCameraController.alreadyClothUI = false; } }
public void BossTalk() { //根据不同时间boss说话内容会变 FinalCameraController.CancelAllUI(false); if (isfishTalking == false) { Show(InstagramController.FishBoss); isfishTalking = true; } else { Hide(InstagramController.FishBoss); isfishTalking = false; } }
public void clickMachine() { FinalCameraController.CancelAllUI(true); //print("presssssssed"); if (shut == 0) { shut = 1; StartCoroutine(MachineUnfold()); } else if (shut == 1) { shut = 0; StartCoroutine(MachineFold()); } }
public void clickMachine() { FinalCameraController.machineOpen = true; FinalCameraController.CancelAllUI(true); print("presssssssed"); if (shut == 0) { shut = 1; StartCoroutine(MachineUnfold()); //change door sprite to open DoorImage.sprite = AllMachines.openedDoor; Hide(Occupied); //ClothUiAnimator.SetBool("isUnfold",true); // StartCoroutine("WaitFor2Seconds"); } //if click machine again, close UI else if (shut == 1) { shut = 0; Hide(ClothUI); StartCoroutine(MachineFold()); //ClothUiAnimator.SetBool("isUnfold",false); //change door to closed sprite DoorImage.sprite = AllMachines.closedDoor; Show(Occupied); //如果是通过点洗衣机关门的话,展示karara头上的两个对话框 //show message and closet UI // if(!FinalCameraController.isTutorial) // { // Show(FinalCameraController.clothCG); // Show(FinalCameraController.messageCG); // FinalCameraController.isShown = true; // } } }
public void putClothIn() { FinalCameraController.CancelAllUI(false); if (FinalCameraController.isSwipping) { return; } if (hitTime == 0) { //没有洗衣机就不动啥反应都没有 underMachineNum = AllMachines.FindSuitableMachine(AllMachines.MachineState.empty); if (underMachineNum < 0) { return; } AudioManager.AdjustPitch(AudioType.Bag_Phase1, 0.5f); AudioManager.PlayAudio(AudioType.Bag_Phase1); SubwayMovement.bagNum -= 1; AllMachines.SetMachineAsBagUnder(underMachineNum, owner.name, clothesInBag); //this.gameObject.transform.SetParent(AllMachines.FakeMachines[underMachineNum].gameObject.transform);// @@@ transform.localPosition = SubwayMovement.bagPos[underMachineNum + 3]; // @@@ if (underMachineNum == 0) { cameraMovement.Go2Page(2); } else { cameraMovement.Go2Page(3); } SubwayMovement.bagPosAvailable[myBagPosition] = false; hitTime++; } else if (hitTime == 1) { //Debug.Log("second bag hit "); myAudio.pitch = 0.6f; AudioManager.AdjustPitch(AudioType.Bag_Phase1, 0.6f); //myAudio.Play(); AudioManager.PlayAudio(AudioType.Bag_Phase1); myImage.sprite = SpriteLoader.NPCDic[this.tag].openBag; secondImage.sprite = SpriteLoader.NPCDic[this.tag].openBag; if (timeUp) { StartCoroutine(FinalCameraController.FishBossNotification.ShowFish()); } //FinalCameraController.FishBossNotification.ShowFish(); //test AllMachines.SetMachineAsFull(underMachineNum); hitTime++; } //return clothes else if (hitTime > 1) { AudioManager.PlayAudio(AudioType.Bag_Phase1); isFinished = AllMachines.FinishedOrNot(underMachineNum); if (isFinished && !FinalCameraController.alreadyNotice) { if (underMachineNum == 1) { BagsController.ShowReturnNotice(thisBag, true); } else { BagsController.ShowReturnNotice(thisBag, false); } } hitTime++; } }
public IEnumerator trainPause() { float normalSpeed = 0.3f; FinalCameraController.CancelAllUI(false); FinalCameraController.enableScroll = false; Banner.SetActive(false); pauseBeforeMove = true; if (FinalCameraController.alreadyNotice) { BagsController.HideNotice(); } Show(FinalCameraController.disableInputCG); BlackScreen.SetActive(true); FinalCameraController.ChangeToSubway(); FinalCameraController.CameraMovement.JumpToPage(4); yield return(new WaitForSeconds(1f)); BlackScreen.SetActive(false); yield return(new WaitForSeconds(0.5f)); if (LevelManager.UIRateShown && LostAndFound.totalCount > 0) { StartCoroutine(LostAndFound.AnimationDropNUm()); yield return(new WaitForSeconds(1f)); } else { AdsController.UpdatePosters(); yield return(new WaitForSeconds(1f)); } FinalCameraController.ChangeCameraSpeed(normalSpeed * 0.5f); if (!LevelManager.FishReturnBagShown) { FinalCameraController.GotoPage(3); if (CountBagInMachine(2)) { yield break; } yield return(new WaitForSeconds(0.5f)); FinalCameraController.GotoPage(2); if (CountBagInMachine(1)) { yield break; } if (CountBagInMachine(0)) { yield break; } } StartCoroutine(TrainPauseResume()); }
public void putClothIn() { if (!FinalCameraController.isTutorial) { FinalCameraController.LevelManager.isInstruction = false; } FinalCameraController.CancelAllUI(false); if (FinalCameraController.isSwipping == false) { if (hitTime == 0) { myAudio.pitch = 0.5f; myAudio.Play(); //for tutorial if (FinalCameraController.isTutorial) { WasherControllerList[0].myMachineState = AllMachines.MachineState.bagUnder; //change machine tags to character WasherControllerList[0].transform.gameObject.tag = this.transform.gameObject.tag; this.gameObject.transform.SetParent(WasherControllerList[0].gameObject.transform); transform.position = AllMachines.WashingMachines[0].transform.position + new Vector3(0, -2.5f, 0); FinalCameraController.TutorialManager.scrollControl(true); myHSS.GetComponent <HorizontalScrollSnap>().GoToScreen(2); FinalCameraController.TutorialManager.KararaStandingImage.enabled = false; FinalCameraController.TutorialManager.tutorialNumber = 3; FinalCameraController.TutorialManager.stopDisappear = false; hitTime++; } else { SubwayMovement.bagNum -= 1; for (int i = 0; i < AllMachines.WashingMachines.Count; i++) { //get machine start washing if (WasherControllerList[i].myMachineState == AllMachines.MachineState.empty) { WasherControllerList[i].myMachineState = AllMachines.MachineState.bagUnder; //change machine tags to character WasherControllerList[i].transform.gameObject.tag = this.transform.gameObject.tag; this.gameObject.transform.SetParent(WasherControllerList[i].gameObject.transform); transform.position = AllMachines.WashingMachines[i].transform.position + new Vector3(0, -2.7f, 0); if (i == 0) { myHSS.GetComponent <HorizontalScrollSnap>().GoToScreen(2); } else { myHSS.GetComponent <HorizontalScrollSnap>().GoToScreen(3); } //change the bag position to be empty again SubwayMovement.bagPosAvailable[myBagPosition] = false; hitTime++; break; } } } } else if (hitTime == 1) { myAudio.pitch = 0.6f; myAudio.Play(); //点第二次换成打开的包 print("tag = " + tag); myImage.sprite = AllMachines.openBagsDic[this.tag]; //in tutorial if (FinalCameraController.isTutorial) { FinalCameraController.TutorialManager.tutorialNumber = 4; // FinalCameraController.TutorialManager.bag.GetComponent<Image>().material.DisableKeyword("SHAKEUV_ON"); } for (int i = 0; i < AllMachines.WashingMachines.Count; i++) { //get machine start washing if (WasherControllerList[i].myMachineState == AllMachines.MachineState.bagUnder) { if (WasherControllerList[i].transform.CompareTag(this.transform.gameObject.tag)) { WasherControllerList[i].myMachineState = AllMachines.MachineState.full; // //change machine tags to character // WasherControllerList[i].transform.gameObject.tag = this.transform.gameObject.tag; hitTime++; break; } } } } //return clothes else if (hitTime > 1) { // else // { //get the machine with clothes from this bag for (int i = 0; i < AllMachines.WashingMachines.Count; i++) { if (WasherControllerList[i].CompareTag(this.transform.gameObject.tag)) { if (WasherControllerList[i].myMachineState == AllMachines.MachineState.finished) { //WasherControllerList[i].myMachineState = AllMachines.MachineState.empty; if (FinalCameraController.alreadyNotice == false) { AllMachines.currentBag = this.gameObject; //currentbag 是指产生了notice的这个包 print("returnClothhhhhh"); if (FinalCameraController.isTutorial) { if (FinalCameraController.TutorialManager.tutorialNumber == 16) { // FinalCameraController.DisableInput(true); FinalCameraController.TutorialManager.scrollControl(false); //then return all clothes in the machine FinalCameraController.generatedNotice = Instantiate(AllMachines.returnNotice, new Vector3(0, 0, 0), Quaternion.identity, WasherControllerList[i].gameObject.transform); FinalCameraController.generatedNotice.tag = this.tag; FinalCameraController.generatedNotice.transform.SetParent(WasherControllerList[2].gameObject.transform); //change karara back into work cloth FinalCameraController.alreadyNotice = true; } else if (FinalCameraController.TutorialManager.tutorialNumber == 9) { FinalCameraController.TutorialManager.chooseBag = true; FinalCameraController.TutorialManager.clicktime = 7; } } else { //generate the notice FinalCameraController.generatedNotice = Instantiate(AllMachines.returnNotice, new Vector3(0, 0, 0), Quaternion.identity, WasherControllerList[i].gameObject.transform); FinalCameraController.generatedNotice.tag = this.tag; FinalCameraController.alreadyNotice = true; if (i == 1) { FinalCameraController.generatedNotice.transform.SetParent(WasherControllerList[2].gameObject.transform); } else { FinalCameraController.generatedNotice.transform.SetParent(WasherControllerList[i].gameObject.transform); } } } //print("AllMachines.currentBag.tag = " + AllMachines.currentBag.tag); hitTime++; break; } } } // } } } }