Exemplo n.º 1
0
        /// <summary>
        /// Section 재생 준비
        /// </summary>
        public void StartSection(Data.Section section, BeatSyncClock clock, TransitionType ttype, double startTime = 0)
        {
            EndSection();                                                                                                       // 이전에 재생중이었을 수도 있는 섹션을 강제 종료


            // 초기화

            m_sectionData = section;
            m_clock       = clock;

            m_startTransition = ttype;
            m_endTransition   = TransitionType.None;
            isOnTransition    = false;


            // 텐션 관련 설정
            for (int i = 0; i < Data.Section.c_maxLayerPerSection; i++)
            {
                var layer = section.GetLayer(i);
                if (layer != null)
                {
                    layer.SetAutomationTarget(m_tensionAutomationTargets[i]);
                }
            }
            section.tension = m_tension;


            if (startTime == 0)                                                                                                 // 시작 시간이 지정되지 않은 경우 다음 안전한 비트를 시작 시간으로
            {
                startTime = m_clock.CalcNextSafeBeatTime();
            }

            m_updateCo = m_context.StartCoroutine(UpdateStateCo(startTime));                    // 코루틴 시작
        }
Exemplo n.º 2
0
        /// <summary>
        /// Section 재생 준비
        /// </summary>
        public void StartSection(Data.Section section, BeatSyncClock clock, TransitionType ttype, double startTime = 0)
        {
            EndSection();												// 이전에 재생중이었을 수도 있는 섹션을 강제 종료

            // 초기화

            m_sectionData		= section;
            m_clock				= clock;

            m_startTransition	= ttype;
            m_endTransition		= TransitionType.None;
            isOnTransition		= false;

            // 텐션 관련 설정
            for (int i = 0; i < Data.Section.c_maxLayerPerSection; i++)
            {
                var layer		= section.GetLayer(i);
                if (layer != null)
                {
                    layer.SetAutomationTarget(m_tensionAutomationTargets[i]);
                }
            }
            section.tension		= m_tension;

            if (startTime == 0)											// 시작 시간이 지정되지 않은 경우 다음 안전한 비트를 시작 시간으로
            {
                startTime		= m_clock.CalcNextSafeBeatTime();
            }

            m_updateCo	= m_context.StartCoroutine(UpdateStateCo(startTime));	// 코루틴 시작
        }