// Use this for initialization void Start() { DontDestroyOnLoad(gameObject); m_screenGUI = GetComponent <ScreenGUI>(); score = 0; cherriesEaten = 0; plumsEaten = 0; appleEaten = false; mulSet = false; m_screenGUI.updateScoreLabel(this.score); }
// Update is called once per frame void Update() { score = cherriesEaten * cherryPoints + plumsEaten * plumPoints; if (!mulSet) { multiplier = head.getNumberOfSegments() + 1; } if (appleEaten) { score += applePoints; } m_screenGUI.updateScoreLabel(this.score); }