using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class LoadingPictures : MonoBehaviour { public Sprite BYQ_500kV; private void Awake() { GetSceneName(); } private void GetSceneName() { string[] args = Environment.GetCommandLineArgs(); if (args.Length < 2) { return; } //模拟数据 //string simulationData = "11111111111/10kV真空断路器及开关柜例行检修/练习/47.92.0.243:15156"; //string[] tmpArgs = simulationData.Split('/'); string simulationData = "openchangingflux://111/换流变压器检修/练习"; string[] tmpArgs = simulationData.Split(new string[] { "//" }, StringSplitOptions.None)[1].Split('/'); //截断 // string[] tmpArgs = args[1].Split('/'); // 文件各种:手机号/课程名/模式/地址 string tmpCourseName = tmpArgs[1]; Debug.LogError(tmpCourseName); Sprite tmpSprite = BYQ_500kV; tmpSprite = BYQ_500kV; this.gameObject.GetComponent().sprite = tmpSprite; } }