Exemple #1
0
        public override void Update()
        {
            if (timer_start_wait > 0)
            {
                timer_start_wait--;
                return;
            }

            var g3d_map = GameMain.GetInstance().g3d_map;
            var t       = timer; if (t >= shoot_time)
            {
                t = (int)shoot_time - 1;
            }
            var xz_time = (int)(t * correct_time_to_xz);
            var y_time  = (int)(t * correct_time_to_y);
            var now_x   = route_xz_list[xz_time].X * correct;
            var now_y   = route_y_list[y_time].Y * correct;
            var now_z   = route_xz_list[xz_time].Y * correct;

            // 回転で対応するのが難しかったので
            // 矢にモーションを付けて、角度をつけるようにした
            // 時刻0f:90度 → 10f:0度 →20f:-90度
            // と、移り変わるので、角度から目標の時刻を算出する
            var motion_frame_rot = direction_list[y_time].rot * 180.0 / Math.PI;
            var motion_frame     = 0.0f;

            if (motion_frame_rot > 0) // 0度 <  < 90度
            {
                motion_frame = (float)((90.0 - motion_frame_rot) / 9.0);
            }
            else if (motion_frame_rot == 0.0) //  0度
            {
                motion_frame = (float)(10.0);
            }
            else if (motion_frame_rot == -90.0) // -90度
            {
                motion_frame = (float)(20.0);
            }
            else // -0度 <  < -90度
            {
                motion_frame = (float)(10.0 + (-motion_frame_rot) / 9.0);
            }

            model_arrow.Pos(now_x, now_y, now_z);
            model_arrow.Rot(0, rot_y, 0);
            model_arrow.SetMotionDirectFrame(0, motion_frame);
            model_arrow.Update();


            timer++;

            if (timer >= 100)
            {
                is_end = true;
            }
        }