Ejemplo n.º 1
0
    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];
    }
Ejemplo n.º 2
0
    public void UnSelectAllNode()
    {
        foreach (KeyValuePair <int, ChapterMapNode> kv in ChapterMapNodes)
        {
            kv.Value.IsSelected = false;
        }

        Cur_SelectedNode = null;
    }
Ejemplo n.º 3
0
 private void OnHoverNode(ChapterMapNode node)
 {
     foreach (KeyValuePair <int, ChapterMapNode> kv in ChapterMapNodes)
     {
         if (kv.Value != node)
         {
             kv.Value.IsHovered = false;
         }
     }
 }
Ejemplo n.º 4
0
    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);
    }
Ejemplo n.º 5
0
    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);
            }
        });