private static void SubscribeOnClickCellView(RecipeCellView cellView) { var combination = Widget.Find <Combination>(); if (!combination.CanHandleInputEvent) { return; } cellView.scaleTweener.PlayTween(); if (cellView.tempLocked) { AudioController.instance.PlaySfx(AudioController.SfxCode.UnlockRecipe); var avatarState = Game.Game.instance.States.CurrentAvatarState; combination.RecipeVFXSkipMap[cellView.EquipmentRowData.Id] = new int[3] { 0, 0, 0 }; combination.SaveRecipeVFXSkipMap(); var centerPos = cellView.GetComponent <RectTransform>() .GetWorldPositionOfCenter(); VFXController.instance.CreateAndChaseCam <RecipeUnlockVFX>(centerPos); cellView.Set(avatarState, null, false); return; } combination.selectedRecipe = cellView; combination.State.SetValueAndForceNotify(Combination.StateType.CombinationConfirm); }
public void TweenCellView(RecipeCellView view, System.Action onCompleted) { var rect = view.transform as RectTransform; cellViewTweener.SetBeginRect(rect); onTweenCompleted = onCompleted; cellViewTweener.Play(); }
private void OnSelectOption(RecipeCellView recipeView, EquipmentOptionRecipeView optionRecipeView) { SelectedSubRecipeId = optionRecipeView.SubRecipeId; equipmentOptionRecipe.gameObject.SetActive(false); SetData(recipeView.EquipmentRowData, SelectedSubRecipeId); confirmArea.SetActive(true); TweenCellView(recipeView, equipmentOptionRecipe.KillCellViewTween); if (materialPanel is ElementalCombinationMaterialPanel panel) { Widget.Find <Combination>().OnTweenRecipe(); panel.TweenPanel(optionRecipeView); } }
public override void Show(bool ignoreShowAnimation = false) { base.Show(ignoreShowAnimation); CheckLockOfCategoryButtons(); var hasNotification = HasNotification; selectionArea.combineEquipmentButton.HasNotification.Value = hasNotification; combineEquipmentCategoryButton.HasNotification.Value = hasNotification; Find <CombinationLoadingScreen>().OnDisappear = OnNPCDisappear; var stage = Game.Game.instance.Stage; stage.LoadBackground("combination"); var player = stage.GetPlayer(); player.gameObject.SetActive(false); if (_equipmentRecipeIdToGo.HasValue) { var recipeId = _equipmentRecipeIdToGo.Value; var itemId = Game.Game.instance.TableSheets.EquipmentItemRecipeSheet.Values .First(r => r.Id == recipeId).ResultEquipmentId; var itemRow = Game.Game.instance.TableSheets.EquipmentItemSheet.Values .First(r => r.Id == itemId); itemRecipe.SetToggledOnItemType(itemRow.ItemSubType); if (itemRecipe.TryGetCellView( recipeId, out var cellView)) { if (cellView.IsLocked) { State.SetValueAndForceNotify(StateType.CombineEquipment); } else { selectedRecipe = cellView; State.SetValueAndForceNotify(StateType.CombinationConfirm); } } else { Debug.LogError($"Not found cell view with {recipeId} in {nameof(itemRecipe)}"); State.SetValueAndForceNotify(StateType.CombineEquipment); } } else { State.SetValueAndForceNotify(StateType.SelectMenu); } Find <BottomMenu>().Show( UINavigator.NavigationType.Back, SubscribeBackButtonClick, true, BottomMenu.ToggleableType.Mail, BottomMenu.ToggleableType.Quest, BottomMenu.ToggleableType.Chat, BottomMenu.ToggleableType.IllustratedBook, BottomMenu.ToggleableType.Character, BottomMenu.ToggleableType.Combination ); if (_npc01 is null) { var go = Game.Game.instance.Stage.npcFactory.Create( NPCId, npcPosition01.position, LayerType.InGameBackground, 3); _npc01 = go.GetComponent <NPC>(); } AudioController.instance.PlayMusic(AudioController.MusicCode.Combination); }
public bool TryGetCellView(int recipeId, out RecipeCellView cellView) { cellView = cellViews.FirstOrDefault(item => item.EquipmentRowData.Id == recipeId); return(!(cellView is null)); }