Day 23 — Getting started with the UI system

using UnityEngine.UI;[SerializeField]
private Text _scoreText;
public void UpdateScore(int playerScore)
{
_scoreText.text = "Score: " + playerScore;
}
_player = GameObject.Find("Player").GetComponent<Player>();
if (_player != null)
{
_player.AddScore(Random.Range(5, 20));
}
private int _score;
private UIManager _uiManager;
public void AddScore(int points)
{
_score += points;
_uiManager.UpdateScore(_score);
}
_uiManager = GameObject.Find("UIManager").GetComponent<UIManager>();

--

--

--

Hey and welcome! My name is Connor and my goal here is to put out a daily post for a full year about my game development journey.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Why your next hardware project should look like a software project

Time & Material and Work on a Website

Understanding My Stock Program

What is Travis CI and who uses it?

GIF of hacker at the computer — ASCII artwork

Detect and Find Faces & Landmarks (Eyes, Nose, Mouth) in an Image in Python

Replacing Wrapper classes with Java Records in Stream processing

Every three weeks or so GLAMtech links, September 2 2018

Building a Domain-Specific Language with Chrevrotain

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Connor Fullarton

Connor Fullarton

Hey and welcome! My name is Connor and my goal here is to put out a daily post for a full year about my game development journey.

More from Medium

CS371p Spring 2022 Wk5: Cristian Astorga

Assignment 3 — App Prototype & User Testing

Views In Database

Project 3 — Typography