AR + GPS Location  3.0.0
All Classes Namespaces Functions Variables Properties Events Pages
PrefabDatabase.cs
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 
5 namespace ARLocation {
6  [CreateAssetMenu(fileName = "PrefabDb", menuName = "AR+GPS/PrefabDatabase")]
7  public class PrefabDatabase : ScriptableObject
8  {
9  [System.Serializable]
10  public class PrefabDatabaseEntry
11  {
16  public string MeshId;
17 
21  public GameObject Prefab;
22  }
23 
24  public List<PrefabDatabaseEntry> Entries;
25 
26  public GameObject GetEntryById(string Id)
27  {
28  GameObject result = null;
29 
30  foreach(var entry in Entries)
31  {
32  if (entry.MeshId == Id)
33  {
34  result = entry.Prefab;
35  break;
36  }
37  }
38 
39  return result;
40  }
41  }
42 }
ARLocation.PrefabDatabase.PrefabDatabaseEntry
Definition: PrefabDatabase.cs:11
ARLocation.PrefabDatabase
Definition: PrefabDatabase.cs:8
ARLocation.PrefabDatabase.PrefabDatabaseEntry.MeshId
string MeshId
The MeshId associated with the prefab. Should match a MeshId from the data created the Web Map Editor...
Definition: PrefabDatabase.cs:16
ARLocation
Definition: ARLocationConfigInspector.cs:7
ARLocation.PrefabDatabase.PrefabDatabaseEntry.Prefab
GameObject Prefab
The prefab you want to associate with the MeshId.
Definition: PrefabDatabase.cs:21