| 12345678910111213141516171819202122232425262728293031323334353637 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class WinOrLose : MonoBehaviour
- {
- [SerializeField]
- private UnityEngine.UI.Text textfield;
- [SerializeField]
- private GameObject disAndEnableObject;
- [SerializeField]
- private Station winningStation;
- [SerializeField]
- private Player player;
- // Use this for initialization
- void Start ()
- {
- disAndEnableObject.SetActive(false);
- }
-
- // Update is called once per frame
- void Update ()
- {
- if (winningStation.powerLevel >= 99)
- {
- textfield.text = "You won by uploading 1000 power!";
- disAndEnableObject.SetActive(true);
- }
- else if (player.PowerLevel <= 0)
- {
- textfield.text = "You ran out of power!";
- disAndEnableObject.SetActive(true);
- }
- }
- }
|