Tanoda
pb_SaveDialogButton.cs
Go to the documentation of this file.
1using UnityEngine;
2using System.Collections;
3using UnityEngine.UI;
4using System.IO;
5using System;
6
7namespace GILES.Interface
8{
10 {
11 public string path;
12 public Callback<string> OnClick;
13
14 public void SetDelegateAndPath(Callback<string> del, string path)
15 {
16#if UNITY_WEBGL
17 this.path = path;
18 OnClick = del;
19 onClick.AddListener( () => OnClick(path) );
20
21 Text text = GetComponentInChildren<Text>();
22
23 text.text = path.Remove(0, path.LastIndexOf("/") + 1);
24#else
25 DirectoryInfo di = new DirectoryInfo(path);
26
27 if(di == null)
28 {
29 Debug.Log("Invalid Directory: " + path);
30 return;
31 }
32
33 this.path = path;
34 OnClick = del;
35 onClick.AddListener( () => OnClick(path) );
36
37 Text text = GetComponentInChildren<Text>();
38
39 text.text = di.Name.ToUpper();
40#endif
41 }
42 }
43}
UnityEngine.UI.Button Button
Definition: Pointer.cs:7
UnityEngine.Debug Debug
Definition: TanodaServer.cs:19
void SetDelegateAndPath(Callback< string > del, string path)