private void ShowPanel(TutorialPanel panel) { EnterTutorialMode(); var p = Instantiate(panel, _tutorialCanvas.transform); p.SetCloseCallback(ExitTutorialMode); }
private void ValidateTutorials() { _invalidateTaskList = new List <TutorialTask>(); foreach (Tutorial t in _ts.tutorials) { if (!string.IsNullOrEmpty(t.sceneName) && EditorSceneManager.GetActiveScene().name != t.sceneName) { EditorSceneManager.OpenScene("Assets/Scenes/" + t.sceneName + ".unity"); } if (t.prefab == null) { continue; } foreach (Transform tf in t.prefab.transform) { foreach (TutorialTask tt in tf.GetComponents <TutorialTask>()) { if (!tt.IsValidate()) { _invalidateTaskList.Add(tt); } } } // Destroy the spawned tutorial panel TutorialPanel tp = FindObjectOfType <TutorialPanel>(); if (tp != null) { Destroy(tp.gameObject); } } }
private void InitializeComponent() { this.customPanel = new TutorialPanel(); base.SuspendLayout(); this.customPanel.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; this.customPanel.Location = new Point(0, 0); this.customPanel.Name = "customPanel"; this.customPanel.PanelActive = true; this.customPanel.Size = new Size(0x308, 0xcb); this.customPanel.StoredGraphics = null; this.customPanel.TabIndex = 0; base.AutoScaleMode = AutoScaleMode.None; this.BackColor = ARGBColors.Fuchsia; base.ClientSize = new Size(0x308, 0xcb); base.ControlBox = false; base.Controls.Add(this.customPanel); base.FormBorderStyle = FormBorderStyle.None; this.MinimumSize = new Size(10, 10); base.Name = "TutorialWindow"; base.ShowIcon = false; base.ShowInTaskbar = false; base.StartPosition = FormStartPosition.Manual; this.Text = "TutorialWindow"; base.TransparencyKey = ARGBColors.Fuchsia; base.ResumeLayout(false); }
public void GetCrowns() { CrownsOpened = true; if (Program.steamActive || Program.aeriaInstall) { this.SwitchPanel(7); } else { TimeSpan span = (TimeSpan)(DateTime.Now - lastCrownsOpened); if (span.TotalSeconds >= 5.0) { lastCrownsOpened = DateTime.Now; if (GameEngine.Instance.World.isBigpointAccount || Program.bigpointPartnerInstall) { TimeSpan span2 = (TimeSpan)(DateTime.Now - lastUpdatedBPURL); if ((bigpointURL == string.Empty) || (span2.TotalMinutes >= 2.0)) { this.GetBigpointURL(); } else { try { Process.Start(bigpointURL); } catch (Exception) { this.fireURLError(); } } } else { string fileName = (URLs.ProfilePaymentURL + "?u=" + RemoteServices.Instance.UserGuid.ToString().Replace("-", "") + "&s=" + RemoteServices.Instance.SessionGuid.ToString().Replace("-", "")) + "&lang=" + Program.mySettings.LanguageIdent.ToLower(); if (Program.arcInstall) { Program.arc_openURL("https://billing.arcgames.com/" + Program.mySettings.languageIdent); InterfaceMgr.Instance.closePlayCardsWindow(); TutorialPanel.minimizeTutorial(); } else { if (Program.gamersFirstInstall) { fileName = (URLs.ProfileGamersFirstPaymentURL + "?shk_userguid=" + RemoteServices.Instance.UserGuid.ToString().Replace("-", "") + "&shk_sessionguid=" + RemoteServices.Instance.SessionGuid.ToString().Replace("-", "")) + "&lang=" + Program.mySettings.LanguageIdent.ToLower(); } try { Process.Start(fileName); } catch (Exception) { this.fireURLError(); } } } } } }
private void SetIndex(int index) { ObjectInfo[] objectInfos = ObjectPresets[index].ObjectInfos; for (int i = 0; i < objectInfos.Length; i++) { // Object is UI element. TutorialPanel clone = Instantiate(PanePrefab, Vector3.zero, Quaternion.identity, gameObject.transform); RectTransform rect = objectInfos[i].Object.GetComponent <RectTransform>(); if (rect != null) { clone.GetComponent <RectTransform>().position = rect.position + objectInfos[i].Offset; // Object is regular game object. } else { clone.GetComponent <RectTransform>().position = Utility.ConvertToScreenPoint(objectInfos[i].Object.transform.position) + objectInfos[i].Offset; } clone.TextHeading.text = objectInfos[i].Heading; clone.TextDescription.text = objectInfos[i].Description; activeObjects.Add(clone.gameObject); } }
public void Complete() { //Debug.LogFormat("{0}/{1}:TutorialStep - tutorial step completed", transform.parent.name, transform.name); foreach (TutorialTask tt in tasks) { tt.Reset(); } if (TutorialManager.currentTutorial != null) { TutorialManager.AnalyticsTutorialStep(TutorialManager.currentTutorial.id, _stepNumber++); } if (_nextStep != null) { _nextStep.Activate(); } else // Whole tutorial done { TutorialManager.CompleteCurrentTutorial(); TutorialPanel.DestroyInstance(); } completed?.Invoke(); Destroy(gameObject); }
// Debug only private void Update() { if (Input.GetKeyUp(KeyCode.V)) { TutorialPanel.DestroyInstance(); TutorialManager.CompleteCurrentTutorial(); } }
public void GoBack() { LevelConfigPanel.SetActive(false); CreditsPanel.SetActive(false); ExitConfirmationPanel.SetActive(false); TutorialPanel.SetActive(false); MainMenuPanel.SetActive(true); }
public static void RemoveListeners() { if (tutorialPanel != null) { Instance().ForwardButton.onClick.RemoveAllListeners(); Instance().BackButton.onClick.RemoveAllListeners(); Instance().ContinueButton.onClick.RemoveAllListeners(); tutorialPanel = null; } }
// Start is called before the first frame update // Update is called once per frame void MenuConsole() { MenuPanel.SetActive(true); if (TutorialPanel != null) { TutorialPanel.SetActive(false); } IntroManager.phase = Phase.Menu; }
public void NextPage() { TutorialPanel activePage = tutorialPages[currentPage - 1]; currentPage = currentPage != tutorialPages.Count ? currentPage + 1 : 1; TutorialPanel nextPage = tutorialPages[currentPage - 1]; activePage.gameObject.SetActive(false); nextPage.gameObject.SetActive(true); }
public static TutorialPanel Instance() { if (!tutorialPanel) { tutorialPanel = FindObjectOfType<TutorialPanel>(); if (!tutorialPanel) { Debug.LogError("No TutorialPanel script attatched to any gameobject in the scene"); } } return tutorialPanel; }
void Start() { //busca as referências de todos os scripts de interface joysticks = FindObjectsOfType <JoystickController>(); elementInfoPanel = FindObjectOfType <ElementInfoPanel>(); simpleInfo = FindObjectOfType <SimpleInfo>(); virusIntroPanel = FindObjectOfType <VirusIntroPanel>(); tutorialPanel = FindObjectOfType <TutorialPanel>(); gameOverMenu = FindObjectOfType <GameOverMenu>(); victoryMenu = FindObjectOfType <VictoryMenu>(); }
public void RemoveListeners() { OnPlayerUseCard = delegate { }; OnPause = delegate { }; OnUnPause = delegate { }; _ArmyUI.RemoveListeners(); _CardDisplayUI.RemoveListeners(); _HandUI.RemoveListeners(); TutorialPanel.RemoveListeners(); ModalPanel.RemoveListeners(); }
public static TutorialPanel Instance() { if (!tutorialPanel) { tutorialPanel = FindObjectOfType <TutorialPanel>(); if (!tutorialPanel) { Debug.LogError("No TutorialPanel script attatched to any gameobject in the scene"); } } return(tutorialPanel); }
public static void AbortCurrentTutorial() { if (currentTutorial == null) { Debug.LogError("TutorialManager:EndCurrentTutorial - currentTutorial=null, ignore this if debuuging in Editor mode"); return; } CompleteCurrentTutorial(); //TutorialHintController.DestroyAll(); TutorialPanel.DestroyInstance(); }
public override bool Init() { tutorialPanel = TutorialPanel.current; if (tutorialPanel == null) { Debug.LogErrorFormat("{0}:{1}:Init - Can't get TutorialPanel instance", name, GetType()); return(false); } tutorialPanel.Reset(!showBackgroundMask); return(true); }
public override void InitFind() { base.InitFind(); MenuButton = FindTool.FindChildNode(transform, "decoration/MenuButtonGroup").GetComponentsInChildren <VRButton>(); detailsPanel = FindTool.FindChildComponent <DetailsPanel>(transform, "DetailsPanel"); Sprite_weidianji = Resources.LoadAll <Sprite>("Button/weidianji"); Sprite_dianji = Resources.LoadAll <Sprite>("Button/dianji"); Text_Color = MenuButton[0].transform.GetChild(0).GetComponent <Text>().color; tutorialPanel = FindTool.FindChildComponent <TutorialPanel>(transform, "TutorialPanel"); }
/// <summary> /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// </summary> private void InitializeComponent() { this.tutorialPanel1 = new PokeMaster.Panels.TutorialPanel(); this.buttonCancel = new System.Windows.Forms.Button(); this.buttonOk = new System.Windows.Forms.Button(); this.SuspendLayout(); // // tutorialPanel1 // this.tutorialPanel1.Location = new System.Drawing.Point(3, 2); this.tutorialPanel1.Name = "tutorialPanel1"; this.tutorialPanel1.Size = new System.Drawing.Size(498, 315); this.tutorialPanel1.TabIndex = 0; // // buttonCancel // this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.buttonCancel.Location = new System.Drawing.Point(404, 305); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(75, 23); this.buttonCancel.TabIndex = 1; this.buttonCancel.Text = "&Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; // // buttonOk // this.buttonOk.Location = new System.Drawing.Point(323, 305); this.buttonOk.Name = "buttonOk"; this.buttonOk.Size = new System.Drawing.Size(75, 23); this.buttonOk.TabIndex = 2; this.buttonOk.Text = "&Ok"; this.buttonOk.UseVisualStyleBackColor = true; this.buttonOk.Click += new System.EventHandler(this.ButtonOkClick); // // GUIAvatar // this.AcceptButton = this.buttonOk; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; this.ClientSize = new System.Drawing.Size(487, 338); this.Controls.Add(this.buttonOk); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.tutorialPanel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.Name = "GUIAvatar"; this.Text = "Avatar Settings"; this.ResumeLayout(false); }
void Start() { //PlayerPrefs.DeleteAll(); MainMenuPanel.SetActive(true); LevelConfigPanel.SetActive(false); CreditsPanel.SetActive(false); TutorialPanel.SetActive(false); //GlowColor = PlayerPrefs.GetString("GlowColor"); Sound = PlayerPrefs.GetInt("Sound"); Level = PlayerPrefs.GetInt("Level"); CheckSound(); //CheckColor(); CheckLevel(); }
public override bool Init() { _tutorialPanel = TutorialPanel.current; if (_tutorialPanel == null) { Debug.LogError("TutorialDialogue:Init - Can't get UITutorialPanel instance"); return(false); } _tutorialPanel.Reset(false); _tutorialPanel.Show(); //ShowNextText(); return(true); }
private void Start() { characterMover = Character.GetComponent <CharacterMover>(); FadeEfx = objFadeEfx.GetComponent <FadeEffect>(); dialogueManager = DialogueManager.Instance(); //DialogueBox = dialogueManager.objDialogueBox; LibDialogue = objLibDialogue.GetComponent <DialogueTrigger>(); LibDialogue2 = objLibDialogue2.GetComponent <DialogueTrigger>(); tutorialPanel = objTutoPanel.GetComponent <TutorialPanel>(); DoorDialogue = objDoorDialogue.GetComponent <DialogueTrigger>(); StairDialogue = objStairDialogue.GetComponent <DialogueTrigger>(); cameraSystem = objCameraSyetem.GetComponent <CameraSystem>(); }
public void RemoveListeners() { OnCommanderMove = delegate { }; OnCommanderForceMove = delegate { }; OnCommanderGrounded = delegate { }; OnPlayerUseCard = delegate { }; OnPause = delegate { }; OnUnPause = delegate { }; _ArmouryUI.RemoveListeners(); _ArmyUI.RemoveListeners(); _CardDisplayUI.RemoveListeners(); _HandUI.RemoveListeners(); _battlebeardCommanderUI.RemoveListeners(); _stormshaperCommanderUI.RemoveListeners(); TutorialPanel.RemoveListeners(); ModalPanel.RemoveListeners(); }
// Start is called before the first frame update void Start() { // Creates tutorial instances foreach (TutorialDescriptor tutorialDescriptor in TutorialList) { int index = TutorialList.IndexOf(tutorialDescriptor); TutorialPanel tutorialPanel = Instantiate(TemplateTutorialPanel, this.transform); tutorialPanel.SetText(tutorialDescriptor.ExplanationText); tutorialPanel.SetPage(index + 1, TutorialList.Count); tutorialPages.Add(tutorialPanel); tutorialPanel.gameObject.SetActive(index == 0); // By default just the first page shall be active } if (tutorialPages.Count == 0) { TutorialButton.gameObject.SetActive(false); } }
public void CloseTuto(TutorialPanel tutorialPanel) { openedTutoPanels.Remove(tutorialPanel.tutorialData); AkSoundEngine.PostEvent("UI_Select_In", gameObject); Destroy(tutorialPanel.gameObject); if (openedTutoPanels.Count == 0) { if (BGBlur) { BGBlur.SetActive(false); } if (GameManager.CheckInstance()) { GameManager.Instance.OnPause = false; } ActivateCardCanvas(true); OnAllTutosClosed?.Invoke(); } }
private void HandleMainMenuNotifications(string sceneName) { if (sceneName == "Main Menu") { int hasSeenTutorial = PlayerPrefs.GetInt(EnumUtil.GetString(NotificationType.Tutorial), 0); if (hasSeenTutorial == 0) { GameObject go = GameObject.FindGameObjectWithTag("UI_GRP"); if (go != null) { tutorialPanel = go.GetComponent <TutorialPanel>(); } else { Debug.LogError("No UI_GRP found"); } if (tutorialPanel != null) { tutorialPanel.StartTutorial(); } } int hasFinishedGame = PlayerPrefs.GetInt(EnumUtil.GetString(NotificationType.Finish), 0); if (hasFinishedGame == 1) { GameObject go = GameObject.FindGameObjectWithTag("UI_GRP"); if (go != null) { gameFinishPanel = go.GetComponent <GameFinishPanel>(); } else { Debug.LogError("No UI_GRP found"); } if (gameFinishPanel != null) { gameFinishPanel.StartNotification(); PlayerPrefs.SetInt(EnumUtil.GetString(NotificationType.Finish), 2); } } } }
public void SpawnTutorial() { if (currentTutorialPanel != null) { currentTutorialPanel.MakeDisappear(); } if (currentArrow != null) { currentArrow.MakeDisappear(); } currentTutorialPanel = Instantiate(tutorialPanelPrefab).GetComponent <TutorialPanel>(); Tutorial current = tutorials[tutorialIndex]; currentTutorialPanel.Title.text = current.Title; currentTutorialPanel.Body.text = current.Body; if (current.Skip != "") { currentTutorialPanel.Skip.text = current.Skip; } RectTransform rectTransform = currentTutorialPanel.GetComponent <RectTransform>(); rectTransform.SetParent(UI.Instance.gameObject.GetComponent <RectTransform>()); rectTransform.localPosition = tutorialPanelPrefab.transform.localPosition;//Vector3.zero; if (current.ArrowPrefab != null) { currentArrow = Instantiate(current.ArrowPrefab).GetComponent <Arrow>(); RectTransform arrowRect = currentArrow.GetComponent <RectTransform>(); arrowRect.SetParent(UI.Instance.gameObject.GetComponent <RectTransform>()); arrowRect.localPosition = current.ArrowPoint; } else { currentArrow = null; } tutorialActions[tutorialIndex].Invoke(); }
public void InitNewTutoPanel(TutorialDataWrapper tutorialData) { if (tutoPanelPrefab) { if (BGBlur) { BGBlur.SetActive(true); } if (GameManager.CheckInstance()) { GameManager.Instance.OnPause = true; } ActivateCardCanvas(false); TutorialPanel tuto = Instantiate(tutoPanelPrefab, baseCanvas.transform); tuto.Init(tutorialData); openedTutoPanels.Add(tuto.tutorialData); } else { Debug.LogError("No TutoPanelPrefab"); } }
private void CarregarTutorialMatematica() { painel = new TutorialPanel(); //Esconde a demo groupDemo.SetActive(false); //groupRecycable.SetActive(true); #region SelecaoMensagem /* * Nivel 0-5 : Papel e Plastico | 3 segundos intervalo | pisca na tela | pisca item * Nivel 6-10: +Vidro | 2 segundos intervalo | pisca na tela | * Nivel 11-20: +Metal | 1 segundo intervalo | pisca na tela * Nivel 21-99: Lixo Organico | 1 segundo intervalo | * A cada 3 levels tamanhoSequencia++ */ switch (PlayerPrefs.GetInt("nivelMatematica")) { default: painel.MostraMetal = painel.MostraOrganico = painel.MostraPapel = painel.MostraVidro = painel.MostraPlastico = true; ShowAdvise(); break; //Tutorial Vidro case 6: groupSample.SetActive(true); painel.TextoDescritivo = @"Você desbloqueou um novo item: Vidro. Tipos de vidro recicláveis : Garrafas de sucos, refrigerantes, cervejas e outros tipos de bebidas; Potes de alimentos, Cacos de vidros, Frascos de remédios Preste atenção no som do Vidro: " ; painel.MostraVidro = true; tutorialPanel.SetActive(true); GetComponent <AudioSource>().PlayOneShot(somDescoberta); break; //Tutorial Metal case 11: groupSample.SetActive(true); tutorialPanel.SetActive(true); painel.TextoDescritivo = @"Você desbloqueou um novo item: Metal. Tipos de metais recicláveis : Latas de alumínio (refrigerante, cerveja, etc.) e aco (latas de sardinha, molhos, óleo, etc. <b>O intervalo entre os sons ficará menor. Fique atento. Preste atencao no som do Metal:</b> " ; painel.MostraMetal = true; GetComponent <AudioSource>().PlayOneShot(somDescoberta); break; case 21: groupSample.SetActive(true); tutorialPanel.SetActive(true); painel.TextoDescritivo = @"Você desbloqueou um novo item: Lixo Orgânico. Podemos citar como exemplos de lixo orgânico: restos de alimentos orgânicos (carnes, vegetais, frutos, cascas de ovos), ossos, sementes, etc. A Partir de agora o jogo ficará muito mais difícil! Preste atencao no som do Lixo Orgânico: " ; GetComponent <AudioSource>().PlayOneShot(somDescoberta); painel.MostraOrganico = true; break; } #endregion textoDescritivo.text = painel.TextoDescritivo; spriteMetal.enabled = textoMetal.enabled = painel.MostraMetal; spriteOrganico.enabled = textoOrganico.enabled = painel.MostraOrganico; spritePlastico.enabled = textoPlastico.enabled = painel.MostraPlastico; spritePapel.enabled = textoPapel.enabled = painel.MostraPapel; spriteVidro.enabled = textoVidro.enabled = painel.MostraVidro; botaoMetal.SetActive(painel.MostraMetal); botaoOrganico.SetActive(painel.MostraOrganico); botaoPlastico.SetActive(painel.MostraPlastico); botaoPapel.SetActive(painel.MostraPapel); botaoVidro.SetActive(painel.MostraVidro); }
public void OpenTutorial() { TutorialPanel.SetActive(true); MainMenuPanel.SetActive(false); }
private void Awake() { tutorialManager = GameObject.Find("TutorialHintsPanel").GetComponent <TutorialPanel>(); hasTriggered = false; }
void Start () { tp = this; control = GetComponent<dfControl>(); }