Example #1
0
        IEnumerator loop()
        {
            replay_manager_.startRecording((double)Time.time);
            for (var i = 0; i < 7; ++i)
            {
                MyTransform tfm = new MyTransform();
                tfm.position_ = new Vector3(i, 0f, 0f);
                try {
                    replay_manager_.update((double)i, ref tfm, false /* is_fire_button_pressed */);
                } catch (System.Exception e) {
                    Debug.LogError(e);
                }
            }
            replay_manager_.stopRecording();

            yield return(null);

            replay_manager_.startPlaying((double)Time.time, null /* player */);
            for (var i = 0; i < 24; ++i)
            {
                MyTransform tfm = new MyTransform();
                try {
                    bool is_fire_button_pressed = false;
                    replay_manager_.getFrameData((double)(i - 2) * 0.33333, ref tfm, ref is_fire_button_pressed);
                } catch (System.Exception e) {
                    Debug.LogError(e);
                }
                Debug.LogFormat("{0}:pos_x:{1}", (double)(i - 2) * 0.33333, tfm.position_.x);
            }
            replay_manager_.stopPlaying(null /* player */);
            yield return(null);
        }
Example #2
0
        private void internal_update_for_replay(float dt, double update_time)
        {
            MyTransform transform = new MyTransform();
            bool        success   = replay_manager_.getFrameData(update_time, ref transform, ref fire_button_);

            if (!success)
            {
                SystemManager.Instance.restart();
            }
            rigidbody_.transform_ = transform;
            update_attack(update_time, true /* replay */);
            update_collision(update_time);
        }