public void AsteroidKilled(GameObject deadAsteroid) { CreatePopupText("" + asteroidPoints, deadAsteroid.transform, scoreFontSize); GameObject energyExplosion = Instantiate(energyExplosionPrefab); energyExplosion.transform.position = deadAsteroid.transform.position; ParticleSystem parts = energyExplosion.GetComponent <ParticleSystem>(); float duration = parts.main.duration; Destroy(deadAsteroid); Destroy(energyExplosion, duration); //Add points scoreController.AddPoints(asteroidPoints); }
public void CompareGreetings() { if (CurrentGameState == GameState.CompareGreetings) { InputController.WatchSceneGesture(); if (Player.PlayerGreeting == CurrentGuest.WantedGreeting) { CurrentGuest.SetGreetedRight(true); ScoreController.AddCombo(CurrentGuest.combo); ScoreController.AddPoints(CurrentGuest.points * ScoreController.GetCombo()); } else { CurrentGuest.SetGreetedRight(false); ScoreController.ResetCombo(); } Timer.EndTimer(); CurrentGuest.SetGreetingTime(Timer.Time); CurrentGameState = GameState.WatchScene; } }
void OnMouseDown() { if (readyEvent.HasStarted() && timerController.isRunning()) { if (click != null) { click.Play(); } StartClickAnimation(); if (clicked) { scoreController.RemovePoins(5); } else { clicked = true; if (this.GetComponent <SpriteRenderer> ().sprite == target) { scoreController.AddPoints(20); } else { scoreController.RemovePoins(10); } } } }
void OnCollisionEnter(Collision collision) { if (alreadyCalled) { return; } alreadyCalled = true; collision.rigidbody.AddForce(this.transform.forward * Force, ForceMode.Impulse); audioSource.PlayOneShot(audioSettings.SlingshotSound); scoreController.AddPoints(this.Points); Debug.Log("slingshot touched"); }
void OnCollisionEnter(Collision collision) { if (alreadyCalled) { return; } alreadyCalled = true; collision.rigidbody.AddForce(-collision.contacts[0].normal * Force, ForceMode.Impulse); audioSource.PlayOneShot(audioSettings.BumperSound); scoreController.AddPoints(this.Points); Debug.Log("BUMP!"); }
void OnCollisionEnter(Collision collision) { if (alreadyCalled) { return; } alreadyCalled = true; collision.rigidbody.AddForce(this.transform.forward * Force, ForceMode.Impulse); audioSource.PlayOneShot(audioSettings.StandUpSound); scoreController.AddPoints(this.Points); Debug.Log("Standup touched"); StopAllCoroutines(); StartCoroutine(ChangeLights()); }