// Start is called before the first frame update void Start() { manager = GameObject.Find("Manager").GetComponent <TempManager>(); camera = transform.GetChild(0).gameObject; CameraManager.Add(this); }
private async void Window_Loaded(object sender, RoutedEventArgs e) { await Task.Run(() => { TempManager.FinalCleanUp(); }); Close(); }
public static void Create() { var set = new SettingManger().setting; var tempdict = new Dictionary <string, ITempBuild>(); var build = default(ITempBuild); //编译模板 foreach (var item in set.data) { var temppath = Path.Combine(set.tempdir, item.tempname); if (!File.Exists(temppath)) { throw new Exception($"模板文件不存在:{temppath}"); } build = new TempManager(temppath).GetTempBuild(); Console.WriteLine($"模板编译成功! {temppath}"); tempdict.Add(item.tempname, build); } //全局输出文件夹是否存在 if (!Directory.Exists(set.outdir)) { Directory.CreateDirectory(set.outdir); } //输出结果 foreach (var item in set.data) { foreach (var dtname in item.dataname) { var datapath = Path.Combine(set.datadir, dtname); bool issuccess = tempdict.TryGetValue(item.tempname, out build); if (issuccess) { if (!File.Exists(datapath)) { Console.WriteLine($"数据文件不存在:{datapath}"); break; } //加载数据 build.LoadFromFile(datapath); Console.WriteLine($"数据加载成功! {datapath}"); //生成代码 var code = build.Execute(); var outpath = Path.Combine(item.outdir, string.Format(item.filename, Path.GetFileNameWithoutExtension(dtname))); using (var writer = new StreamWriter(outpath)) { writer.Write(code); Console.WriteLine($"代码生成成功! {outpath}"); } } } } }
void Awake() { if (Instance) { Destroy(this); } else { Instance = this; } Shader.SetGlobalInt("_runtime", 1); }
void Start() { currentXmlObj = "system"; streamingPath = Path.Combine(Application.streamingAssetsPath, "XML\\"); current = this; manager = transform.GetComponent <UIManager>(); assistant = transform.GetComponent <Assistant>(); decryptor = transform.GetComponent <DecryptionSoftware>(); tempManager = transform.GetComponent <TempManager>(); encryptedFields = new List <TMP_Text>(); lockedFields = new List <TMP_Text>(); explorerWindow = explorerPanel.transform.parent.gameObject; node_ActiveFields = new List <GameObject>(); node_TextFields = new TMP_Text[textFieldAmount]; anchorMin = explorerWindow.GetComponent <RectTransform>().anchorMin; anchorMax = explorerWindow.GetComponent <RectTransform>().anchorMax; GenerateTextFieldArray(); //Turn off all text fields foreach (TMP_Text tmp in node_TextFields) { tmp.gameObject.SetActive(false); } // Open the XML. tempXMLDoc = new XmlDocument(); RestoreXMLs(); //Filename Example: "ExplorerFile.xml" tempXMLDoc.Load(streamingPath + "TempXML\\" + ogXMLs[0] + ".xml"); // Create a navigator to query with XPath. nav = tempXMLDoc.CreateNavigator(); //Initial XPathNavigator to start at the root. nav.MoveToRoot(); if (bootLaunch == true) { explorerWindow.GetComponent <RectTransform>().anchorMin = new Vector2(0.11F, 0.05F); explorerWindow.GetComponent <RectTransform>().anchorMax = new Vector2(0.11F, 0.05F); } else { StartCoroutine(UpdateData()); } }
void Start() { manager = transform.GetComponent <TempManager>(); explorer = transform.GetComponent <Explorer>(); anchorMin = decryptionPanel.transform.parent.GetComponent <RectTransform>().anchorMin; anchorMax = decryptionPanel.transform.parent.GetComponent <RectTransform>().anchorMax; decryptionPanel.transform.parent.GetComponent <RectTransform>().anchorMin = new Vector2(0.15F, 0.05F); decryptionPanel.transform.parent.GetComponent <RectTransform>().anchorMax = new Vector2(0.15F, 0.05F); encryptedText = decryptionPanel.transform.GetChild(0).GetComponent <TMP_Text>(); decryptedText = decryptionPanel.transform.GetChild(1).GetComponent <TMP_Text>(); }
private async void ExtractFrames() { SelectedFrame = VideoFrame.Default; Frames.Clear(); TempManager.SetNewWorkingDir(); SetBusy(); List <VideoFrame> frameObjects = new List <VideoFrame>(); await Task.Run(() => { SetBusy("Extracting frames..."); PullFrames(VideoFilePath, SelectedFrameRate, TempManager.WorkingDir.FullName); SetBusy("Generating thumbnails..."); MakeThumbnails(VideoFilePath, SelectedFrameRate, TempManager.WorkingDir.FullName); SetBusy("Finishing up..."); IEnumerable <FileInfo> allOutputFiles = TempManager.WorkingDir.EnumerateFiles("*.jpg"); IEnumerable <FileInfo> framesOnly = allOutputFiles.Where(f => f.Name.StartsWith("thumb") == false); foreach (FileInfo frameFile in framesOnly) { VideoFrame videoFrame = new VideoFrame() { FullPath = frameFile.FullName, ThumbnailPath = allOutputFiles.FirstOrDefault(f => f.Name == "thumb_" + frameFile.Name).FullName, IsSelected = false, MD5 = HashHelper.GetMD5(frameFile.FullName), SHA1 = HashHelper.GetSHA1(frameFile.FullName) }; frameObjects.Add(videoFrame); } }); Frames = new ObservableCollection <VideoFrame>(frameObjects); Frames[0].IsSelected = true; SetFree(); }
public void Read() { ColdDt = new DataTable(); DataColumn Dc1 = new DataColumn("Cold", Type.GetType("System.String")); DataColumn Dc2 = new DataColumn("ColdNum", Type.GetType("System.Double")); DataColumn Dc3 = new DataColumn("Order", Type.GetType("System.Int32")); DataColumn Dc4 = new DataColumn("Time", Type.GetType("System.String")); ColdDt.Columns.Add(Dc1); ColdDt.Columns.Add(Dc2); ColdDt.Columns.Add(Dc3); ColdDt.Columns.Add(Dc4); WarmDt = new DataTable(); DataColumn WDc1 = new DataColumn("Warm", Type.GetType("System.String")); DataColumn WDc2 = new DataColumn("WarmNum", Type.GetType("System.Double")); DataColumn WDc3 = new DataColumn("Order", Type.GetType("System.Int32")); DataColumn WDc4 = new DataColumn("Time", Type.GetType("System.String")); WarmDt.Columns.Add(WDc1); WarmDt.Columns.Add(WDc2); WarmDt.Columns.Add(WDc3); WarmDt.Columns.Add(WDc4); try { TempManager.SelectTemp(Convert.ToDateTime(DatePicker.Text)); } catch (Exception err) { chartCold.Visible = false; chartWarm.Visible = false; MessageBox.Show("選取日無資料"); return; } List <TempManager.ColdTemp> ColdTempHistory = TempManager.ColdTempHistory; List <TempManager.WarmTemp> WarmTempHistory = TempManager.WarmTempHistory; int Index = 0; try { for (int i = 0; i < ColdTempHistory.Count; i++) { string[] Coldstr = ColdTempHistory[i].ColdReader1.Split('-'); string[] Coldstr1 = ColdTempHistory[i].ColdReader2.Split('-'); string[] Coldstr2 = ColdTempHistory[i].ColdReader3.Split('-'); string[] Coldstr3 = ColdTempHistory[i].ColdReader4.Split('-'); string[] Coldstr4 = ColdTempHistory[i].ColdReader5.Split('-'); string[] Warmstr = WarmTempHistory[i].WarmReader1.Split('-'); string[] Warmstr1 = WarmTempHistory[i].WarmReader2.Split('-'); string[] Warmstr2 = WarmTempHistory[i].WarmReader3.Split('-'); string[] Warmstr3 = WarmTempHistory[i].WarmReader4.Split('-'); string[] Warmstr4 = WarmTempHistory[i].WarmReader5.Split('-'); for (int j = 0; j < Coldstr4.Length - 1; j++) { if (Index == 3514) { } if (Coldstr[j] == "" || Coldstr1[j] == "" || Coldstr2[j] == "" || Coldstr3[j] == "" || Coldstr4[j] == "") { continue; } else { DataRow Dr = ColdDt.NewRow(); Dr["ColdNum"] = double.Parse(Coldstr[j]) / 10; Dr["Order"] = Index; Dr["Cold"] = "Cold1"; Dr["Time"] = ColdTempHistory[i].Time; ColdDt.Rows.Add(Dr); Dr = ColdDt.NewRow(); Dr["ColdNum"] = double.Parse(Coldstr1[j]) / 10; Dr["Order"] = Index; Dr["Cold"] = "Cold2"; Dr["Time"] = ColdTempHistory[i].Time; ColdDt.Rows.Add(Dr); Dr = ColdDt.NewRow(); Dr["ColdNum"] = double.Parse(Coldstr2[j]) / 10; Dr["Order"] = Index; Dr["Cold"] = "Cold3"; Dr["Time"] = ColdTempHistory[i].Time; ColdDt.Rows.Add(Dr); Dr = ColdDt.NewRow(); Dr["ColdNum"] = double.Parse(Coldstr3[j]) / 10; Dr["Order"] = Index; Dr["Cold"] = "Cold4"; Dr["Time"] = ColdTempHistory[i].Time; ColdDt.Rows.Add(Dr); Dr = ColdDt.NewRow(); Dr["ColdNum"] = double.Parse(Coldstr4[j]) / 10; Dr["Order"] = Index; Dr["Cold"] = "Cold5"; Dr["Time"] = ColdTempHistory[i].Time; ColdDt.Rows.Add(Dr); } if (Warmstr[j] == "" || Warmstr1[j] == "" || Warmstr2[j] == "" || Warmstr3[j] == "" || Warmstr4[j] == "") { continue; } else { DataRow Dr = WarmDt.NewRow(); Dr["WarmNum"] = double.Parse(Warmstr[j]) / 10; Dr["Order"] = Index; Dr["Warm"] = "Warm1"; Dr["Time"] = WarmTempHistory[i].Time; WarmDt.Rows.Add(Dr); Dr = WarmDt.NewRow(); Dr["WarmNum"] = double.Parse(Warmstr1[j]) / 10; Dr["Order"] = Index; Dr["Warm"] = "Warm2"; Dr["Time"] = WarmTempHistory[i].Time; WarmDt.Rows.Add(Dr); Dr = WarmDt.NewRow(); Dr["WarmNum"] = double.Parse(Warmstr2[j]) / 10; Dr["Order"] = Index; Dr["Warm"] = "Warm3"; Dr["Time"] = WarmTempHistory[i].Time; WarmDt.Rows.Add(Dr); Dr = WarmDt.NewRow(); Dr["WarmNum"] = double.Parse(Warmstr3[j]) / 10; Dr["Order"] = Index; Dr["Warm"] = "Warm4"; Dr["Time"] = WarmTempHistory[i].Time; WarmDt.Rows.Add(Dr); Dr = WarmDt.NewRow(); Dr["WarmNum"] = double.Parse(Warmstr4[j]) / 10; Dr["Order"] = Index; Dr["Warm"] = "Warm5"; Dr["Time"] = WarmTempHistory[i].Time; WarmDt.Rows.Add(Dr); } } Index++; } Show(); } catch (Exception er) { ATS.LCSCommon.WriteAppErrorLog(er.Message); } }
void GenerateTemperature() { tempManager = transform.gameObject.AddComponent <TempManager>(); tempManager.Initialize(this); }
// Use this for initialization void Start() { man = target.GetComponent<TempManager> (); trans = GetComponent<RectTransform> (); trans.sizeDelta = new Vector2 (trans.sizeDelta.x, 1); }
void Start() { TempManager[] tempManagers = FindObjectsOfType(typeof(TempManager)) as TempManager[]; grabbedBehavior = GetComponent<GrabbedBehavior> (); if (tempManagers.Length != 0){ tempManager = tempManagers[0]; } anim = gameObject.GetComponent<Animator> (); audioS = gameObject.GetComponent<AudioSource>(); if (desiredLocalScale.magnitude <= .001) { desiredLocalScale = transform.localScale; } // print(desiredLocalScale); }