Exemplo n.º 1
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);
        }
    }
Exemplo n.º 2
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);
        }
    }
Exemplo 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;
 }
Exemplo 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);
     }
 }
Exemplo n.º 5
0
    protected LobbyWindow m_kLobbyWindow = null;            // 切换等待界面

    public override void OnEnterStatus()
    {
        // 首先初始化配置
        TabtoyConfigManager.Init();

        if (m_kStartWindow == null)
        {
            m_kStartWindow = OpenUI <StartWindow> () as StartWindow;
        }
        m_kStartWindow.Show();
    }
Exemplo n.º 6
0
    protected IEnumerator _ChangeSceneAnim(int iFromMapID, int iToMapID)
    {
        table.MapDefine kFromMap = TabtoyConfigManager.GetConfig().GetMapByID(iFromMapID);
        table.MapDefine kToMap   = TabtoyConfigManager.GetConfig().GetMapByID(iToMapID);
        if (kToMap == null)
        {
            Debug.LogError("[Map] : Error,map is not exist");
            yield break;
        }

        // 首先播放场景结束动画
        if (kFromMap != null)
        {
            if (kFromMap.MapType == "大地图")
            {
            }
            else if (kFromMap.MapType == "城市")
            {
            }
        }

        // 然后播放场景加载动画
        if (kToMap.MapType == "大地图")
        {
            if (m_kBigMapScene == null)
            {
                m_kBigMapScene = OpenUI <NormalMapWindow>() as NormalMapWindow;
            }
            if (m_kCurMapScene != null)
            {
                m_kCurMapScene.Hide();
            }

            m_kBigMapScene.SetBackGround(kToMap.BackPic);
        }
        else if (kToMap.MapType == "城市")
        {
            if (m_kCurMapScene == null)
            {
                m_kCurMapScene = OpenUI <NormalMapWindow>() as NormalMapWindow;
            }
            if (m_kBigMapScene != null)
            {
                m_kBigMapScene.Hide();
            }
            m_kCurMapScene.SetBackGround(kToMap.BackPic);
        }
    }
Exemplo n.º 7
0
    // 添加action
    public void AddAction(table.StoryDefine kDefineStruct)
    {
        string str        = kDefineStruct.ActionType;
        var    actiontype = TabtoyConfigManager.GetConfig().GetActionByName(str);

        if (actiontype == null)
        {
            Debug.LogError("action " + str + "does not exist!!!");
            return;
        }
        Type       type           = Type.GetType(actiontype.ScriptName, true, true);
        var        temp           = Activator.CreateInstance(type);
        ActionBase actionInstance = temp as ActionBase;

        actionInstance.Init(kDefineStruct);
        m_arrActionList.Add(actionInstance);
    }