private void Load(ScriptableData.ScriptableDataFile dataFile, int sceneId)
 {
     lock (m_oLock)
     {
         foreach (var info in dataFile.ScriptableDatas)
         {
             if (info.GetId() == "story" || info.GetId() == "script")
             {
                 ScriptableData.FunctionData funcData = info.First;
                 if (funcData != null)
                 {
                     ScriptableData.CallData callData = funcData.Call;
                     if (callData != null && callData.HaveParam())
                     {
                         int storyId = int.Parse(callData.GetParamId(0));
                         int id      = GetId(storyId, sceneId);
                         if (!m_dicStoryInstance.ContainsKey(id))
                         {
                             StoryInstance instance = new StoryInstance();
                             instance.Init(info);
                             m_dicStoryInstance.Add(id, instance);
                             m_log.Debug("加载剧情" + id + "成功");
                         }
                         else
                         {
                         }
                     }
                 }
             }
         }
     }
 }
Esempio n. 2
0
    /// <summary>
    /// 开始剧情
    /// </summary>
    /// <param name="storyId"></param>
    public void StartStory(int storyId)
    {
        StoryInstanceInfo instance = NewStoryInstance(storyId);

        if (instance != null)
        {
            m_listStoryLogicInfos.Add(instance);
            instance.m_oInstance.GlobalVariables = m_dicGlobalVariables;
            instance.m_oInstance.Start();
            m_log.Debug("开始剧情:" + storyId);
        }
    }