|
|
|
|
|
|
public struct NamedPrefab |
|
|
|
{ |
|
|
|
[SerializeField] |
|
|
|
string m_PrefabName; |
|
|
|
string m_ImageName; |
|
|
|
public string prefabName |
|
|
|
public string imageName |
|
|
|
get => m_PrefabName; |
|
|
|
set => m_PrefabName = value; |
|
|
|
get => m_ImageName; |
|
|
|
set => m_ImageName = value; |
|
|
|
} |
|
|
|
|
|
|
|
public GameObject prefab |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public NamedPrefab(string prefabName, GameObject prefab) |
|
|
|
public NamedPrefab(string imageName, GameObject prefab) |
|
|
|
m_PrefabName = prefabName; |
|
|
|
m_ImageName = imageName; |
|
|
|
m_Prefab = prefab; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < prefabList.Count; i++) |
|
|
|
{ |
|
|
|
m_PrefabsDictionary.Add(prefabList[i].prefabName, prefabList[i].prefab); |
|
|
|
m_PrefabsDictionary.Add(prefabList[i].imageName, prefabList[i].prefab); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < m_PrefabList.Count; i++) |
|
|
|
{ |
|
|
|
var pref = m_PrefabList[i]; |
|
|
|
pref.prefabName = m_ImageLibrary[i].name; |
|
|
|
pref.imageName = m_ImageLibrary[i].name; |
|
|
|
m_PrefabList[i] = pref; |
|
|
|
} |
|
|
|
} |
|
|
|