public void ResetXPosition() { OnZero?.Invoke(); player.transform.position = new Vector3(0, player.transform.position.y, 0); mainCamera.transform.position = new Vector3(platformConfig.CameraOffset, mainCamera.transform.position.y, mainCamera.transform.position.z); OnReady?.Invoke(); }
public void countdown() { totalUnit -= 1; if (totalUnit == 0) { OnZero.Invoke(); } }
public void Decrease() { Count--; if (Count != 0) { return; } OnZero?.Invoke(); _allowIncrease.Set(); }
public void UpdateCurrent(int amount) { current -= amount; if (current > max) { current = max; } else if (current <= 0) { OnZero?.Invoke(this); } OnChanged?.Invoke(this); }
private void Update() { if (!IsCounting) { return; } time += Time.deltaTime; if (time > 1.0f) { Count--; time -= 1.0f; } if (Count == 0) { IsCounting = false; OnZero?.Invoke(this, EventArgs.Empty); } }