コード例 #1
0
        private void PlaybackObjectBegin(Entity entity)
        {
            if (entity is AnalogEntity aobj)
            {
                if (entity.IsInstant)
                {
                    int dir = -MathL.Sign(aobj.FinalValue - aobj.InitialValue);
                    m_highwayControl.ShakeCamera(dir);

#if false
                    if (aobj.InitialValue == (aobj.Lane == 6 ? 0 : 1) && aobj.NextConnected == null)
                    {
                        m_highwayControl.ApplyRollImpulse(-dir);
                    }
#endif

                    //if (m_judge[(int)entity.Lane].IsBeingPlayed) m_slamSample.Replay();
                }

                if (aobj.PreviousConnected == null)
                {
                    if (!AreLasersActive)
                    {
                        m_audioController.SetEffect(6, CurrentQuarterNodeDuration, currentLaserEffectDef, BASE_LASER_MIX);
                    }
                    currentActiveLasers[(int)entity.Lane - 6] = true;
                }

                m_activeObjects[(int)entity.Lane] = aobj.Head;
            }
            else if (entity is ButtonEntity bobj)
            {
                //if (bobj.HasEffect) m_audioController.SetEffect(obj.Stream, CurrentQuarterNodeDuration, bobj.Effect);
                //else m_audioController.RemoveEffect(obj.Stream);

                // NOTE(local): can move this out for analog as well, but it doesn't matter RN
                if (!bobj.IsInstant)
                {
                    m_activeObjects[(int)entity.Lane] = entity;
                }
            }
        }
コード例 #2
0
        private void PlaybackObjectBegin(ChartObject obj)
        {
            if (obj is AnalogObject aobj)
            {
                if (obj.IsInstant)
                {
                    int dir = -MathL.Sign(aobj.FinalValue - aobj.InitialValue);
                    m_highwayControl.ShakeCamera(dir);

                    if (aobj.InitialValue == (aobj.Stream == 6 ? 0 : 1) && aobj.NextConnected == null)
                    {
                        m_highwayControl.ApplyRollImpulse(-dir);
                    }
                    m_slamSample.Play();
                }

                if (aobj.PreviousConnected == null)
                {
                    if (!AreLasersActive)
                    {
                        m_audioController.SetEffect(6, CurrentQuarterNodeDuration, currentLaserEffectDef, BASE_LASER_MIX);
                    }
                    currentActiveLasers[obj.Stream - 6] = true;
                }

                m_activeObjects[obj.Stream] = aobj.Head;
            }
            else if (obj is ButtonObject bobj)
            {
                //if (bobj.HasEffect) m_audioController.SetEffect(obj.Stream, CurrentQuarterNodeDuration, bobj.Effect);
                //else m_audioController.RemoveEffect(obj.Stream);

                // NOTE(local): can move this out for analog as well, but it doesn't matter RN
                if (!bobj.IsInstant)
                {
                    m_activeObjects[obj.Stream] = obj;
                }
            }
        }