private void Start() { // will add AFPSCounter to the scene if it not exists // you don't need to call it if you already have AFPSCounter in the scene AFPSCounter.AddToScene(); AFPSCounter.Instance.fpsCounter.OnFpsLevelChange += OnFPSLevelChanged; }
private void Start() { // will add AFPSCounter to the scene if it not exists // you don't need to call it if you already have AFPSCounter in the scene var newCounterInstance = AFPSCounter.AddToScene(); // you also may get the instance at any time // using AFPSCounter.Instance property newCounterInstance.fpsCounter.OnFPSLevelChange += OnFPSLevelChanged; }
private void Awake() { AFPSCounter.AddToScene(); AFPSCounter.Instance.fpsCounter.onFPSLevelChange += OnFPSLevelChanged; }