От: | falcoware | https://falcoware.com/rus/ | |
Дата: | 10.05.21 05:16 | ||
Оценка: |
using FalcoEngine;
using System;
using System.Collections;
using System.Collections.Generic;
public class UI : MonoBehaviour
{
public GameObject scoreTextObj;
public GameObject pressButtonObj;
Text ScoreText = null;
Button PressButton = null;
int nScore = 0;
void Start()
{
if (scoreTextObj != null) ScoreText = scoreTextObj.GetComponent<Text>();
if (pressButtonObj != null) PressButton = pressButtonObj.GetComponent<Button>();
ScoreText.text = "";
if (PressButton != null)
{
PressButton.onMouseUp += (UIElement sender, int btn, Vector2 cursorPos) =>
{
ScoreText.text = nScore.ToString();
nScore++;
};
}
}
void Update()
{
}
}