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

Method GetComponentFromId

unity/Runity/RustyGameObject.cs:14–24  ·  view source on GitHub ↗
(int a_componentId)

Source from the content-addressed store, hash-verified

12 }
13
14 public T GetComponentFromId<T>(int a_componentId)
15 where T: UnityEngine.Component
16 {
17 if(HashedComponents.ContainsKey(a_componentId))
18 return HashedComponents[a_componentId] as T;
19 else {
20 var component = GameObject.GetComponent<T>();
21 HashedComponents[a_componentId] = component;
22 return HashedComponents[a_componentId] as T;
23 }
24 }
25 }
26}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected