Example #1
0
 // 自动翻页
 void AutoNextStory()
 {
     if (false != m_bAniDialog)
     {
         return;
     }
     if (m_nClientStoryID >= 0)
     {
         Tab_ClientStoryTable StoryItem = TableManager.GetClientStoryTableByID(m_nClientStoryID, m_CurDialogIndex);
         if (null == StoryItem)
         {
             return;
         }
         if (m_NextPageTimer > StoryItem.NextPageTime)
         {
             //ShowNextStory();
             StoryItem = TableManager.GetClientStoryTableByID(m_nClientStoryID, m_CurDialogIndex + 1);
             DialogEnd(null == StoryItem);
             return;
         }
         else
         {
             m_NextPageTimer += Time.deltaTime;
         }
     }
 }
Example #2
0
 /// <summary>
 /// start Story
 /// </summary>
 void AutoBeginStory()
 {
     if (m_nClientStoryID >= 0 && m_CurDialogIndex >= 0)
     {
         Tab_ClientStoryTable tab = TableManager.GetClientStoryTableByID(m_nClientStoryID, m_CurDialogIndex);
         if (tab != null)
         {
             ShowStoryUI(false, tab.SpriteName, StrDictionary.GetClientString_WithNameSex(tab.Story), tab.SpeakerID);
             DoAnimation();
         }
         else
         {
             DialogEnd(true);
         }
     }
 }
        public CutsceneFactoryCommonDialog(int nStoryID)
        {
            m_nStoryID = nStoryID;
            if (m_nStoryID < 0)
            {
                return;
            }
            Tab_StoryTable storyTable = TableManager.GetStoryTableByID(m_nStoryID, 0);

            if (storyTable == null)
            {
                Module.Log.LogModule.ErrorLog("Can not find storyTable {0}", m_nStoryID);
                return;
            }
            Tab_ClientStoryTable storyLine = TableManager.GetClientStoryTableByID(storyTable.ClientStoryID, 0);

            m_bIsMiniStory = storyLine.DialogType == 1;
        }
        public override void Start()
        {
            base.Start();

            // 检测一些前置的条件

            if (m_nStoryID < 0)
            {
                base.Finish();
            }
            Tab_StoryTable storyTable = TableManager.GetStoryTableByID(m_nStoryID, 0);

            if (storyTable == null)
            {
                Module.Log.LogModule.ErrorLog("Can not find storyTable {0}", m_nStoryID);
                base.Finish();
                return;
            }

            int storyMissionID = storyTable.MissionID;

            if (storyMissionID > -1)
            {
                // 任务状态判断
                MissionState misState = (MissionState)GameManager.gameManager.MissionManager.GetMissionState(storyMissionID);
                if (MissionState.Mission_Accepted != misState)
                {
                    Module.Log.LogModule.ErrorLog("MissionState misState is failed {0}", m_nStoryID);

                    StoryDialogLogic.ShowStory(storyTable.ClientStoryID, 0, StoryDialogOverCallback, 0);
                    base.Finish();

                    return;
                }
            }

            // NPC距离判断
            Tab_ClientStoryTable storyLine = TableManager.GetClientStoryTableByID(storyTable.ClientStoryID, 0);

            if (storyLine == null)
            {
                base.Finish();
                return;
            }


//			// 全填-1的时候不检测距离
//			if (storyLine.TargetPosX > -1 && storyLine.TargetPosZ > -1 && storyLine.TargetPosRadius > -1)
//			{
//				Vector3 userPos = new Vector3(0, 0, 0);
//				if (Singleton<ObjManager>.GetInstance().MainPlayer != null)
//				{
//					userPos = Singleton<ObjManager>.GetInstance().MainPlayer.Position;
//				}
//				else
//				{
//					userPos = GameManager.gameManager.PlayerDataPool.EnterSceneCache.EnterScenePos;
//				}
//
//				Vector3 targetPos = new Vector3(storyLine.TargetPosX, 0, storyLine.TargetPosZ);
//				targetPos.y = userPos.y;
//				float dis = Mathf.Abs(Vector3.Distance(userPos, targetPos));
//				if (dis > storyLine.TargetPosRadius)
//				{
//					base.Finish();
//				}
//			}
            // 所有前置判断结束,真的可以进入剧情了
            m_nMissionID     = storyMissionID;
            m_nClientStoryID = storyTable.ClientStoryID;
            m_nDialogType    = storyLine.DialogType;
            m_nDialogID      = 0;

            // 大对话框
            if (m_nDialogType == 0)
            {
                // 判断是否进入ModelStory模式
                Singleton <ObjManager> .Instance.MainPlayer.IsInModelStory = IsNeedSilentMode(m_nStoryID);
                                #if BOBJOYSTICK
                JoyControllerLogic.storyDialogOn = true;
                                #endif
            }

            // 小对话框
            else if (m_nDialogType == 1)
            {
            }

            StoryDialogLogic.ShowStory(m_nClientStoryID, 0, StoryDialogOverCallback, m_nDialogType);
        }