private void Start() { rb = GetComponent <Rigidbody2D>(); curCharacter = OptionSceneManager.getCurCharacter(); if (curCharacter != null) { transform.GetComponent <SpriteRenderer>().sprite = curCharacter; } }
// Start is called before the first frame update void Start() { btn = target.GetComponent <Button>(); btn.onClick.AddListener(restart); scoreValue = Mathf.RoundToInt(ScoreManager.getScoreValue()); scoreText.text = "Score : " + scoreValue; gameOver = GetComponent <AudioSource>(); gameOver.Play(); curChara = OptionSceneManager.getCurCharacter(); if (curChara != null) { player.sprite = curChara; } }