private void OnItemCollision(Collision2D collision) { if (collision.gameObject.CompareTag("Coin")) { Destroy(collision.gameObject); CarObj.Coins += 1; if (!CarObj.CompetitorMode) { HudObj.ShowCoinsUI(); } if (SfxManagerObj != null) { SfxManagerObj.PlayCoinSfx(); } } if (!collision.gameObject.CompareTag($"HP")) { return; } Destroy(collision.gameObject); if (CarObj != null) { CarObj.RecountHealth(+1); } }
// ReSharper disable Unity.PerformanceAnalysis public void AngleChecker() { if (Mathf.Abs(transform.rotation.z) > 0.5f) { if (!CompetitorMode) { if ((int)_angleTime == (int)AngleTIMER) { HudObj.TurnOverCounter(true); } _angleTime -= Time.fixedDeltaTime; if (_angleTime <= 0) { var position = transform.position; position = new Vector3(position.x, position.y + 2f, position.z); transform.position = position; transform.rotation = Quaternion.Euler(0, 0, 0); CarObj.RecountHealth(-1); HudObj.TurnOverCounter(false); _angleTime = AngleTIMER; } else { var obj = HudObj.AngleTimerObj; if (obj is { })
public IEnumerable <CarObj> GetAll(int start, int end, string lang = "en") { IEnumerable <CarsModel> cars = repo.GetAll(start, end); IEnumerable <CarObj> carsObj = new List <CarObj>(); Messages m = GetMessages(lang); foreach (CarsModel car in cars) { CarObj carObj = new CarObj(); carObj.Body = m.GetMessage(car.Body); //Here we set other attributes with their messages in specific language carsObj.Append(carObj); } return(carsObj); }
public void onRewardedVideoFinished(double amount, string name) { Debug.Log("onRewardedVideoFinished"); CarObj.RecountHealth(+1); HudObj.GameContinue(); }