private static LocalizationData.TranslationKey GetTranslationKeyEquivalent(TutorialType tutorialType) { switch (tutorialType) { case TutorialType.ANY_CARD_TUTORIAL: return(LocalizationData.TranslationKey.ANY_CARD_TUTORIAL); case TutorialType.UP_CARD_TUTORIAL: return(LocalizationData.TranslationKey.UP_CARD_TUTORIAL); case TutorialType.DOWN_CARD_TUTORIAL: return(LocalizationData.TranslationKey.DOWN_CARD_TUTORIAL); case TutorialType.NO_CARD_TUTORIAL: return(LocalizationData.TranslationKey.NO_CARD_TUTORIAL); case TutorialType.MULTIPLE_CARD_TUTORIAL: return(LocalizationData.TranslationKey.MULTIPLE_CARD_TUTORIAL); case TutorialType.WILD_CARD_TUTORIAL: return(LocalizationData.TranslationKey.WILD_CARD_TUTORIAL); case TutorialType.OPTIONAL_PLAY_TUTORIAL: return(LocalizationData.TranslationKey.OPTIONAL_PLAY_TUTORIAL); case TutorialType.MAX_DEVIATION_TUTORIAL: return(LocalizationData.TranslationKey.MAX_DEVIATION_TUTORIAL); case TutorialType.WIN_ROUND_TUTORIAL: return(LocalizationData.TranslationKey.WIN_ROUND_TUTORIAL); } return(LocalizationData.TranslationKey.OBJECTIVE_TUTORIAL); }
public void OnTutorial(TutorialType type, int sort) { TutoSupport.enabled = true; TutoSupport.TutoType = type; TutoSupport.SortId = sort; TutoSupport.OnTutoSupportStart(); }
public void ActionCompleted(ActionType type) { if (currentTutorial == TutorialType.NOT) { return; } switch (currentTutorial) { case TutorialType.Move: break; case TutorialType.Ability: switch (type) { case ActionType.SelectAbility: AddTutorial(TutorialType.Move, false); break; case ActionType.DeselectAbility: AddTutorial(TutorialType.Ability, false); break; case ActionType.UseAbility: currentTutorial = TutorialType.NOT; GameObject.Destroy(tutorialAnimation); tutorialAnimation = null; break; } break; } }
void SetTutorial(TutorialType type) { // Clean up old tutorial. Destroy(m_TutorialObject); m_TutorialObject = null; // Find the appropriate prefab. GameObject prefab = TutorialManager.m_Instance.GetTutorialPrefab(type); if (prefab) { m_TutorialObject = (GameObject)Instantiate(prefab, transform.position, transform.rotation); m_TutorialObject.transform.parent = transform; m_TutorialObject.transform.localScale = Vector3.zero; } else { // Nothing mapped. Jump straight to standard. m_TipTransitionState = TransitionState.None; } m_CurrentTutorialType = m_DesiredTutorialType; int iNumTypes = (int)TutorialType.Num; int iCurrentType = (int)m_CurrentTutorialType + 1; m_TipNumber.text = iCurrentType.ToString() + " of " + iNumTypes.ToString(); }
private void CreateCategoryList() { int count = Enum.GetValues(typeof(TutorialType)).Length; categoryButtons = new Button[count - 1]; for (int i = 0; i < count; i++) { TutorialType type = categoriesOrder[i]; if (type == TutorialType.NONE) { continue; } Button button = Instantiate(categoryButton, categoryList); button.onClick.AddListener(() => ShowCategory(type)); //button.transform.GetChild(0).GetComponent<Text>().text = TypeToString(type); LocalizeStringEvent localized = button.GetComponent <LocalizeStringEvent>(); localized.StringReference = TypeToString(type); localized.RefreshString(); categoryButtons[i - 1] = button; } categoryButton.gameObject.SetActive(false); }
public void InitializeTutorial(TutorialType tutorialType) { for (int i = 0; i < m_tutorials.Count; i++) { m_tutorials[i].SetActive(i == (int)tutorialType); } }
public GameObject GetTutorialPrefab(TutorialType type) { for (int i = 0; i < m_PrefabMap.Length; ++i) { if (m_PrefabMap[i].m_Type == type) { return m_PrefabMap[i].m_TutorialPrefab; } } return null; }
public ActionTutorial(TutorialType action, string extractPath, string skyFileLocation, string pdfFileLocation, string skyFileLocationInZip) { ExtractPath = extractPath; ImportType = action; TutorialZipFileLocation = skyFileLocation; PdfFileLocation = pdfFileLocation; SkyFileLocationInZip = skyFileLocationInZip; }
public void QueueTutorial(string text, TutorialType type) { m_ActiveText = type == TutorialType.BIG ? m_BigText : m_SmallText; m_ActiveText.text = text; m_TutorialActive = true; m_ActiveText.GetComponent <Animator>().SetTrigger("showTrigger"); }
IEnumerator StayPanel(string path, string subStay, System.Action sucCallback, System.Action failCallback, float stayTime = 2f) { float time = 0; TargetPanel = null; while (true) { yield return(new WaitForSeconds(0.1f)); if (stayTime != -1)//-1이면 무한 대기 { time += 0.1f; if (stayTime < time) { Debug.LogError(string.Format("tutorial not found error {0}, {1}", path, subStay)); CurType = TutorialType.ALL_CLEAR - 1; //NextTutorialType(TutorialType.ALL_CLEAR); Hide(); break; } } if (TargetPanel != null) { if (string.IsNullOrEmpty(subStay)) { break; } if (TargetPanel.FindChild(subStay) != null && TargetPanel.FindChild(subStay).gameObject.activeSelf) { break; } } else { UIBasePanel panel = UIMgr.GetUIBasePanel(path); if (panel != null && panel.gameObject.activeSelf) { TargetPanel = panel.transform; } } } if ((stayTime == -1 || time < stayTime)) { //Debug.Log("Stay " + path); if (sucCallback != null) { sucCallback(); } } else if (failCallback != null) { failCallback(); } }
private void SetTypeOfBookmark() { var tempType = BookmarkElement.GetAttribute("data-type"); var type = tempType.Substring(tempType.IndexOf("/") + 1); var typeToParse = type.First().ToString().ToUpper() + type.Substring(1); _type = ParseType(typeToParse); }
/// <summary> /// Activate a tutorial /// </summary> /// <param name="type">The type of the tutorial that will activated.</param> /// <param name="forceShow">If set to <c>true</c> show the tutorial even if it's not set to showOnActivate.</param> public void ActivateTutorial(TutorialType type, bool forceShow = false) { foreach (var tutorial in this.GetComponentsInChildren <Tutorial>()) { if (tutorial.type == type) { tutorial.Activate(forceShow); } } }
/// <summary> /// Deactivate a tutorial of the given type /// </summary> /// <param name="type">The type of the tutorial that will be deactivated.</param> public void DeactivateTutorial(TutorialType type) { foreach (var tutorial in this.GetComponentsInChildren <Tutorial>()) { if (tutorial.type == type) { tutorial.Deactivate(); } } }
private ITutorialNavigator GetFilteredTutorialNavigatorByTileType(TutorialType type) { LogIn(); var facet = Scope.Resolve <FacetType>(); var tutorialNavigator = Scope.Resolve <ITutorialNavigator>(); tutorialNavigator.WaitForLoading(); tutorialNavigator = GetFilteredTutorialNavigator(tutorialNavigator, facet, type.ToString()); return(tutorialNavigator); }
public void SetTutorialByDeviceType() { if (GameManager.Instance.playerDeviceType == DeviceType.Desktop) { tutorialType = TutorialType.Desktop; } else if (GameManager.Instance.playerDeviceType == DeviceType.Handheld) { tutorialType = TutorialType.Handheld; } }
void ShowTutorialOfType(TutorialType type) { m_DesiredTutorialType = type; // Fade out any active tutorial. if (m_TutorialObject) { m_TipTransitionState = TransitionState.Out; } else { // No active tutorial? Just straight to showing this one. SetTutorial(m_DesiredTutorialType); m_TipTransitionState = TransitionState.In; } }
public void CheckBookmarkInEachTileType([Values] TutorialType type) { var tutorialNavigator = GetFilteredTutorialNavigatorByTileType(type); var tile = GetRandomTile(tutorialNavigator.GetAllTiles()); tile.AddBookmark(); var tileLink = tile.Link; var tileTitle = tile.Title; CompareBookmarks(tileLink, tileTitle); }
public TutorialItem(TutorialType tutorialType, float timeToWaitAfterEnd, string standardPopupText = "", float timeBeforePopupAndPause = 0.0f, string triggerPopupText = "", Func <bool> triggerConditionFunc = null, string alternativePopupText = "") { TutorialType = tutorialType; TimeToWaitAfterEnd = timeToWaitAfterEnd; StandardPopupText = standardPopupText; TimeBeforePopupAndPause = timeBeforePopupAndPause; TriggerPopupText = triggerPopupText; TriggerConditionFunc = triggerConditionFunc; EventTriggered = TriggerConditionFunc == null || TriggerConditionFunc(); AlternativePopupText = alternativePopupText; }
public void showTutorial(bool show, TutorialType tutorial) { changeGUIState(show, GUIState.Tutorial); if (show) { switch (tutorial) { case TutorialType.Jump: #if (UNITY_IPHONE || UNITY_ANDROID) tutorialLabel.text = "Swipe up to jump"; #else tutorialLabel.text = "Press the up arrow to jump"; #endif break; case TutorialType.Slide: #if (UNITY_IPHONE || UNITY_ANDROID) tutorialLabel.text = "Swipe down to slide"; #else tutorialLabel.text = "Press the down arrow to slide"; #endif break; case TutorialType.Strafe: #if (UNITY_IPHONE || UNITY_ANDROID) tutorialLabel.text = "Tilt to turn"; #else tutorialLabel.text = "Move the mouse to collect coins"; #endif break; case TutorialType.Attack: #if (UNITY_IPHONE || UNITY_ANDROID) tutorialLabel.text = "Tap to attack"; #else tutorialLabel.text = "Attack with the left mouse button"; #endif break; case TutorialType.Turn: #if (UNITY_IPHONE || UNITY_ANDROID) tutorialLabel.text = "Swipe left or right to turn"; #else tutorialLabel.text = "Press the left or right arrows to turn"; #endif break; case TutorialType.GoodLuck: tutorialLabel.text = "Good luck!"; break; } } }
public void StartTutorialIfNecessary(TutorialType tutorialType) { if (!_isShowingTutorial && _numberOfTimesTutorialTypeShown[(int)tutorialType] < NUMBER_OF_TIMES_TO_SHOW_TUTORIALS) { _tutorialText.text = _localizationData.GetLocalizedStringForKey(GetTranslationKeyEquivalent(tutorialType)); _isShowingTutorial = true; _lastTutorialType = tutorialType; if (!_mainGameModtroller.IsShowingHelpPage) { ShowTutorialIfNecessary(); } } }
private void OnTutorialEvent(TutorialType tutorialType, PlayerView playerView) { switch (tutorialType) { case TutorialType.Start: StartTutorial(playerView); break; case TutorialType.End: EndTutorial(); break; } }
public ActionResult TutorialTypeUpdate([ModelBinder(typeof(XpoModelBinder))] TutorialType item) { if (!ModelState.IsValid) { ViewData["EditError"] = "Correct all errors."; } else { item.Save(); unitOfWork.CommitChanges(); } var model = new XPCollection <TutorialType>(unitOfWork, true).ToList(); return(PartialView("_TutorialTypePartial", model)); }
public void Show(Tutorial aTutorial, Vector3 aPosition, float aDelay = 0f) { ShowWindow(); hand.transform.localPosition = new Vector3(aPosition.x + aTutorial.hand.x, aPosition.y + aTutorial.hand.y, 0f); message.transform.localPosition = new Vector3(aPosition.x + aTutorial.message.x, aPosition.y + aTutorial.message.y, 0f); messageText.text = ((aTutorial.type == TutorialType.GoodStart) ? "<color=#FF4B00>Good Start</color> will show you first letter of the word." : ((aTutorial.type == TutorialType.StartAndFinish) ? "<color=#FF4B00>Start & Finish</color> will show you first and last letter of the word." : ((aTutorial.type == TutorialType.Expose) ? "<color=#FF4B00>Expose</color> will show you whole word and its shape." : ((aTutorial.type == TutorialType.Tip) ? "<color=#FF4B00>Tip</color> will show you whole word without location and shape." : ((aTutorial.type == TutorialType.Perfect) ? "Make no mistakes to earn Perfect Bonus." : ((aTutorial.type == TutorialType.Dictionary) ? "You can tap on a word to see its definition." : ((aTutorial.type == TutorialType.Shop) ? "Stuck? You can always buy more coins or hints." : ((aTutorial.type == TutorialType.ExtraWord) ? "Make extra words to earn extra coins." : "")))))))); tutorialType = aTutorial.type; isPointerDown = false; Animator component = base.gameObject.GetComponent <Animator>(); component.ResetTrigger("Hide"); component.ResetTrigger("HideNow"); component.SetBool("IsPoint", tutorialType == TutorialType.Perfect); Invoke("ShowInvoke", aTutorial.delay); }
// Displays the dialogue object and disables the hud // Also handles what events, if any, are called for specific events public void displayTutorial(TutorialType tutorial) { // Resets values Time.timeScale = 0; showingTutorial = true; chatObject.GetComponentInChildren <Text>().text = ""; continueButton.interactable = false; count = 0; chatTimer = 0; currentTutorial = tutorial; chatObject.SetActive(true); hudObject.SetActive(false); switch (tutorial) { case TutorialType.Moving: break; case TutorialType.Light: break; case TutorialType.Crosses: break; case TutorialType.Villagers: break; case TutorialType.Cloak: break; case TutorialType.Shadow: break; case TutorialType.Dash: break; case TutorialType.Hypnotise: enableHypnoGuard(); break; case TutorialType.Slayer: enableSlayer(); break; case TutorialType.Exiting: break; } }
public bool StartNextTutorial(TutorialType nextType) { UIBasePanel frontPanel = uiMgr.GetCurPanel(); if (frontPanel == null) { Hide(); return(false); } else { return(frontPanel.OnSubTutorial()); } //return false; }
public void AddTutorial(TutorialType type, bool initial) { if (initial) { this.currentTutorial = type; } if (tutorialAnimation != null) { GameObject.Destroy(tutorialAnimation); } if (!Game.KEYBOARD) { abilityPanel.Flash(type == TutorialType.Ability); if (type == TutorialType.Ability) { return; } } Sprite[] sprites = null; switch (type) { case TutorialType.Move: sprites = Game.KEYBOARD ? Sprites.tutorial_0_keyboard : Sprites.tutorial_0_touch; break; case TutorialType.Ability: sprites = Game.KEYBOARD ? Sprites.tutorial_1_keyboard : Sprites.tutorial_1_touch; break; } int x = (int)(mapObject.transform.position.x + gridWidth / 2 - Sprites.GetBounds(sprites[0]).x / 2 * S_Camera.scale); if (type == TutorialType.Ability) { x = (int)(abilityPanel.gameObject.transform.position.x + Sprites.GetBounds(Sprites.ability_border).x *S_Camera.scale / 2 - Sprites.GetBounds(sprites[0]).x / 2 * S_Camera.scale); } int y = (int)(Screen.height / 2 + gridHeight / 2 + (Screen.height - gridHeight) / 4 - Sprites.GetBounds(sprites[0]).y / 2 * S_Camera.scale); if (type == TutorialType.Ability) { y = (int)(Screen.height / 2 - gridHeight / 2 - (Screen.height - gridHeight) / 4 - Sprites.GetBounds(sprites[0]).y / 2 * S_Camera.scale) + 20 * S_Camera.scale; } tutorialAnimation = S_Animation.CreateAnimation(sprites, .45f, x, y); Util.SetLayer(tutorialAnimation, Util.LayerName.UI, 0); S_Camera.SetupScale(tutorialAnimation.transform); tutorialAnimation.transform.SetParent(slider.transform, false); Util.SetZ(tutorialAnimation.gameObject, Util.ZLayer.Gameplay); }
public void CheckTutorial() { ulong key = NetData.instance.GetUserInfo().GetCharUUID(); string tutoDataStr = null; if (PlayerPrefs.HasKey(string.Format("TutorialData_{0}.json", key))) { tutoDataStr = PlayerPrefs.GetString(string.Format("TutorialData_{0}.json", key)); JSONObject parseJs = new JSONObject(tutoDataStr); JSONObject json = parseJs[parseJs.Count - 1]["TutorialType"]; SetTutorialType((TutorialType)json.n); } else { _CurTutorial = TutorialType.QUEST; } }
public override void LateInit() { base.LateInit(); uiMgr.IsActiveTutorial = true; if (parameters != null && 0 < parameters.Length) { int tutoType = (int)parameters[0]; CurType = (TutorialType)tutoType; if (CurType == TutorialType.INGAME) { InitInGame(); } else { InitOutTutorial((TutorialSupport)parameters[1]); } } }
public void ClearTutorial(TutorialType type) { ulong key = NetData.instance.GetUserInfo().GetCharUUID(); string tutoDataStr = null; if (PlayerPrefs.HasKey(string.Format("TutorialData_{0}.json", key))) { tutoDataStr = PlayerPrefs.GetString(string.Format("TutorialData_{0}.json", key)); JSONObject parseJs = new JSONObject(tutoDataStr); for (int i = 0; i < parseJs.Count; i++) { if (parseJs[i] != null)//이미 존재하는 튜토리얼 타입 { JSONObject json = parseJs[i]["TutorialType"]; if (json.n == (int)type) { return; } } } string newData = "{"; newData += string.Format("\"TutorialType\":{0}", (int)type); //"\"{"; newData += "}"; parseJs.Add(new JSONObject(newData)); PlayerPrefs.SetString(string.Format("TutorialData_{0}.json", key), parseJs.ToString()); Debug.Log("Save Tutorial Data " + parseJs.ToString()); } else { tutoDataStr = "{"; tutoDataStr += string.Format("\"TutorialType\":{0}", (int)type); tutoDataStr += "}"; JSONObject parseJs = new JSONObject(); parseJs.Add(new JSONObject(tutoDataStr)); PlayerPrefs.SetString(string.Format("TutorialData_{0}.json", key), parseJs.ToString()); } }
public bool IsClearTutorial(TutorialType type) { string tutoDataStr = PlayerPrefs.GetString(string.Format("TutorialData_{0}.json", NetData.instance.GetUserInfo().GetCharUUID())); JSONObject parseJs = new JSONObject(tutoDataStr); for (int i = 0; i < parseJs.Count; i++) { if (parseJs[i] != null)//이미 존재하는 튜토리얼 타입 { JSONObject json = parseJs[i]["TutorialType"]; if (json.n == (int)type)//클리어한 것 { return(true); } } } //클리어하지 않음 return(false); }
public void setTutorialState(Tutorial tutorial, TutorialType type) { this.currentTutorial = tutorial; switch (type) { case (TutorialType.GUIDE): this.currentTutorial.setRightAnimation(guideAnimationRight); this.currentTutorial.setLeftAnimation(guideAnimationLeft); break; case (TutorialType.SPAWN): this.currentTutorial.setRightAnimation(spawnAnimationRight); this.currentTutorial.setLeftAnimation(spawnAnimationLeft); break; case (TutorialType.DESPAWN): this.currentTutorial.setRightAnimation(despawnAnimationRight); this.currentTutorial.setLeftAnimation(despawnAnimationLeft); break; default : break; } }
public void showTutorial(bool show, TutorialType tutorial) { activateObject(tutorialPanel, show); if (show) { switch (tutorial) { case TutorialType.Jump: #if (UNITY_IPHONE || UNITY_ANDROID || UNITY_BLACKBERRY || UNITY_WP8) tutorialLabel.text = "Swipe up to jump"; #else tutorialLabel.text = "Press the up arrow\nto jump"; #endif break; case TutorialType.Slide: #if (UNITY_IPHONE || UNITY_ANDROID || UNITY_BLACKBERRY || UNITY_WP8) tutorialLabel.text = "Swipe down to slide"; #else tutorialLabel.text = "Press the down arrow\nto slide"; #endif break; case TutorialType.Strafe: #if (UNITY_IPHONE || UNITY_ANDROID || UNITY_BLACKBERRY || UNITY_WP8) tutorialLabel.text = "Tilt to turn"; #else tutorialLabel.text = "Left and right arrows\nwill change slots"; #endif break; case TutorialType.Attack: #if (UNITY_IPHONE || UNITY_ANDROID || UNITY_BLACKBERRY || UNITY_WP8) tutorialLabel.text = "Tap to attack"; #else tutorialLabel.text = "Attack with the\nleft mouse button"; #endif break; case TutorialType.Turn: #if (UNITY_IPHONE || UNITY_ANDROID || UNITY_BLACKBERRY || UNITY_WP8) tutorialLabel.text = "Swipe left or right\nto turn"; #else tutorialLabel.text = "Left and right arrows\nwill also turn"; #endif break; case TutorialType.GoodLuck: tutorialLabel.text = "Good luck!"; break; } } }
public void ShowTutorial(bool show, TutorialType tutorial) { tutorialShown = show; tutorialPanel.SetActive(show); string text = ""; if (show) { switch (tutorial) { case TutorialType.Jump: #if (UNITY_IPHONE || UNITY_ANDROID || UNITY_BLACKBERRY || UNITY_WP8) text = "Swipe up to jump"; #else text = "Press the up arrow\nto jump"; #endif break; case TutorialType.Slide: #if (UNITY_IPHONE || UNITY_ANDROID || UNITY_BLACKBERRY || UNITY_WP8) text = "Swipe down to slide"; #else text = "Press the down arrow\nto slide"; #endif break; case TutorialType.Strafe: #if (UNITY_IPHONE || UNITY_ANDROID || UNITY_BLACKBERRY || UNITY_WP8) text = "Tilt to turn"; #else text = "Left and right arrows\nwill change slots"; #endif break; case TutorialType.Attack: #if (UNITY_IPHONE || UNITY_ANDROID || UNITY_BLACKBERRY || UNITY_WP8) text = "Tap to attack"; #else text = "Attack with the\nleft mouse button"; #endif break; case TutorialType.Turn: #if (UNITY_IPHONE || UNITY_ANDROID || UNITY_BLACKBERRY || UNITY_WP8) text = "Swipe left or right\nto turn"; #else text = "Left and right arrows\nwill also turn"; #endif break; case TutorialType.GoodLuck: text = "Good luck!"; break; } #if !(UNITY_4_3 || UNITY_4_4 || UNITY_4_5) if (useuGUI) { tutorialLabelText.text = text; } else { #endif #if COMPILE_NGUI tutorialLabel.text = text; #endif #if !(UNITY_4_3 || UNITY_4_4 || UNITY_4_5) } #endif } }