@Override
	public void update() {
		double elapsed = this.timer.getTime() - this.startTime;
		if (elapsed >= fadeTime) {
			this.visual.getColor().setAlpha(this.targetAlpha);
			TaskService.getInstance(getCore()).destroyTask(this);
			if (this.finishedEventId != null) {
				EventService.getInstance(getCore()).dispatchEvent(new SimpleEvent(this.finishedEventId));
			}
			return;
		}
		
		double alpha = elapsed / this.fadeTime;
		this.visual.getColor().setAlpha(this.targetAlpha * alpha);
	}