Skip to content
Discussion options

You must be logged in to vote

Services.GetService<IGame>().UpdateTime.Factor = 0; - pause, Services.GetService<IGame>().UpdateTime.Factor = 1; - run.
this pause method will only work with animations, particles and physics.
If you want use in scrips pause logic for another things, you must have global variable, bool Pause {get; set;} = false; for example,
and do in every Update() and Execute() methods in all scripts

if(gamePause) return;
// or
// if(Services.GetService<IGame>().UpdateTime.Factor < 1;) return;
// your logic, for example: 
Entity.Transform.Position += new Vector3(0.5, 0, 0); 
....

Best way to create global variable is a your class

public class Pause : GameSystemBase
{
    public bool GamePause {get; set…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Asatte32
Comment options

@w0wca7a
Comment options

Answer selected by Asatte32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants