public static void AddRawGameObject <T>(IEntity obj, GameObject go) where T : FracturedBaseObject { MapObjectEntity mapObject = obj as MapObjectEntity; mapObject.AddRawGameObject(go); var entityReference = go.GetComponent <EntityReference>(); if (entityReference == null) { entityReference = go.AddComponentUncheckRequireAndDisallowMulti <EntityReference>(); } entityReference.Init(mapObject.entityAdapter); }
private static void AddRawGameObject(IEntity obj, GameObject gameObject) { MapObjectEntity mapObject = obj as MapObjectEntity; mapObject.AddRawGameObject(gameObject); var entityReference = gameObject.GetComponent <EntityReference>(); if (entityReference == null) { entityReference = gameObject.AddComponent <EntityReference>(); } entityReference.Init(mapObject.entityAdapter); }