Tanoda
TagCloud.cs
Go to the documentation of this file.
1
using
System;
2
using
System.Collections;
3
using
System.Collections.Generic;
4
using
System.IO;
5
using
System.Linq;
6
using
UnityEngine
;
7
8
public
class
TagCloud
: MonoBehaviour
9
{
10
public
List<string>
tags
=
new
List<string>();
11
public
string
filePath
;
12
13
public
void
Save
()
14
{
15
#if !UNITY_WEBGL
16
File.WriteAllLines(
filePath
+
".tag"
,
tags
);
17
#else
18
GlobalTagManager
.
instance
.Save(
filePath
,
tags
);
19
#endif
20
}
21
22
public
bool
SearchHelp
(
string
value)
23
{
24
if
(
tags
.Count == 0)
25
TryLoad
();
26
27
foreach
(var t
in
tags
)
28
{
29
if
(t.Contains(value))
30
{
31
return
true
;
32
}
33
}
34
return
false
;
35
}
36
37
public
void
Load
()
38
{
39
#if UNITY_WEBGL
40
//filePath = filePath.Replace('\\', '/');
41
//tags = File.ReadAllLines(filePath + ".tag").ToList();
42
tags
=
GlobalTagManager
.
instance
.GetTags(
filePath
).ToList();
43
#else
44
tags
= File.ReadAllLines(
filePath
+
".tag"
).ToList();
45
#endif
46
}
47
48
public
void
TryLoad
()
49
{
50
try
51
{
52
Load
();
53
}
54
catch
(Exception)
55
{
56
//Debug.Log(filePath + ".tag not found, or could not access it!");
57
tags
=
GlobalTagManager
.
instance
.GetTags(
filePath
).ToList();
58
}
59
}
60
}
GILES.pb_MonoBehaviourSingleton.instance
static T instance
Definition:
pb_MonoBehaviourSingleton.cs:28
GlobalTagManager
Definition:
GlobalTagManager.cs:9
TagCloud
Definition:
TagCloud.cs:9
TagCloud.SearchHelp
bool SearchHelp(string value)
Definition:
TagCloud.cs:22
TagCloud.Save
void Save()
Definition:
TagCloud.cs:13
TagCloud.TryLoad
void TryLoad()
Definition:
TagCloud.cs:48
TagCloud.tags
List< string > tags
Definition:
TagCloud.cs:10
TagCloud.Load
void Load()
Definition:
TagCloud.cs:37
TagCloud.filePath
string filePath
Definition:
TagCloud.cs:11
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Source
Assets
Scripts
TagsProperties
TagCloud.cs
Generated by
1.9.3