Beispiel #1
0
    public void InitElements()
    {
        // create objs for Element Board
        List <string> keys = new List <string>(dicElements.Keys);

        for (int i = 0; i < keys.Count; i++)
        {
            string      panelTitle = keys[i];
            CommonPanel panel      = (CanvasMgr.Instance.GetBoard <ElementBoard>() as ElementBoard).AddPanel(panelTitle) as CommonPanel;

            if (panel)
            {
                List <string> panelVars = dicElements[panelTitle];
                for (int j = 0; j < panelVars.Count; j++)
                {
                    string var = panelVars[j];
                    if (var.Contains("#"))
                    {
                        panel.AddLinkLabel(var.Replace("#", ""));
                    }
                    else
                    {
                        panel.AddInputLabel(var);
                    }
                }
            }
        }

        // create objs for Story Board
        keys = new List <string>(dicStories.Keys);
        for (int i = 0; i < keys.Count; i++)
        {
            string      key   = keys[i];
            CommonPanel panel = (CanvasMgr.Instance.GetBoard <StoryBoard>() as StoryBoard).AddPanel(key) as CommonPanel;
            if (panel)
            {
                List <string> vars = dicStories[key];
                for (int j = 0; j < vars.Count; j++)
                {
                    string var = vars[j];
                    if (var.Contains("#"))
                    {
                        panel.AddLinkLabel(var.Replace("#", ""));
                    }
                    else
                    {
                        panel.AddInputLabel(var);
                    }
                }
            }
        }

        // save index data for all panels (at first)
        if (dataIndexer.dataIndexes.Count == 0)
        {
            SaveIndexData();
        }

        isInitDone = true;
    }