MCPcopy Create free account
hub / github.com/TanTanDev/runity / SpawnPrefab

Method SpawnPrefab

unity/Runity/World.cs:100–115  ·  view source on GitHub ↗
(string a_name, UInt64 a_identifierBits)

Source from the content-addressed store, hash-verified

98 }
99
100 public void SpawnPrefab(string a_name, UInt64 a_identifierBits) {
101 UnityEngine.GameObject prefab;
102 if(m_prefabs.TryGetValue(a_name, out prefab)) {
103 UnityEngine.GameObject spawnedGO = UnityEngine.GameObject.Instantiate(prefab);
104 RustEntityComponent rustEntity = spawnedGO.AddComponent<RustEntityComponent>();
105 rustEntity.IdentifierBits = a_identifierBits;
106 var rustyGameObject = new RustyGameObject(spawnedGO);
107 if(m_gameObjects.ContainsKey(a_identifierBits)) {
108 UnityEngine.Debug.LogError("id already exists: {}"+ a_identifierBits);
109 return;
110 }
111 m_gameObjects.Add(a_identifierBits, rustyGameObject);
112 } else {
113 UnityEngine.Debug.LogError("fail spawn prefab with name: " + a_name);
114 }
115 }
116
117 public void UploadComponentTextmeshui(UInt64 a_identifierBits, string a_text) {
118 //UnityEngine.Debug.Log(a_identifierBits + " tried to upload text: " + a_text);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected