Example #1
0
        public static T Create <T>(object initData) where T : Entity, new()
        {
            var entity = New <T>();

            entity.Id = entity.InstanceId;
            Master.AddChild(entity);
            entity.Awake(initData);
            if (DebugLog)
            {
                Log.Debug($"EntityFactory->Create, {typeof(T).Name}={entity.InstanceId}, {initData}");
            }
            return(entity);
        }
Example #2
0
        public static Entity Create(Type entityType, object initData)
        {
            var entity = NewEntity(entityType);

            entity.Id = entity.InstanceId;
            if (EnableLog)
            {
                Log.Debug($"Entity->Create, {entityType.Name}={entity.InstanceId}, {initData}");
            }
            Master.AddChild(entity);
            entity.Awake(initData);
            return(entity);
        }
Example #3
0
        public static Entity Create(Type entityType)
        {
            var entity = NewEntity(entityType);

            entity.Id = entity.InstanceId;
            Master.AddChild(entity);
            entity.Awake();
            if (EnableLog)
            {
                Log.Debug($"EntityFactory->Create, {entityType.Name}={entity.InstanceId}");
            }
            return(entity);
        }
Example #4
0
        public static T Create <T>(object initData) where T : Entity
        {
            var entity = NewEntity(typeof(T)) as T;

            entity.Id = entity.InstanceId;
            if (EnableLog)
            {
                Log.Debug($"Entity->Create, {typeof(T).Name}={entity.InstanceId}, {initData}");
            }
            Master.AddChild(entity);
            entity.Awake(initData);
            return(entity);
        }
Example #5
0
        public static T Create <T>() where T : Entity
        {
            var entity = NewEntity(typeof(T)) as T;

            entity.Id = entity.InstanceId;
            Master.AddChild(entity);
            entity.Awake();
            if (EnableLog)
            {
                Log.Debug($"EntityFactory->Create, {typeof(T).Name}={entity.InstanceId}");
            }
            return(entity);
        }