+3
Answered

How to display Time counter (seconds) when the player returns the time?

arkdzo 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 6

Hi, i want to display time counter (seconds), which shows the remaining time of time returning, when the player returns the time... I tried to use your variable "Computed Time", but it can take negative values.

Chronos Version:
2.4.7
Unity Version:
5.5.0f3
GOOD, I'M SATISFIED
Satisfaction mark by arkdzo 3 years ago
Answered

I'm not sure I understand why you can't use computed time.

If you want to cap the computed time at zero, you can simply use:

Mathf.Max(0, GetComponent<Timeline>().time);

No, i mean...How to check, how many seconds of recorded time with Timeline component left???

Pending Review

Hi arkdzo,

Unfortunately, as of now, there isn't an API hook for getting the length of the available rewind. I've taken a note to look into adding one in the future.

You can get the maximum time of the rewind with Timeline.recordingDuration.

You can also use the messages OnStartRewind and OnStopRewind sent by the timeline component in your Mono behaviours.

This way, in the mean time, you could calculate the amount of available rewind manually.

+1
Answered

Hi Arkdzo,

Version 2.4.9 will include a new property on recordable components called availableRewindDuration.

For example:

Debug.Log(myTimeline.transform.availableRewindDuration);

Thanks a lot! When we can expect a new version (2.4.9)?

+1

I'll submit it for review this weekend, so hopefully the UAS team will have it approved early next week.