void AnimationPlayer::_notification(int p_what) { switch(p_what) { case NOTIFICATION_ENTER_SCENE: { if (!processing) { //make sure that a previous process state was not saved //only process if "processing" is set set_fixed_process(false); set_process(false); } //_set_process(false); clear_caches(); } break; case NOTIFICATION_READY: { if (!get_scene()->is_editor_hint() && animation_set.has(autoplay)) { play(autoplay); } } break; case NOTIFICATION_PROCESS: { if (animation_process_mode==ANIMATION_PROCESS_FIXED) break; if (processing) _animation_process( get_process_delta_time() ); } break; case NOTIFICATION_FIXED_PROCESS: { if (animation_process_mode==ANIMATION_PROCESS_IDLE) break; if (processing) _animation_process( get_fixed_process_delta_time() ); } break; case NOTIFICATION_EXIT_SCENE: { stop_all(); clear_caches(); } break; } }
void AnimationPlayer::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { if (!processing) { //make sure that a previous process state was not saved //only process if "processing" is set set_physics_process(false); set_process(false); } //_set_process(false); clear_caches(); } break; case NOTIFICATION_READY: { if (!Engine::get_singleton()->is_editor_hint() && animation_set.has(autoplay)) { play(autoplay); _animation_process(0); } } break; case NOTIFICATION_INTERNAL_PROCESS: { if (animation_process_mode == ANIMATION_PROCESS_PHYSICS) break; if (processing) _animation_process(get_process_delta_time()); } break; case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { if (animation_process_mode == ANIMATION_PROCESS_IDLE) break; if (processing) _animation_process(get_physics_process_delta_time()); } break; case NOTIFICATION_EXIT_TREE: { //stop_all(); clear_caches(); } break; } }
void AnimationPlayer::seek(float p_time, bool p_update) { if (!playback.current.from) { if (playback.assigned) set_current_animation(playback.assigned); ERR_FAIL_COND(!playback.current.from); } playback.current.pos = p_time; if (p_update) { _animation_process(0); } }
void AnimationPlayer::seek_delta(float p_time, float p_delta) { if (!playback.current.from) { if (playback.assigned) set_current_animation(playback.assigned); ERR_FAIL_COND(!playback.current.from); } playback.current.pos = p_time - p_delta; if (speed_scale != 0.0) p_delta /= speed_scale; _animation_process(p_delta); //playback.current.pos=p_time; }
void AnimationPlayer::seek(float p_time, bool p_update) { if (!playback.current.from) { if (playback.assigned) { ERR_FAIL_COND(!animation_set.has(playback.assigned)); playback.current.from = &animation_set[playback.assigned]; } ERR_FAIL_COND(!playback.current.from); } playback.current.pos = p_time; if (p_update) { _animation_process(0); } }
void AnimationPlayer::advance(float p_time) { _animation_process(p_time); }