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

Method UploadComponentTransform

unity/Runity/World.cs:125–139  ·  view source on GitHub ↗
(UInt64 a_identifierBits, CTransform a_transform)

Source from the content-addressed store, hash-verified

123 }
124
125 public void UploadComponentTransform(UInt64 a_identifierBits, CTransform a_transform) {
126 RustyGameObject gameObject;
127 if(m_gameObjects.TryGetValue(a_identifierBits, out gameObject)) {
128 // todo, fetch id of component, not hardcode transform to 0
129 var transform = gameObject.GetComponentFromId<UnityEngine.Transform>(0);
130 UnityEngine.Vector3 position = new UnityEngine.Vector3(a_transform.x, a_transform.y, a_transform.z);
131 transform.position = position;
132 // I'm to lazy to implement RectTransform AAAAAAH
133 var rectTransform = gameObject.GetComponentFromId<UnityEngine.RectTransform>(2);
134 if(rectTransform != null)
135 rectTransform.anchoredPosition = position;
136 } else {
137 // UnityEngine.Debug.LogWarning("failed to upload transform to gameobject(No such entity) with id: " + a_identifier);
138 }
139 }
140
141 public void EntityTrackCollision(UInt64 a_identifierBits) {
142 RustyGameObject rustyGameObject;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected