mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/MI-38.git
synced 2026-01-24 06:25:39 +03:00
04.07.2022
This commit is contained in:
45
Heli_with_panels/Assets/Scripts/Panel2D/0115/BarPressure.cs
Normal file
45
Heli_with_panels/Assets/Scripts/Panel2D/0115/BarPressure.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
//TextBarPressure
|
||||
public class BarPressure : MonoBehaviour
|
||||
{
|
||||
[HideInInspector]
|
||||
public string textValue_="";
|
||||
|
||||
private (string, string) defaultValue_ = ("766 мм рт.ст", "1013 гѕ");
|
||||
private TextMeshPro text_;
|
||||
//private Text text_;
|
||||
void Start()
|
||||
{
|
||||
text_ = this.GetComponent<TextMeshPro>();
|
||||
var txt= (textValue_ == "") ? defaultValue_.Item1 : textValue_;
|
||||
text_.SetText(txt);
|
||||
/*text_ = this.gameObject.GetComponent<Text>();
|
||||
|
||||
text_.text = (textValue_ == "") ? defaultValue_.Item1 : textValue_;*/
|
||||
}
|
||||
|
||||
private void OnMouseDown()//нажатие на счетчик
|
||||
{
|
||||
if(textValue_ == "")
|
||||
{
|
||||
var txt = (text_.text == defaultValue_.Item2) ? defaultValue_.Item1 : defaultValue_.Item2;
|
||||
text_.SetText(txt);
|
||||
}
|
||||
else
|
||||
{
|
||||
text_.SetText(textValue_);
|
||||
}
|
||||
/*if(textValue_ == "")
|
||||
{
|
||||
text_.text = (text_.text == defaultValue_.Item2) ? defaultValue_.Item1 : defaultValue_.Item2;
|
||||
}
|
||||
else
|
||||
{
|
||||
text_.text = textValue_;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user