void Start() { ball = GameObject.FindObjectOfType <Ball>(); paddle = GameObject.FindObjectOfType <Paddle>(); lifeLeft = GameObject.FindObjectOfType <LifeLeft>(); paddleToBallVector = ball.transform.position - paddle.transform.position; }
public void LoadLevel(string name) { lifeLeft = GameObject.FindObjectOfType <LifeLeft>(); LifeLeft.livesLeft = 3; Brick.breakableBrickCount = 0; Debug.Log("Level load requested: " + name); SceneManager.LoadScene(name); lifeLeft.LoadSprites(); }
void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; GameObject.DontDestroyOnLoad(gameObject); } }