//executes the behavior for single-target rewinding. If the player pauses a new thing, the old thing will unpause. void SingleSelect(RewindOverseer o) { if (currentTarget == o) //if the object is already the selected object... { currentTarget.SetTimeControl(!currentTarget.IsRewinding()); //toggle whether the object is rewinding. } else //otherwise... { if (currentTarget != null) { currentTarget.SetTimeControl(false); //stop the old target rewinding, } currentTarget = o; //set a new target, currentTarget.SetTimeControl(true); //begin rewinding the new target. } }
/* * executes the behavior for multi-target rewinding. If the player pauses a new thing, the old thing will * remain paused until the player selects it again and then right-clicks it once more. */ void MultiSelect(RewindOverseer o) { if (currentTarget == o) { currentTarget.SetTimeControl(!currentTarget.IsRewinding()); } else { currentTarget = o; currentTarget.SetTimeControl(true); } }
void UnpauseObject(RewindOverseer o) { o.SetTimeControl(false); }
void PauseObject(RewindOverseer o) { o.SetTimeControl(true); }