private void GenerateNode(int nodeLocationIndex) { ChapterMapNode cmn = GameObjectPoolManager.Instance.PoolDict[GameObjectPoolManager.PrefabNames.ChapterMapNode].AllocateGameObject <ChapterMapNode>(ChapterMapNodesTransform); cmn.AdjacentRoutes.Clear(); ChapterMapNodes.Add(nodeLocationIndex, cmn); cmn.transform.localPosition = nodeLocations[nodeLocationIndex]; }
public void UnSelectAllNode() { foreach (KeyValuePair <int, ChapterMapNode> kv in ChapterMapNodes) { kv.Value.IsSelected = false; } Cur_SelectedNode = null; }
private void OnHoverNode(ChapterMapNode node) { foreach (KeyValuePair <int, ChapterMapNode> kv in ChapterMapNodes) { if (kv.Value != node) { kv.Value.IsHovered = false; } } }
private void SelectNode(int nodeIndex) { if (ChapterMapNodes[nodeIndex].IsBeated) { return; } foreach (KeyValuePair <int, ChapterMapNode> kv in ChapterMapNodes) { kv.Value.IsSelected = false; } ChapterMapNodes[nodeIndex].IsSelected = true; Cur_SelectedNode = ChapterMapNodes[nodeIndex]; OnSelectChapterNode?.Invoke(Cur_SelectedNode); }
private void SelectNode(ChapterMapNode node) { StartButton.gameObject.SetActive(true); StartButton.onClick.RemoveAllListeners(); StartButton.onClick.AddListener(delegate { if (node.Cur_Level != null) { if (node.IsBeated) { NoticeManager.Instance.ShowInfoPanelCenter(LanguageManager.Instance.GetText("StoryPanel_CannotStartBeatedLevel"), 0, 1f); } else { switch (node.Cur_Level) { case Enemy enemy: { UnityAction action = delegate { UIManager.Instance.GetBaseUIForm <StartMenuPanel>().StartGameCore(RoundManager.PlayMode.Single, Cur_ChapterMap.Cur_Chapter.ChapterID, node.Cur_Level.LevelID); }; action.Invoke(); CurrentStartGameAction = action; break; } case Shop shop: { StandaloneStartLevelRequest request = new StandaloneStartLevelRequest(Client.Instance.Proxy.ClientID, -1, Cur_ChapterMap.Cur_Chapter.ChapterID, node.Cur_Level.LevelID); Client.Instance.Proxy.SendMessage(request); break; } } } } else { ConfirmPanel cp = UIManager.Instance.ShowUIForms <ConfirmPanel>(); cp.Initialize(LanguageManager.Instance.GetText("Notice_SelectEmptyLevel"), LanguageManager.Instance.GetText("Common_Confirm"), null, delegate { cp.CloseUIForm(); }, null); } });