public void BeginMission() { // must be called after pausegame.beginplay() #if FULLLOG MoreDebug.Log("go: " + gameObject.name); #endif if (!PauseGame.exists) { #if FULLLOG MoreDebug.Log("No PauseGame -----"); #endif } if (InfoPriority >= operation.MissionTerseness) { MessageBoxParams parms = new MessageBoxParams(); parms.Message = StartingInfo; parms.MessageBoxTitle = MissionTitle; parms.Button1Action = PauseGame.only.queueResume; parms.MultipleCallBehaviour = MultipleCallBehaviours.Queue; EasyMessageBox.Show(parms); PauseGame.only.queuePause(); } // reset the goal state currentState = initialState; isActive = true; CurrentLevel = Registry.only.GetObject <LevelManager> ().MapOverlayName; operation.StartMission(); // set flags BeginEvent.Invoke(); }
void SucceedMission() { #if FULLLOG MoreDebug.Log("go: " + gameObject.name); #endif if (!isActive) { return; } #if FULLLOG MoreDebug.Log("real."); #endif if (!PauseGame.exists) { #if FULLLOG MoreDebug.Log("No PauseGame -----"); #endif } if (InfoPriority > operation.MissionTerseness) { MessageBoxParams parms = new MessageBoxParams(); parms.Message = SuccessInfo; parms.MessageBoxTitle = MissionTitle; parms.Button1Action = PauseGame.only.queueResume; parms.MultipleCallBehaviour = MultipleCallBehaviours.Queue; EasyMessageBox.Show(parms); PauseGame.only.queuePause(); } currentState = GoalManager.GoalState.realwin; SuccessEvent.Invoke(); operation.WinMission(); isActive = false; //Reset (); }
private IEnumerator ShowOperationStatus() { #if FULLLOG MoreDebug.Log("."); #endif yield return(new WaitForSeconds(2)); if (!PauseGame.exists) { #if FULLLOG MoreDebug.Log("No PauseGame -----"); #endif } string sceneresult = "There are " + Missions.Length + "(" + missioncount.MaximumCount + ") missions " + newline + "Actual wins: " + missioncount.GroupCount[1] + newline + "Actual losses: " + missioncount.GroupCount[0]; MessageBoxParams parms = new MessageBoxParams(); parms.Message = sceneresult; parms.MessageBoxTitle = "Operation is Ended"; parms.Button1Action = PauseGame.only.queueResume; parms.MultipleCallBehaviour = MultipleCallBehaviours.Queue; EasyMessageBox.Show(parms); PauseGame.only.queuePause(); }
private void LoseOperation() { #if FULLLOG MoreDebug.Log("qaa go: " + gameObject.name); #endif if (!PauseGame.exists) { #if FULLLOG MoreDebug.Log("No PauseGame -----"); #endif } if (InfoPriority > CampaignManager.campaign.OperationTerseness) { MessageBoxParams parms = new MessageBoxParams(); parms.Message = FailureInfo; parms.MessageBoxTitle = oname; parms.Button1Action = PauseGame.only.queueResume; parms.MultipleCallBehaviour = MultipleCallBehaviours.Queue; EasyMessageBox.Show(parms); PauseGame.only.queuePause(); } OnLoseOperation.Invoke(); level.LoseAnOperation(); // Remember winning the operation does not win the level or (necessarily) end the operation if (ForceLevelLose) { EndOperation(); level.LoseLevel(); } }
public void OnButtonClick_MultiCallNewInstance() { for (int i = 0; i < 3; i++) { EasyMessageBox.Show("This is message box #" + (i + 1).ToString(), dragType: DragTypes.TitleAndMessage); } }
private void StartCampaign() { // Called when enabled // todo: can we just put this in OnEnable() ? #if FULLLOG MoreDebug.Log("go: " + gameObject.name); #endif // announce the start of the campaign PauseGame.only.beginPlay(); OnBeginCampaign.Invoke(); // show the campaign start screen if (!PauseGame.exists) { #if FULLLOG MoreDebug.Log("No PauseGame -----"); #endif } MessageBoxParams parms = new MessageBoxParams(); parms.Message = StartingInfo; parms.MessageBoxTitle = CampaignName; parms.Button1Action = PauseGame.only.queueResume; parms.MultipleCallBehaviour = MultipleCallBehaviours.Queue; EasyMessageBox.Show(parms); PauseGame.only.queuePause(); // load the first level currentLevel = 0; LoadLevel(currentLevel); }
public void OnButton_RateUs() { EasyMessageBox.Show("Like the game? Please consider rating us!", button1Text: "Rate Now", button2Text: "Maybe Later", button3Text: "Neve Show Again", inAnimation: InAnimationTypes.Spin, templateId: 4); }
public void OnButtonClick_ShowIcons() { EasyMessageBox.Show("Buy more ammo?", button1Icon: yesIcon, button1Text: "$0.99", button2Icon: noIcon, button2Text: "Cancel", messageIcon: mainIcon); }
public void OnButtonClick_MultiCallQueue() { for (int i = 0; i < 3; i++) { EasyMessageBox.Show("This is message box #" + (i + 1).ToString(), multipleCallBehaviour: MultipleCallBehaviours.Queue); } }
public void OnButton_Achievement() { EasyMessageBox.Show("You have reached level 5! Please claim your reward.", messageTitle: "Novice", messageIcon: flowerIcon, button1Icon: cashIcon, button1Text: "10", templateId: 2, inAnimation: InAnimationTypes.Stamp, button1Action: () => { Debug.Log("You got 10 diamonds."); }, multipleCallBehaviour: MultipleCallBehaviours.Queue); EasyMessageBox.Show("You have reached level 100! Please claim your reward.", messageTitle: "Expert", messageIcon: lanternIcon, button1Icon: cashIcon, button1Text: "1000", templateId: 2, inAnimation: InAnimationTypes.Stamp, button1Action: () => { Debug.Log("You got 1000 diamonds."); }, multipleCallBehaviour: MultipleCallBehaviours.Queue); }
public void OnButton_GetItem() { EasyMessageBox.Show("A magical lantern.", messageTitle: "Lantern", layout: MessageLayout.Vertical, messageBoxTitle: "You got a new item", messageIcon: lanternIcon, button1Text: "Keep", button2Text: "Discard", templateId: 3, multipleCallBehaviour: MultipleCallBehaviours.Queue); EasyMessageBox.Show("A lovely flower.", messageTitle: "Flower", layout: MessageLayout.Vertical, messageBoxTitle: "You got a new item", messageIcon: flowerIcon, button1Text: "Keep", button2Text: "Discard", templateId: 3, multipleCallBehaviour: MultipleCallBehaviours.Queue); }
public void OnButtonClick_Inputfield() { EasyMessageBox.Show("", button2Text: "Cancel", inputField1Label: "User Name", inputField2Label: "Password", inputFieldAction: (x1, x2) => { EasyMessageBox.Show("User name: " + x1 + " Password: "******"Remember Me", messageBoxTitle: "Login"); }
void OnToggleSet(bool isOn) { if (isOn) { EasyMessageBox.Show("Checked!"); } else { EasyMessageBox.Show("Unchecked!"); } }
void Start() { #if FULLLOG MoreDebug.Log(MoreDebug.splatRow); #endif RegisterSelf(); InitialScene = SceneManager.GetActiveScene().name; EasyMessageBox.Show(StartingInfo, messageBoxTitle: DefaultHeader, button1Action: () => { BeginMenus(); }, multipleCallBehaviour: MultipleCallBehaviours.Queue); }
public void quitlevel() { // quit the level after confirming hideall(); MessageBoxParams param = new MessageBoxParams(); param.Message = "Do you really want to end this level?"; param.Button1Text = "Yes"; param.Button1Action = QuitClean.only.FailScene; param.Button2Text = "No"; param.Button2Action = showpause; EasyMessageBox.Show(param); }
public void quit() { // quit the game after confirming hideall(); MessageBoxParams param = new MessageBoxParams(); param.Message = "Do you really want to stop the game now?"; param.Button1Text = "Yes"; param.Button1Action = QuitClean.QuitGame; param.Button2Text = "No"; param.Button2Action = showmain; EasyMessageBox.Show(param); }
public void OnButtonClick_Toggle() { EasyMessageBox.Show("Click the toggle.", toggleText: "Don't show next time", toggleAction: (x) => { if (x) { EasyMessageBox.Show("Checked."); } else { EasyMessageBox.Show("Unchecked."); } }); }
public void OnButton_LevelComplete() { MessageBoxParams param = new MessageBoxParams() { TemplateId = 1, MessageLayout = MessageLayout.Vertical, MessageTitle = "Level Complete!", MessageIcon = dashboardIcon, Button1Text = "Restart", Button1Icon = restartIcon, Button2Text = "Home", Button2Icon = homeIcon, Button3Text = "Share", Button3Icon = shareIcon, InAnimation = InAnimationTypes.VerticalExpand, OutAnimation = OutAnimationTypes.Shrink }; EasyMessageBox.Show(param); }
// Local methods public override void show() { MessageBoxParams boxDef = new MessageBoxParams(); boxDef.MessageBoxTitle = Title; boxDef.MessageTitle = Header; boxDef.Message = Message; boxDef.TemplateId = TemplateID; if (ClickAction != null) { boxDef.Button1Action = ClickAction; } else { string actionname = onClick.GetPersistentMethodName(0); object actionobject = onClick.GetPersistentTarget(0); boxDef.Button1Action = (UnityAction)Delegate.CreateDelegate(typeof(UnityAction), actionobject, actionname); } EasyMessageBox.Show(boxDef); }
private void LoseCampaign() { #if FULLLOG MoreDebug.Log("go: " + gameObject.name); #endif if (!PauseGame.exists) { #if FULLLOG MoreDebug.Log("No PauseGame -----"); #endif } MessageBoxParams parms = new MessageBoxParams(); parms.Message = FailureInfo; parms.MessageBoxTitle = CampaignName; parms.Button1Action = PauseGame.only.queueResume; parms.MultipleCallBehaviour = MultipleCallBehaviours.Queue; EasyMessageBox.Show(parms); PauseGame.only.queuePause(); OnLoseCampaign.Invoke(); CampaignManager.EndCampaign(); }
public void OnButtonClick_ShowCallback2() { EasyMessageBox.Show("Want callbacks?", button1Text: "Yes", button1Action: Yes, button2Text: "No", button2Action: No); }
public void OnButtonClick_Drag_Title() { EasyMessageBox.Show("I can only be dragged by my title.", messageBoxTitle: "Drag Me", dragType: DragTypes.TitleOnly); }
public void OnButtonClick_Drag_TitleAndMessage() { EasyMessageBox.Show("I can be dragged by both the title and the message area. Drag me.", messageBoxTitle: "Drag Me", dragType: DragTypes.TitleAndMessage); }
public void OnButtonClick_Drag_Disable() { EasyMessageBox.Show("I cannot be dragged. ", messageBoxTitle: "Tough Like a Mountain.", dragType: DragTypes.Disabled); }
public void OnButton_MessageBox() { EasyMessageBox.Show("This is a regular message box. My template ID is 0", toggleText: "Do not show again.", toggleAction: OnToggleSet); }
public void OnButtonClick_AnimationOff() { EasyMessageBox.Show("Animation is off.", inAnimation: InAnimationTypes.None, outAnimation: OutAnimationTypes.None); }
public void OnButtonClick_Animation1() { EasyMessageBox.Show("In animation: Popup. Out animation: Fade.", inAnimation: InAnimationTypes.Popup, outAnimation: OutAnimationTypes.Fade); }
public void OnButtonClick_Animation2() { EasyMessageBox.Show("In animation: Spin. Out animation: Spin.", inAnimation: InAnimationTypes.Spin, outAnimation: OutAnimationTypes.Spin); }
public void OnButtonClick_Animation3() { EasyMessageBox.Show("In animation: Stamp. Out animation: Fade.", inAnimation: InAnimationTypes.Stamp, outAnimation: OutAnimationTypes.Fade); }
void Start() { #if FULLLOG MoreDebug.Log("go: " + gameObject.name); #endif RegisterSelf(); // Warn if there's no mission if (Missions.Length == 0) { Debug.LogWarning("OperationManager: No missions set."); } // Set up each mission foreach (MissionManager mi in Missions) { if (mi == null) { continue; } mi.SetOperation(this); if (mi.StartOnLoad) { OnBeginOperation.AddListener(mi.BeginMission); } } // Set up end managers foreach (EndManager em in OperationEndConditions) { em.OnEnd.AddListener(EndOperation); em.isActive = true; } // let the level know you're here level.IncrementOperations(); // load overlays if (OperationOverlayNames != null) { foreach (string scenename in OperationOverlayNames) { SceneManager.LoadScene(scenename, LoadSceneMode.Additive); // todo: what if its not there? } } // Warn if there's no end criteria (level won't end) if (OperationEndConditions.Length == 0) { Debug.LogWarning("OperationManager: No criteria set to end the level."); } // Place the items StartCoroutine(PlaceItems()); // show the op start screen if (!PauseGame.exists) { #if FULLLOG MoreDebug.Log("No PauseGame -----"); #endif } if (CampaignManager.campaign.ForceMissionTerseness) { MissionTerseness = CampaignManager.campaign.OperationTerseness; } if (InfoPriority >= CampaignManager.campaign.OperationTerseness) { MessageBoxParams parms = new MessageBoxParams(); parms.Message = StartingInfo; parms.MessageBoxTitle = OperationName; parms.Button1Action = PauseGame.only.queueResume; parms.MultipleCallBehaviour = MultipleCallBehaviours.Queue; EasyMessageBox.Show(parms); PauseGame.only.queuePause(); } // announce the start of the op // _opIsStarted = true; OnBeginOperation.Invoke(); }