Ejemplo n.º 1
0
        public static BaseEntity ToBaseEntity(this GameObject go)
        {
            IEntity entityFromRegistry = GameObjectEx.GetEntityFromRegistry(go);

            if (entityFromRegistry == null && !go.transform.gameObject.activeSelf)
            {
                entityFromRegistry = GameObjectEx.GetEntityFromComponent(go);
            }
            return(entityFromRegistry as BaseEntity);
        }
Ejemplo n.º 2
0
        public static BaseEntity ToBaseEntity(this GameObject go)
        {
            IEntity ientity = GameObjectEx.GetEntityFromRegistry(go);

            if (ientity == null && !((Component)go.get_transform()).get_gameObject().get_activeSelf())
            {
                ientity = GameObjectEx.GetEntityFromComponent(go);
            }
            return(ientity as BaseEntity);
        }