Exemplo n.º 1
0
    void onClick_MissionAnimation_queidng_Btn(GameObject caster)
    {
        int nID = int.Parse(m_input_MissionAnimation_Input.text);

        if (nID > 0)
        {
            SequencerManager.Instance().PlaySequencer(nID);
        }
    }
Exemplo n.º 2
0
        public override void EndEvent()
        {
            StoryPanel.StoryData data = new StoryPanel.StoryData();
            data.Des              = "";
            data.ShowSkip         = SequencerManager.Instance().IsShowSkipSequencerBtn();
            data.SkipDlg          = SequencerManager.Instance().OnSkipSequencer;
            data.ColliderClickDlg = SequencerManager.Instance().OnClickSequencer;

            DataManager.Manager <UIPanelManager>().ShowStory(data);
        }
Exemplo n.º 3
0
        public void Fire(Camera previousCamera)
        {
            Fired = true;

            if (transitionType != WellFired.Shared.TypeOfTransition.Cut)
            {
                if (previousCamera != null)
                {
                    ActiveTransition = new WellFired.Shared.BaseTransition();

                    //ÏÈ·ÅÕâÀï
                    GameObject gameObject = GameObject.Find("/ui_root/Camera");
                    if (gameObject != null)
                    {
                        Camera camera = gameObject.GetComponent <Camera>();
                        additionalSourceCameras.Add(camera);
                        additionalDestinationCameras.Add(camera);
                    }

                    ActiveTransition.InitializeTransition(previousCamera, KeyframeCamera, additionalSourceCameras, additionalDestinationCameras, transitionType);
                }
                else
                {
                    Debug.LogWarning("Cannot use a transition as the first cut in a sequence.");
                }
            }

            // If no transition, instantly enable the camera
            if (ActiveTransition == null)
            {
                if (KeyframeCamera)
                {
                    KeyframeCamera.enabled = true;
                    SequencerManager.Instance().ChangeKeyframeCamera(KeyframeCamera);
                }
            }

            // Always enable the listener.
            if (AudioListener)
            {
                AudioListener.enabled = true;
            }

#if DEBUG_OBSERVER
            Debug.Log("Fire " + KeyframeCamera);
#endif
        }
Exemplo n.º 4
0
        public override void FireEvent()
        {
            if (!AffectedObject)
            {
                return;
            }
            if (bIsFireEvent == true)
            {
                return;
            }

            bIsFireEvent = true;

            if (!Application.isPlaying && Application.isEditor)
            {
            }
            else
            {
                if (dialogID == 0)
                {
                    StoryPanel.StoryData data = new StoryPanel.StoryData();
                    data.Des              = "";
                    data.BgTexPath        = backgroundImage;
                    data.ShowSkip         = SequencerManager.Instance().IsShowSkipSequencerBtn();
                    data.SkipDlg          = SequencerManager.Instance().OnSkipSequencer;
                    data.ColliderClickDlg = SequencerManager.Instance().OnClickSequencer;

                    DataManager.Manager <UIPanelManager>().ShowStory(data);
                }
                else
                {
                    string strText            = SequencerManager.Instance().GetDialogText((uint)dialogID);
                    StoryPanel.StoryData data = new StoryPanel.StoryData();
                    data.Des              = strText;
                    data.BgTexPath        = backgroundImage;
                    data.ShowSkip         = SequencerManager.Instance().IsShowSkipSequencerBtn();
                    data.SkipDlg          = SequencerManager.Instance().OnSkipSequencer;
                    data.ColliderClickDlg = SequencerManager.Instance().OnClickSequencer;

                    DataManager.Manager <UIPanelManager>().ShowStory(data);
                }
            }
        }
Exemplo n.º 5
0
        public override void FireEvent()
        {
            if (!AffectedObject)
            {
                return;
            }

            if (!Application.isPlaying && Application.isEditor)
            {
            }
            else
            {
                table.MapDataBase data = GameTableManager.Instance.GetTableItem <table.MapDataBase>(sceneID);
                if (data == null)
                {
                    return;
                }
                table.ResourceDataBase resDB = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(data.dwResPath);
                if (resDB == null)
                {
                    return;
                }

                Engine.IRenderSystem rs = Engine.RareEngine.Instance().GetRenderSystem();
                if (rs != null)
                {
                    string        str   = resDB.strPath;
                    Engine.IScene scene = rs.EnterScene(ref str, SequencerManager.Instance());
                    if (scene != null)
                    {
                        ///¼ÓÔس¡¾°
                        SequencerManager.Instance().Pause();

                        scene.StartLoad(Vector3.one);

                        //±£´æÏÂmapid
                        Client.IMapSystem map = Client.ClientGlobal.Instance().GetMapSystem();
                        SequencerManager.Instance().m_MapID = map.GetMapID();
                    }
                }
            }
        }
Exemplo n.º 6
0
 private void OnChapterEnd(int nEventId, object param)
 {
     if (nEventId == (int)Client.GameEventID.CHAPTER_EFFECT_END)
     {
         uint nChapter = (uint)param;
         table.SequencerData database = null;
         for (int i = 0; i < m_ChapterType.Count; i++)
         {
             database = m_ChapterType[i];
             if (database.Paramer1 == 1)            // 章节结束触发
             {
                 if (database.Paramer2 == nChapter) //章节id
                 {
                     m_SequencerData = database;
                     SequencerManager.Instance().PlaySequencer(m_SequencerData.SequencerFile);
                     return;
                 }
             }
         }
     }
 }
Exemplo n.º 7
0
    //正常播放完成
    public void PlaybackFinished(WellFired.USSequencer sequencer)
    {
        m_IsPlay = false;

        if (m_SequencerCamera != null)
        {
            GameObject obj    = GameObject.Find("MainCamera");
            Camera     camera = obj.GetComponent <Camera>();
            if (camera != m_SequencerCamera)
            {
                camera.enabled = true;
            }
        }
        m_SequencerCamera = null;
        m_SequencerData   = null;


        // 取消回调
        if (sequencer != null)
        {
            sequencer.PlaybackFinished -= this.PlaybackFinished;
            sequencer.BeforeUpdate     -= this.BeforeUpdate;
        }

        try
        {
            //显示npc
            Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();
            if (es != null)
            {
                es.ShowEntity(true);
            }

            //删除剧情gameobject
            if (m_SequencerGameObject != null)
            {
                GameObject.Destroy(m_SequencerGameObject);
                m_SequencerGameObject = null;
            }
            Debug.Log("清理剧情对象");

            //清理剧情对象
            ClearSequencerTempObject();

            //打开声音
            Client.ClientGlobal.Instance().MuteGameSound(false);
        }
        catch
        {
            goto Exit0;
        }
Exit0:
        //隐藏提示
        TipsManager.Instance.EnableTips(true);

        //DataManager.Manager<UIPanelManager>().ShowStoryCachePanel();
        Debug.Log("剧情结束显示UI");
        RoleStateBarManager.ShowHeadStatus();
        //剧情结束隐藏黑边
        DataManager.Manager <UIPanelManager>().HideStory();
        Debug.Log("剧情结束隐藏黑边");
        Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.STORY_PLAY_OVER, null);

        //却换到原场景
        Engine.IRenderSystem rs = Engine.RareEngine.Instance().GetRenderSystem();
        if (m_MapID != 0)
        {
            // 剧情播放完毕加载原场景
            table.MapDataBase data = GameTableManager.Instance.GetTableItem <table.MapDataBase>(m_MapID);
            if (data == null)
            {
                return;
            }
            table.ResourceDataBase resDB = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(data.dwResPath);
            if (resDB == null)
            {
                return;
            }

            if (rs != null)
            {
                string        str   = resDB.strPath;
                Engine.IScene scene = rs.EnterScene(ref str, SequencerManager.Instance());
                if (scene != null)
                {
                    ///加载场景
                    SequencerManager.Instance().Pause();

                    scene.StartLoad(Vector3.one);
                }
            }
            m_MapID = 0;
        }
    }
Exemplo n.º 8
0
    public void PlaySequencer(string strSequencer)
    {
        if (m_IsPlay)
        {
            return;
        }

        if (strSequencer == "")
        {
            return;
        }

        //隐藏npc
        //Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();
        //if (es != null)
        //    es.ShowEntity(false);
        try
        {
            m_SequencerGameObject = WellFired.USSequencerLoad.LoadSequencerFromXml(strSequencer);
        }
        catch
        {
            PlaybackFinished(null);
            goto Exit0;
        }

        if (m_SequencerGameObject != null)
        {
            WellFired.USSequencer sequencer = m_SequencerGameObject.GetComponent <WellFired.USSequencer>();

            if (sequencer != null)
            {
                sequencer.PlaybackFinished += this.PlaybackFinished;
                sequencer.BeforeUpdate     += this.BeforeUpdate;

                m_IsPlay = true;
                if (m_IsPlay == true)
                {
                    RoleStateBarManager.HideHeadStatus();//隐藏npc血条

                    //隐藏提示
                    TipsManager.Instance.EnableTips(false);

                    //关闭声音
                    //IClientGlobal的MuteGameSound方法
                    Client.ClientGlobal.Instance().MuteGameSound(true);


                    ///显示黑边
                    StoryPanel.StoryData data = new StoryPanel.StoryData();
                    data.Des              = "";
                    data.ShowSkip         = SequencerManager.Instance().IsShowSkipSequencerBtn();
                    data.SkipDlg          = SequencerManager.Instance().OnSkipSequencer;
                    data.ColliderClickDlg = SequencerManager.Instance().OnClickSequencer;

                    ////隐藏npc
                    Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();
                    if (es != null)
                    {
                        es.ShowEntity(false);
                    }
                }

                sequencer.Play();
            }
        }



Exit0:
        return;
    }
Exemplo n.º 9
0
    private void OnEvent(int nEventId, object param)
    {
        if (nEventId == (int)Client.GameEventID.TASK_DONE)
        {
            //完成任务
            Client.stTaskDone     td       = (Client.stTaskDone)param;
            table.ChapterDabaBase database = null;
            bool flag = false;

            for (int i = 0, imax = m_lstChapterTaskTrigger.Count; i < imax; i++)
            {
                database = m_lstChapterTaskTrigger[i];

                if (database.Paramer2 == td.taskid)
                {
                    if (database.Paramer1 == 2)
                    {
                        PlayChapterEffect(database);
                        return;
                    }
                }
            }

            for (int i = 0; i < m_TaskTriggerType.Count; i++)
            {
                table.SequencerData data = m_TaskTriggerType[i];

                if (data.Paramer1 == 2)
                {
                    if (data.Paramer2 == td.taskid)
                    {
                        m_SequencerData = data;
                        SequencerManager.Instance().PlaySequencer(m_SequencerData.SequencerFile);
                        return;
                    }
                }
            }
        }
        else if ((int)Client.GameEventID.TASK_ACCEPT == nEventId)
        {
            //接受任务
            uint taskid = (uint)param;
            table.ChapterDabaBase database = null;
            for (int i = 0, imax = m_lstChapterTaskTrigger.Count; i < imax; i++)
            {
                database = m_lstChapterTaskTrigger[i];

                if (database.Paramer2 == taskid)
                {
                    if (database.Paramer1 == 1)
                    {
                        PlayChapterEffect(database);
                        return;
                    }
                }
            }
            for (int i = 0; i < m_TaskTriggerType.Count; i++)
            {
                table.SequencerData data = m_TaskTriggerType[i];

                // 这个剧情是接受任务触发
                if (data.Paramer1 == 1)
                {
                    if (data.Paramer2 == taskid)
                    {
                        m_SequencerData = data;
                        SequencerManager.Instance().PlaySequencer(m_SequencerData.SequencerFile);
                        return;
                    }
                }
            }
        }
        else if ((int)Client.GameEventID.TASK_CANSUBMIT == nEventId)
        {
            //提交任务
            Client.stTaskCanSubmit cs       = (Client.stTaskCanSubmit)param;
            table.ChapterDabaBase  database = null;
            for (int i = 0, imax = m_lstChapterTaskTrigger.Count; i < imax; i++)
            {
                database = m_lstChapterTaskTrigger[i];

                if (database.Paramer2 == cs.taskid)
                {
                    if (database.Paramer1 == 3)
                    {
                        PlayChapterEffect(database);
                        return;
                    }
                }
            }
            for (int i = 0; i < m_TaskTriggerType.Count; i++)
            {
                table.SequencerData data = m_TaskTriggerType[i];
                if (data.Paramer1 == 3)
                {
                    if (data.Paramer2 == cs.taskid)
                    {
                        m_SequencerData = data;
                        SequencerManager.Instance().PlaySequencer(m_SequencerData.SequencerFile);
                        return;
                    }
                }
            }
        }
    }
Exemplo n.º 10
0
    /// <summary>
    /// 构建游戏初始化数据
    /// </summary>
    private void StructGameInitData(GameObject root)
    {
        if (null == m_lstGameInitDatas)
        {
            m_lstGameInitDatas = new List <GameInitData>();
        }
        m_lstGameInitDatas.Clear();

        //1、网络初始化
        GameInitData gameInitData = GameInitData.Create(GameInitDataType.Net, "网络初始化", (progressCallback, data) =>
        {
            //网络初始化
            NetService.Instance.Init();
            progressCallback.Invoke(data, 1);
        });

        m_lstGameInitDatas.Add(gameInitData);

        //2、品质设置

        gameInitData = GameInitData.Create(GameInitDataType.Quality, "品质设置", (progressCallback, data) =>
        {
            //品质设置
            QualitySettings.pixelLightCount = 3;
            QualitySettings.SetQualityLevel((int)QualityLevel.Good);
            progressCallback.Invoke(data, 1f);

            if (SystemInfo.systemMemorySize < 1024)
            {
                QualitySettings.shadows = ShadowQuality.Disable;
            }
        }, 30);
        m_lstGameInitDatas.Add(gameInitData);



        //3、配置表设置
        gameInitData = GameInitData.Create(GameInitDataType.Table, "配置表设置", (progressCallback, data) =>
        {
            // 配置表路径设置
            Table.SetDataPath("common/tab/");
            float totalSubProgress   = 0;
            Action <float> subAction = (subProgress) =>
            {
                totalSubProgress = 0.8f * subProgress;
                progressCallback.Invoke(data, totalSubProgress);
            };
            // 加载配置表
            GameTableManager.Instance.LoadTable(subAction);
            GameTableManager.Instance.LoadGloabalConst();
            progressCallback.Invoke(data, 1);
        }, 50);
        m_lstGameInitDatas.Add(gameInitData);



        //5、游戏环境初始化
        gameInitData = GameInitData.Create(GameInitDataType.GameEnvironment, "游戏环境初始化", (progressCallback, data) =>
        {
            // 设置特效加载回调
            EffectLoad effectLoad = new EffectLoad();
            Engine.RareEngine.Instance().SetEffectLoad(effectLoad);
            // 镜头bloom效果
            CameraBloomEffect cameraBloom = new CameraBloomEffect();
            Engine.RareEngine.Instance().SetCameraBloom(cameraBloom);

            progressCallback.Invoke(data, 0.2f);
            //剧情
            SequencerManager.Instance().Init();
            AppleSceneMaterial.Instance();

            progressCallback.Invoke(data, 0.4f);
            // 实体消息缓存
            EntityCreator.Instance().Init();
            progressCallback.Invoke(data, 0.6f);
            // 游戏逻辑初始化
            ClientGlobal.Instance().Init();
            progressCallback.Invoke(data, 0.8f);
            ////生成数据管理器
            //DataManager.Instance.Create();
            //TipsManager.Instance.Initialize();


            progressCallback.Invoke(data, 1);
        }, 20);
        m_lstGameInitDatas.Add(gameInitData);

        //6、本地数据初始化
        gameInitData = GameInitData.Create(GameInitDataType.DataManager, "本地数据初始化", (progressCallback, data) =>
        {
            //本地数据初始化
            float totalSubProgress   = 0;
            Action <float> subAction = (subProgress) =>
            {
                totalSubProgress = 0.99f * subProgress;
                progressCallback.Invoke(data, totalSubProgress);
            };
            DataManager.Instance.Create(subAction);
            TipsManager.Instance.Initialize();

            progressCallback.Invoke(data, 1);
        }, 30);
        m_lstGameInitDatas.Add(gameInitData);

        //4、GVoice初始化
        gameInitData = GameInitData.Create(GameInitDataType.GVoice, "GVoice初始化", (progressCallback, data) =>
        {
            //GVoice初始化
            GVoiceManger.Instance.InitGvoice();
            progressCallback.Invoke(data, 1);
        });
        m_lstGameInitDatas.Add(gameInitData);
    }
Exemplo n.º 11
0
 void onClick_JuQing_Btn(GameObject caster)
 {
     SequencerManager.Instance().PlaySequencer("sequencer/SequenceStory-kaichang01.xml");
 }