public void destroySeqObjects()
    {
        Destroy(seqObject1.gameObject);
        Destroy(seqObject2.gameObject);

        seqObject1 = seqObject2 = null;
    }
        public override void OnEnter()
        {
            if (Fsm == null)
            {
                return;
            }

            GameObject go = Fsm.GetOwnerDefaultTarget(sequenceToPlay);

            if (!go)
            {
                return;
            }

            USSequencer sequence = go.GetComponent <USSequencer>();

            if (!go)
            {
                return;
            }

            sequence.PlaybackFinished += OnSequenceFinished;
            sequence.RunningTime       = timeToStart.Value;
            sequence.Play();

            Fsm.Event(startedPlayback);
        }
    IEnumerator CutSceneForStart()
    {
        GameObject obj = GameObject.Find("Sequence");

        USSequencer seq = obj.GetComponent <USSequencer>();

        if (null == seq)
        {
            yield break;
        }

        //Transform timelineTrans = seq.transform.FindChild("Timelines for StartCameraRoot");
        //USTimelineContainer timeline = timelineTrans.GetComponent<USTimelineContainer>();
        //timeline.AffectedObject = startCamObj.transform;

        //USTimelineEvent evt = timeline.GetComponentInChildren<USTimelineEvent>();
        //USMatchObjectEvent matchEvt = evt.GetComponentInChildren<USMatchObjectEvent>();
        // matchEvt.objectToMatch = CameraManager.instance.mainCamera.gameObject;

        seq.PlaybackStarted = (sequence) =>
        {
        };
        seq.PlaybackFinished = (sequence) =>
        {
        };
        seq.Play();
    }
示例#4
0
        public override void OnEnter()
        {
            if (Fsm == null)
            {
                return;
            }

            GameObject go = Fsm.GetOwnerDefaultTarget(sequenceToPlay);

            if (!go)
            {
                return;
            }

            USSequencer sequence = go.GetComponent <USSequencer>();

            if (!go)
            {
                return;
            }

            sequence.RunningTime = sequenceTime.Value;

            Finish();
        }
示例#5
0
 private void PlayMovie(USSequencer movie)
 {
     this.mMovie = movie;
     this.mMovie.PlaybackFinished = new USSequencer.PlaybackDelegate(this.OnMoviePlayFinished);
     this.mMovie.PlaybackStopped  = new USSequencer.PlaybackDelegate(this.OnMoviePlayFinished);
     this.mMovie.Play();
 }
示例#6
0
 private void Start_Rev_Plot_Res(int id)
 {
     Debug.Log("请求准备需要加载的剧情资源,剧情ID为" + id);
     this.m_curSequence = null;
     Application.LoadLevelAdditive("p" + id.ToString());
     this.m_ePlotStep = PlotMain.ENUM_POLTSTEP.PLSP_Req_Res;
 }
示例#7
0
        /// <summary>
        /// 播放过场。
        /// </summary>
        /// <param name="path">过场动画路径。</param>
        public void TryPlayerCutScene(LuaTable cfg)
        {
            //上一个动画还未结束
            if (Time.realtimeSinceStartup < m_LastPlayStopTime)
            {
                return;
            }

            //首次播放检查
            int id = cfg.Get <int>("id");

            if (cfg.Get <int>("time") == TRIGGER_TIME_ONCE)
            {
                if (IsHavePlay(id))
                {
                    return;
                }
                else
                {
                    SetHavePlay(id);
                }
            }

            //播放动画
            GameObject prefab = (GameObject)CoreEntry.gResLoader.Load(cfg.Get <string>("animation"), typeof(GameObject));

            if (prefab == null)
            {
                LogMgr.LogError("加载过场动画失败 path:{0}", cfg.Get <string>("animation"));
                return;
            }
            GameObject  obj = GameObject.Instantiate(prefab) as GameObject;
            USSequencer us  = obj.GetComponent <USSequencer>();

            if (us == null)
            {
                LogMgr.LogError("播放场动画失败,未找到USSequencer组建 path:{0}", cfg.Get <string>("animation"));
                return;
            }
            us.PlaybackFinished += OnAniEnd;
            m_CurID              = id;
            OnAniStart(us);

            //保存结束时间,在次期间不再播动画
            float       duration = 0;
            AutoDestroy ad       = obj.GetComponent <AutoDestroy>();

            if (ad != null)
            {
                duration = ad.Delay;
            }
            m_LastPlayStopTime = Time.realtimeSinceStartup + duration;
#if UNITY_EDITOR
            LogMgr.Log("播放过场动画 duration:{0} path:{1}", duration, cfg.Get <string>("animation"));
#endif
        }
示例#8
0
 private void OnAniStart(USSequencer us)
 {
     m_CurAni = us;
     m_CurAni.Play();
     PlayerData.Instance.RideData.SendChangeRideStateRequest(0); //进入剧情动画需要下马
     SetJoystickEnable(false);                                   //播放过场动画开始时禁用摇杆
     OpenUI();
     CoreEntry.gAutoAIMgr.IsSuspend = true;
     CoreEntry.gEventMgr.TriggerEvent(GameEvent.GE_CC_StoryStart, EventParameter.Get());
 }
示例#9
0
 private void OnAniEnd(USSequencer us)
 {
     if (m_CurAni == us && m_CurAni != null)
     {
         GameObject.Destroy(m_CurAni.gameObject, 0.1f);
         m_CurAni = null;
         m_CurID  = 0;
         SetJoystickEnable(true);    //播放过场动画结束时启用摇杆
         CloseUI();
         CoreEntry.gAutoAIMgr.IsSuspend = false;
         CoreEntry.gEventMgr.TriggerEvent(GameEvent.GE_CC_StoryEnd, EventParameter.Get());
     }
 }
示例#10
0
 public void Start(GameObject sequencer, GameObject mainRole, GameObject camera, Action callFunc)
 {
     if (this.mMovie == null)
     {
         this.mCallFunAction = callFunc;
         this.RoleModel      = mainRole;
         this.mCamera        = camera;
         this.misEditor      = false;
         if (sequencer != null)
         {
             USSequencer component = sequencer.GetComponent <USSequencer>();
             if (component != null)
             {
                 this.PlayMovie(component);
             }
         }
     }
 }
示例#11
0
 public void Start(GameObject sequencer, GameObject mainRole, GameObject camera, SequenceManager.CGPlayComplete callFunc, string taskId = "")
 {
     if (this.mMovie == null)
     {
         this.mCallFunc = callFunc;
         this.RoleModel = mainRole;
         this.mCamera   = camera;
         this.mTaskId   = taskId;
         this.misEditor = false;
         if (sequencer != null)
         {
             USSequencer component = sequencer.GetComponent <USSequencer>();
             if (component != null)
             {
                 this.PlayMovie(component);
             }
         }
     }
 }
示例#12
0
 private void OnMoviePlayFinished(USSequencer sequencer)
 {
     this.misEditor = true;
     if (this.mCallFunc != null)
     {
         this.mCallFunc(this.mTaskId, this.RoleModel);
         this.mCallFunc = null;
     }
     if (this.mMovie != null)
     {
         UnityEngine.Object.Destroy(this.mMovie.gameObject);
         this.mMovie = null;
     }
     if (this.mCallFunAction != null)
     {
         this.mCallFunAction();
         this.mCallFunAction = null;
     }
     this.Clear();
 }
示例#13
0
 private void Start_Rev_Play_Plot()
 {
     if (this.m_ePlotStep == PlotMain.ENUM_POLTSTEP.PLSP_Wait_Res)
     {
         this.m_ePlotStep = PlotMain.ENUM_POLTSTEP.PLSP_Playing_Plot;
         Debug.Log("开启剧情了.................");
         this.m_curSequence.Play();
         this.m_curSequence = null;
         this.m_GamePlotSeq = GameObject.Find("Sequence");
         if (this.m_GamePlotSeq == null)
         {
             Debug.Log("剧情资源错误!!!之后会无法释放..............");
             Application.Quit();
         }
         else
         {
             Debug.Log("成功连接到了资源");
         }
     }
 }
 private void OnSequenceFinished(USSequencer sequence)
 {
     Fsm.Event(finishEvent);
     Finish();
 }
示例#15
0
 void Awake()
 {
     base.Awake();
     _sequence = GetComponent <USSequencer>();
 }
 private void Awake()
 {
     _uSequencer = GetComponent <USSequencer>();
 }