114 lines
3.3 KiB
C#
114 lines
3.3 KiB
C#
using OpenCVForUnityExample;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class ChangePicture : MonoBehaviour
|
|
{
|
|
public RawImage midcode;
|
|
public Image title;
|
|
|
|
public Texture2D 无人机Python;
|
|
public Texture2D 无人机Java;
|
|
public Texture2D 无人机C;
|
|
public Texture2D 数字人Python;
|
|
public Texture2D 数字人Java;
|
|
public Texture2D 数字人C;
|
|
public Texture2D 机器人Python;
|
|
public Texture2D 机器人Java;
|
|
public Texture2D 机器人C;
|
|
public Sprite 无人机Python_;
|
|
public Sprite 无人机Java_;
|
|
public Sprite 无人机C_;
|
|
public Sprite 数字人Python_;
|
|
public Sprite 数字人Java_;
|
|
public Sprite 数字人C_;
|
|
public Sprite 机器人Python_;
|
|
public Sprite 机器人Java_;
|
|
public Sprite 机器人C_;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
if (SetJson.instance.ReadScenceName() == "无人机")
|
|
{
|
|
if (SetJson.instance.ReadLanguage() == "Python")
|
|
{
|
|
if (midcode != null)
|
|
midcode.texture = 无人机Python;
|
|
if (title != null)
|
|
title.sprite = 无人机Python_;
|
|
}
|
|
else if (SetJson.instance.ReadLanguage() == "Java")
|
|
{
|
|
if (midcode != null)
|
|
midcode.texture = 无人机Java;
|
|
if (title != null)
|
|
title.sprite = 无人机Java_;
|
|
}
|
|
else
|
|
{
|
|
if (midcode != null)
|
|
midcode.texture = 无人机C;
|
|
if (title != null)
|
|
title.sprite = 无人机C_;
|
|
}
|
|
}
|
|
else if (SetJson.instance.ReadScenceName() == "数字人")
|
|
{
|
|
if (SetJson.instance.ReadLanguage() == "Python")
|
|
{
|
|
if (midcode != null)
|
|
midcode.texture = 数字人Python;
|
|
if (title != null)
|
|
title.sprite = 数字人Python_;
|
|
}
|
|
else if (SetJson.instance.ReadLanguage() == "Java")
|
|
{
|
|
if (midcode != null)
|
|
midcode.texture = 数字人Java;
|
|
if (title != null)
|
|
title.sprite = 数字人Java_;
|
|
}
|
|
else
|
|
{
|
|
if (midcode != null)
|
|
midcode.texture = 数字人C;
|
|
if (title != null)
|
|
title.sprite = 数字人C_;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (SetJson.instance.ReadLanguage() == "Python")
|
|
{
|
|
if (midcode != null)
|
|
midcode.texture = 机器人Python;
|
|
if (title != null)
|
|
title.sprite = 机器人Python_;
|
|
}
|
|
else if (SetJson.instance.ReadLanguage() == "Java")
|
|
{
|
|
if (midcode != null)
|
|
midcode.texture = 机器人Java;
|
|
if (title != null)
|
|
title.sprite = 机器人Java_;
|
|
}
|
|
else
|
|
{
|
|
if (midcode != null)
|
|
midcode.texture = 机器人C;
|
|
if (title != null)
|
|
title.sprite = 机器人C_;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|