public void SaveWithCleared(DeathCounts deathCounts, CoinScore coinScore = null) { this.deathCounts = deathCounts; this.LastCleared = DateTime.Now; this.state = StageState.cleared; this.coinScore = coinScore; }
// Start is called before the first frame update void Start() { if (instance == null) { instance = this; } }
public void OnCoinClicked() { // Instantiate the CoinPoof Prefab where this coin is located // Make sure the poof animates vertically // Destroy this coin. Check the Unity documentation on how to use Destroy Quaternion rotation = Quaternion.Euler(270, 0, 0); GameObject poof = (GameObject)Instantiate(CoinPoofPrefab, transform.position, rotation); CoinScore coinScoreScript = (CoinScore)CoinScoreText.GetComponent(typeof(CoinScore)); coinScoreScript.IncreaseScore(); // If sound is played from poof, Destroy can be called here. // If sound is played by this script, call the PlayAudio() coroutine //Destroy (gameObject); StartCoroutine(PlayAudio()); }
public void SetCoinScore(CoinScore coinScore) { this._coinScore = coinScore; this.ResetDisplay(); }
public void Init(int stageID) { this.CoinScore = new CoinScore(stageID); }
public void PlayEndingScoreIncrementSound() { CoinScore.Play(); }