void OnGUIRotoCoinsPressed(object sender, InstantMessageArgs args) { GlobalManager.MInstantMessage.DeliverMessage( InstantMessageType.GUIShowHint, this, new HintRequest { type = HintType.WorldCoinsScoreTapped, target = null } ); }
void OnFinaleTextPostDelayed(object sender, InstantMessageArgs args) { int i = IndexByValue((int)args.arg); if (i >= finaleTextIndexes.Length - 1) { GlobalManager.MStorage.FinaleShown = true; // reset text positions GlobalManager.MInstantMessage.DeliverMessage(InstantMessageType.FinaleRollText, this, 0); // reset text index GlobalManager.MInstantMessage.DeliverMessage(InstantMessageType.FinaleRollText, this, finaleTextIndexes[0]); } }
void OnGUIRotoChipsPressed(object sender, InstantMessageArgs args) { // this hint is shown every time the RotoChips panel is tapped GlobalManager.MInstantMessage.DeliverMessage( InstantMessageType.GUIShowHint, this, new HintRequest { type = HintType.PuzzlePointScoreTapped, target = null } ); }
void OnGUIWhiteCurtainFaded(object sender, InstantMessageArgs args) { bool up = (bool)args.arg; if (up) { // exit SceneManager.LoadScene(worldScene); } else { // start the text rolls GlobalManager.MInstantMessage.DeliverMessage(InstantMessageType.FinaleRollText, this, finaleTextIndexes[0]); } }
void OnGUIWhiteCurtainFaded(object sender, InstantMessageArgs args) { bool up = (bool)args.arg; //Debug.Log("White cirtain faded up: " + up.ToString()); if (up) { GlobalManager.MStorage.IntroShown = true; SceneManager.LoadScene(worldScene); } else { StartCoroutine(SwitchMessageDelayed()); } }
void OnPuzzleButtonPressed(object sender, InstantMessageArgs args) { if (!puzzleBusy) { GlobalManager.MInstantMessage.DeliverMessage(InstantMessageType.PuzzleBusy, this, true); Vector2Int buttonId = (Vector2Int)args.arg; PuzzleButtonController.PuzzleButtonArgs buttonArgs = new PuzzleButtonController.PuzzleButtonArgs { id = buttonId, fast = 1 }; RotateButton(buttonArgs); StartCoroutine(WaitForButtonPress()); } }
void OnGUIRestartButtonPressed(object sender, InstantMessageArgs args) { if (!puzzleBusy) { if (!GlobalManager.MHint.ShowNewHint(HintType.AskForRestartButton)) { GlobalManager.MInstantMessage.DeliverMessage(InstantMessageType.PuzzleBusy, this, true); dialogMode = DialogOKCancelMode.Reset; GlobalManager.MInstantMessage.DeliverMessage( InstantMessageType.GUIStartDialogOKCancel, this, GlobalManager.MLanguage.Entry(restartlevelQuestionId) ); } } }
void OnGUIRestartButtonPressed(object sender, InstantMessageArgs args) { if (!GlobalManager.MHint.ShowNewHint(HintType.GameRestartButton)) { if (!GlobalManager.MHint.ShowNewHint(HintType.GameRestartButton)) { dialogMode = true; GlobalManager.MInstantMessage.DeliverMessage(InstantMessageType.WorldRotationEnable, this, false); GlobalManager.MInstantMessage.DeliverMessage( InstantMessageType.GUIStartDialogOKCancel, this, GlobalManager.MLanguage.Entry(restartGameQuestion) ); } } }
// message handling void OnPuzzleShowWinimage(object sender, InstantMessageArgs args) { string title = (string)args.arg; if (title == null) { gameObject.SetActive(false); } else { gameObject.SetActive(true); StopFlash(); Initialize(); StartFlash(); } }
void OnGUIFadeWhiteCurtain(object sender, InstantMessageArgs args) { bool where = true; if (args.arg != null) { where = (bool)args.arg; } if (where && fadeOut) { Fade(true); } else if (!where && fadeIn) { Fade(false); } }
// message handling void OnFinaleRollText(object sender, InstantMessageArgs args) { int textToRoll = (int)args.arg; if (textToRoll == 0) { // zero is a special value; it means to reset the text to its original position ResetToOriginal(); } else { if (textToRoll == finaleTextIndex) { StartCoroutine(RollText()); } } }
// message handling void OnGUIShowHint(object sender, InstantMessageArgs args) { if (!gameObject.activeInHierarchy) { HintRequest hintRequest = (HintRequest)args.arg; if (hintRequest != null) { hintParams = GlobalManager.MHint.Hints[hintRequest.type]; hintParams.target = hintRequest.target; SetHintLayout(); } else { GlobalManager.MInstantMessage.DeliverMessage(InstantMessageType.GUIHintClosed, this, hintRequest); } } }
void OnPuzzleTileFlashed(object sender, InstantMessageArgs args) { if (puzzleComplete && startVictoryScreen) { startVictoryScreen = false; PuzzleCompleteStatus completeStatus = new PuzzleCompleteStatus { descriptor = descriptor, firstTime = !descriptor.state.Complete }; // ok, the puzzle is complete, the player has won /**/ //descriptor.state.Complete = true; /**/ GlobalManager.MInstantMessage.DeliverMessage(InstantMessageType.PuzzleComplete, this, completeStatus); } }
void OnWorldSelectorPressed(object sender, InstantMessageArgs args) { GameObject targetObject = ((Component)sender).gameObject; if (cameraController.Zoom != WorldCameraController.ZoomStatus.ZoomAtMin) { RotateWorldToZero(targetObject); } else { LevelDataManager.Descriptor descriptor = (LevelDataManager.Descriptor)args.arg; if (descriptor.state.Playable) { if (descriptor.state.Complete) { // show a description of the complete level GlobalManager.MAudio.PlaySFX(levelDescriptionSFX); GlobalManager.MInstantMessage.DeliverMessage(InstantMessageType.WorldRotationEnable, this, false); GlobalManager.MInstantMessage.DeliverMessage(InstantMessageType.WorldShowLevelDescription, this, descriptor); } else { // start level GlobalManager.MAudio.PlaySFX(startLevelSFX); GlobalManager.MStorage.SelectedLevel = descriptor.init.id; //GlobalManager.MStorage.GalleryLevel = descriptor.init.id; StartCoroutine(YieldToScene(targetObject, puzzleScene)); } } else { // show hint message GlobalManager.MAudio.PlaySFX(noLevelSFX); GlobalManager.MInstantMessage.DeliverMessage( InstantMessageType.GUIShowHint, this, new HintRequest { type = HintType.LevelNotYetPlayable, target = null } ); } } }
void OnGUIWhiteCurtainFaded(object sender, InstantMessageArgs args) { bool up = (bool)args.arg; if (up) { switch (exitMode) { case ExitMode.World: SceneManager.LoadScene(worldScene); break; case ExitMode.Finale: SceneManager.LoadScene(finaleScene); break; } } }
// message handling void OnPuzzleShowWinimage(object sender, InstantMessageArgs args) { string title = (string)args.arg; if (title != null) { gameObject.SetActive(true); if (currentCoroutine != null) { StopCoroutine(currentCoroutine); } currentCoroutine = StartCoroutine(Painter()); } else { gameObject.SetActive(false); } }
// InstantMessage handler void OnWhiteCurtainFaded(object sender, InstantMessageArgs args) { bool up = (bool)args.arg; if (up) { if (GlobalManager.MStorage.IntroShown) { if (!string.IsNullOrEmpty(worldScene)) { SceneManager.LoadScene(worldScene); } } else { if (!string.IsNullOrEmpty(introScene)) { SceneManager.LoadScene(introScene); } } } }
void OnGUIConfigureAppearance(object sender, InstantMessageArgs args) { GUIConfiguration configuration = (GUIConfiguration)args.arg; if (configuration != null) { if (restartButton != null) { restartButton.SetActive(configuration.restartButton); } if (viewButton != null) { viewButton.SetActive(configuration.viewButton); } if (backButton != null) { backButton.SetActive(configuration.backButton); } if (magicButton != null) { magicButton.SetActive(configuration.magicButon); } if (cupButton != null) { cupButton.SetActive(configuration.cupButton); } if (rotochipsPanel != null) { rotochipsPanel.SetActive(configuration.rotochipsPanel); } if (rotocoinsPanel != null) { rotocoinsPanel.SetActive(configuration.rotocoinsPanel); } } }
void OnGUIWhiteCurtainFaded(object sender, InstantMessageArgs args) { bool up = (bool)args.arg; if (up) { // faded out, end the scene switch (exitMode) { case Exitmode.World: SceneManager.LoadScene(worldScene); break; case Exitmode.Victory: GlobalManager.MAudio.PlayMusicTrack(AudioTrackEnum.Unknown); SceneManager.LoadScene(victoryScene); break; case Exitmode.Shop: SceneManager.LoadScene(shopScene); break; } } }
void OnWorldLevelDescriptionClosed(object sender, InstantMessageArgs args) { GlobalManager.MInstantMessage.DeliverMessage(InstantMessageType.WorldRotationEnable, this, true); }
void OnWorldSatellitePressed(object sender, InstantMessageArgs args) { GameObject targetObject = ((Component)sender).gameObject; StartCoroutine(YieldToScene(targetObject, galleryScene)); }
void OnGUIShowHint(object sender, InstantMessageArgs args) { GlobalManager.MInstantMessage.DeliverMessage(InstantMessageType.WorldRotationEnable, this, false); }
void OnWorldGlobePressed(object sender, InstantMessageArgs args) { GlobalManager.MInstantMessage.DeliverMessage(InstantMessageType.WorldAutoZoomCamera, this); }
void OnWorldRotatedToObject(object sender, InstantMessageArgs args) { worldRotated = true; GlobalManager.MInstantMessage.DeliverMessage(InstantMessageType.WorldRotationEnable, this, true); }
// message handling void OnWorldCameraZoomedAtMin(object sender, InstantMessageArgs args) { cameraZoomed = true; }
protected override decimal SourceValue(InstantMessageArgs args) { return((decimal)args.arg); //return (decimal)GlobalManager.MStorage.TotalPoints; }
// message handling void OnPuzzleSetVictoryTitle(object sender, InstantMessageArgs args) { newTitle = (string)args.arg; StartFlash(false); }
void OnAdvertisementResult(object sender, InstantMessageArgs args) { GlobalManager.MInstantMessage.DeliverMessage(InstantMessageType.WorldBlockScreen, this, false); }
// message handling void OnWorldRotationEnable(object sender, InstantMessageArgs args) { EnableRotation((bool)args.arg); }
void OnGUIWhiteCurtainFaded(object sender, InstantMessageArgs args) { curtainFaded = true; }