mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/MI-38.git
synced 2026-01-24 02:55:39 +03:00
04.07.2022
This commit is contained in:
52
Heli_with_panels/Assets/MFI/IndicatorMFIRange.cs
Normal file
52
Heli_with_panels/Assets/MFI/IndicatorMFIRange.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class IndicatorMFIRange : MonoBehaviour
|
||||
{
|
||||
public float Range1 = 0;
|
||||
public float Range2 = 0;
|
||||
public float Range3 = 0;
|
||||
GameObject Ind2_1, Ind2_2, Ind2_3;
|
||||
Renderer Fill2_1, Fill2_2, Fill2_3;
|
||||
|
||||
/*private void Start()
|
||||
{
|
||||
Ind2_1 = GameObject.Find("Indicator2_1_0110");
|
||||
Ind2_2 = GameObject.Find("Indicator2_2_0110");
|
||||
Ind2_3 = GameObject.Find("Indicator2_3_0110");
|
||||
Fill2_1 = GameObject.Find("Indicator2_1_0110fill").GetComponent<Renderer>();
|
||||
Fill2_2 = GameObject.Find("Indicator2_2_0110fill").GetComponent<Renderer>();
|
||||
Fill2_3 = GameObject.Find("Indicator2_3_0110fill").GetComponent<Renderer>();
|
||||
Fill2_1.material.color = Color.red;
|
||||
Fill2_2.material.color = Color.red;
|
||||
Fill2_3.material.color = Color.yellow;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (Ind2_1 == null) return;
|
||||
|
||||
Ind2_1.transform.localScale = new Vector3(1f, Range1, 1f);
|
||||
if (Ind2_1.transform.localScale.y >= 0.2f)
|
||||
Fill2_1.material.color = Color.yellow;
|
||||
if (Ind2_1.transform.localScale.y < 0.2f)
|
||||
Fill2_1.material.color = Color.red;
|
||||
if (Ind2_1.transform.localScale.y > 0.665f)
|
||||
Fill2_1.material.color = Color.green;
|
||||
|
||||
Ind2_2.transform.localScale = new Vector3(1f, Range2, 1f);
|
||||
if (Ind2_2.transform.localScale.y >= 0.08f)
|
||||
Fill2_2.material.color = Color.yellow;
|
||||
if (Ind2_2.transform.localScale.y < 0.08f)
|
||||
Fill2_2.material.color = Color.red;
|
||||
if (Ind2_2.transform.localScale.y > 0.665f)
|
||||
Fill2_2.material.color = Color.green;
|
||||
|
||||
Ind2_3.transform.localScale = new Vector3(1f, Range3, 1f);
|
||||
if (Ind2_3.transform.localScale.y > 0.665f)
|
||||
Fill2_3.material.color = Color.green;
|
||||
if (Ind2_3.transform.localScale.y < 0.665f)
|
||||
Fill2_3.material.color = Color.yellow;
|
||||
}*/
|
||||
}
|
||||
Reference in New Issue
Block a user