コード例 #1
0
        public IEnumerable <Wait> RoutineStartLevel()
        {
            var tile        = PlayerCurio.GetMainTile();
            var movable     = PlayerCurio.GetBehavior <BehaviorMovable>();
            var orientation = PlayerCurio.GetBehavior <BehaviorOrientable>();
            var start       = tile.GetBehavior <BehaviorLevelStart>();
            var player      = PlayerCurio.GetBehavior <BehaviorPlayer>();

            player.LevelTransition = true;
            orientation.OrientTo(Util.PointToAngle(start.Direction) + MathHelper.Pi);
            var pos = tile.VisualPosition;

            CameraCurio.TeleportVisual(GetOutsidePosition(pos, start.Direction, 150));
            PlayerCurio.TeleportVisual(GetOutsidePosition(pos, start.Direction, 200));
            player.Fade.Set(0);
            yield return(new WaitTime(100));

            CameraCurio.MoveVisual(tile.VisualPosition, LerpHelper.QuadraticOut, new SliderScene(this, 150));
            yield return(new WaitTime(100));

            CurrentTheme?.Stop();
            CurrentTheme = new MusicEffect(Theme);
            CurrentTheme.Volume.Set(0, 1, LerpHelper.QuadraticIn, 20);
            CurrentTheme.Play();
            SoundIngress.Play(1f, 0f, 0f);
            player.Fade.Set(1, LerpHelper.QuarticOut, 70);
            PlayerCurio.MoveVisual(tile.VisualPosition, LerpHelper.QuarticOut, new SliderScene(this, 100));
            yield return(new WaitTime(70));

            player.LevelTransition = false;
            yield return(new WaitTime(30));
        }