Ejemplo n.º 1
0
    public override void Init()
    {
        table.Config kConfig = TabtoyConfigManager.GetConfig();
        for (int i = 0; i < kConfig.Map.Count; ++i)
        {
            table.MapDefine kMapDefine = kConfig.Map[i];
            if (m_dicMaps.ContainsKey(kMapDefine.Name))
            {
                Debug.LogError("[Map] : Load Error,Map Repeated->" + kMapDefine.Name);
                continue;
            }
            Map kNewMap = new Map();
            kNewMap.iMapID      = kMapDefine.ID;
            kNewMap.arrChildMap = new List <int>();
            string[] strSplitchildmap = kMapDefine.ChildMap.Split('|');
            for (int j = 0; j < strSplitchildmap.Length; ++j)
            {
                string          kChildMapName   = strSplitchildmap[j];
                table.MapDefine kChildMapDefine = kConfig.GetMapByName(kChildMapName);
                if (kChildMapDefine != null)
                {
                    kNewMap.arrChildMap.Add(kChildMapDefine.ID);
                }
            }

            m_dicMaps.Add(kMapDefine.Name, kNewMap);
        }
    }
Ejemplo n.º 2
0
    // Use this for initialization
    public override void Init()
    {
        m_kCurrentstory = null;
        m_dicStorys.Clear();
        m_arrActivestorys.Clear();
        m_arrActivestoryforblocks.Clear();

        // 首先读取配置表,加载所有的剧情
        table.Config kConfig = TabtoyConfigManager.GetConfig();
        for (int i = 0; i < kConfig.Story.Count; i++)
        {
            var    storystruct   = kConfig.Story[i];
            string storyname     = storystruct.Name;
            Story  storyinstance = null;
            if (m_dicStorys.ContainsKey(storyname))
            {
                storyinstance = m_dicStorys [storyname];
            }
            else
            {
                storyinstance = new Story();
                storyinstance.Init(storyname);
                m_dicStorys.Add(storyname, storyinstance);
                storyinstance = m_dicStorys[storyname];

                if (storystruct.InitOpen == true)
                {
                    m_kCurrentstory = storyinstance;
                }
            }

            storyinstance.AddAction(storystruct);
        }
    }
Ejemplo n.º 3
0
 // 窗口刷新消息
 public void OnRefreshContent(string content, int iRoleID)
 {
     table.Config     kConfig    = TabtoyConfigManager.GetConfig();
     table.RoleDefine roleconfig = kConfig.GetRoleByID(iRoleID);
     GetText("Text").text        = content;
     GetImage("roleback").sprite = Resources.Load(roleconfig.NormalDrawing, typeof(Sprite)) as Sprite;
 }
Ejemplo n.º 4
0
 public override void Init()
 {
     table.Config kConfig = TabtoyConfigManager.GetConfig();
     for (int i = 0; i < kConfig.Role.Count; ++i)
     {
         var kRole = kConfig.Role[i];
         _CreateCharacter(kRole.ID);
     }
 }