Example #1
0
 private void Start()
 {
     rb           = GetComponent <Rigidbody2D>();
     curCharacter = OptionSceneManager.getCurCharacter();
     if (curCharacter != null)
     {
         transform.GetComponent <SpriteRenderer>().sprite = curCharacter;
     }
 }
Example #2
0
    // 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;
        }
    }