BackgroundRepeater.Start C# (CSharp) Method

Start() public method

public Start ( ) : void
return void
    public void Start()
    {
        var height = Camera.main.orthographicSize * 2;
        this.screenWidth = Camera.main.aspect * height;
    }

Usage Example

		public void RepeatingWithExceptionsGood() {
			var bkg = new BackgroundRepeater(SometimesException) {
				Cooldown = TimeSpan.FromMilliseconds(1D),
				IsCatchExceptions = true,
			};

			_counter = 0;
			Console.WriteLine(_counter);

			bkg.Start();
			SpinWait.SpinUntil(() => _counter > 100);
			bkg.Stop();

			Console.WriteLine(_counter);

			var c = _counter;
			Thread.Sleep(500);

			if (_counter > c)
				Assert.Fail("repeating not stopped");

			if (4 > c)
				Assert.Fail("where all repeating?");

			Console.WriteLine(_counter);
			Assert.IsFalse(bkg.IsStarted());
		}
All Usage Examples Of BackgroundRepeater::Start