rerer
This commit is contained in:
parent
4bfe41c347
commit
7fbed65272
|
@ -31,6 +31,8 @@ public class PostureController : MonoBehaviour
|
|||
|
||||
private void OnEnable()
|
||||
{
|
||||
redShowImage.gameObject.SetActive(false);
|
||||
blueShowImage.gameObject.SetActive(false);
|
||||
GetSceneInfo();
|
||||
}
|
||||
/// <summary>
|
||||
|
@ -118,14 +120,21 @@ public class PostureController : MonoBehaviour
|
|||
|
||||
private void OnDeviceBtn(string id, int redOrBlue)
|
||||
{
|
||||
if (droneViewDisplay.renderTextureTo(id) == null) return;
|
||||
if (droneViewDisplay.renderTextureTo(id) == null)
|
||||
{
|
||||
redShowImage.gameObject.SetActive(false);
|
||||
blueShowImage.gameObject.SetActive(false);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(id)) return;
|
||||
if (redOrBlue == 0)
|
||||
{
|
||||
redShowImage.gameObject.SetActive(true);
|
||||
redShowImage.texture = droneViewDisplay.renderTextureTo(id);
|
||||
}
|
||||
else
|
||||
{
|
||||
blueShowImage.gameObject.SetActive(true);
|
||||
blueShowImage.texture = droneViewDisplay.renderTextureTo(id);
|
||||
|
||||
}
|
||||
|
|
|
@ -176,7 +176,15 @@ public class DroneViewDisplay : MonoSingleton<DroneViewDisplay>
|
|||
/// <returns></returns>
|
||||
public RenderTexture renderTextureTo(string deviceID)
|
||||
{
|
||||
RenderTexture radioAngleView = renderTextures.Find(x => x.name == deviceID);
|
||||
RenderTexture radioAngleView = null;
|
||||
for (int i = 0; i < renderTextures.Count; i++)
|
||||
{
|
||||
if(renderTextures[i].name == deviceID)
|
||||
{
|
||||
radioAngleView = renderTextures[i];
|
||||
return radioAngleView;
|
||||
}
|
||||
}
|
||||
return radioAngleView;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue