private static void LoadAssetReferences(SerializedArrayView assetReferences, IAssetManager assetManager) { foreach (var assetReference in GetAssetReferencesFromArrayView(assetReferences)) { assetManager.GetEntity(assetReference.ToUnityObject()); } }
private void ValueChanged(InspectorDataProxy <Entity> proxy, ChangeEvent <Object> evt) { if (m_SimpleMode) { if (evt.newValue && null != evt.newValue) { EntityReference entityRef = null; switch (evt.newValue) { case EntityReference reference: entityRef = reference; break; case Component component: entityRef = component.GetComponent <EntityReference>(); break; case GameObject gameObject: entityRef = gameObject.GetComponent <EntityReference>(); break; } if (entityRef && null != entityRef) { proxy.Data = m_WorldManager.GetEntityFromGuid(entityRef.Guid); } else { proxy.Data = Entity.Null; } } else { proxy.Data = Entity.Null; } } else { if (evt.newValue && null != evt.newValue) { proxy.Data = m_AssetManager.GetEntity(evt.newValue); } else { proxy.Data = Entity.Null; } } }
public Entity GetEntity <TObject>(TObject obj) where TObject : Object { return(m_AssetManager.GetEntity(obj)); }