February 2018
Beginner to intermediate
250 pages
6h 11m
English
Now we will focus on building a controller script for the mole game. This script will manage the Score Board text elements and the starting times for the moles:
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;public class MoleGameController : MonoBehaviour { [SerializeField] Text timerUI, scoreUI; [SerializeField] float startingTimeInSeconds = 30f; List<MoleController> moles; int score = 0; float timer = 0f; bool isTiming; void Start() ...Read now
Unlock full access