C# Класс kOS.Safe.Execution.YieldFinishedGameTimer

A kind of YieldFinishedDetector for use when you just want a 'dumb' timer based on the KSP game clock (note: uses the game's notion of simulated time rather than the real-time wall clock. I.e. the timer is frozen for the duration of a FixedUpdate, and doesn't move at all if the game is paused, etc.).

You'd have to make a slightly different derivative of YieldFinishedDetector in order to base your timer on the out-of-game wall clock.
Наследование: YieldFinishedDetector
Показать файл Открыть проект

Открытые методы

Метод Описание
Begin ( SafeSharedObjects shared ) : void

Need to track the shared object in order to query current game time. The timer starts "counting" from where the clock was when the CPU calls this (which it does as soon as you do a YieldProgram() call.)

IsFinished ( ) : bool

Return true if the timer ran out, or false if the timer has not run out.

YieldFinishedGameTimer ( double duration )

Make a new timer that will expire after the given number of seconds have passed in game-clock time (not real-world time).

Описание методов

Begin() публичный Метод

Need to track the shared object in order to query current game time. The timer starts "counting" from where the clock was when the CPU calls this (which it does as soon as you do a YieldProgram() call.)
public Begin ( SafeSharedObjects shared ) : void
shared SafeSharedObjects
Результат void

IsFinished() публичный Метод

Return true if the timer ran out, or false if the timer has not run out.
public IsFinished ( ) : bool
Результат bool

YieldFinishedGameTimer() публичный Метод

Make a new timer that will expire after the given number of seconds have passed in game-clock time (not real-world time).
public YieldFinishedGameTimer ( double duration )
duration double