Ejemplo n.º 1
0
 public IEntitySpawnResults TrySpawnEntity(Vector3 position, Quaternion rotation, IGameObjectPrefabSpawnContext context)
 {
     return(TrySpawnEntity(position, rotation, Vector3.zero, context));
 }
Ejemplo n.º 2
0
        public IEntitySpawnResults TrySpawnEntity(Vector3 position, Quaternion rotation, Vector3 scale, IGameObjectPrefabSpawnContext context)
        {
            if (Prefabs.FirstOrDefault(x => x.PrefabId == context.PrefabId) == null)
            {
                return(DefaultEntitySpawnDetails.Fail(SpawnResult.PrefabUnavailable));
            }

            GameObject go = gameobjectFactory.CreateBuilder()
                            .With(context)
                            .Create(Prefabs.First(x => x.PrefabId == context.PrefabId)?.PrefabReference, position, rotation);

            go.transform.localScale = scale;

            return(new DefaultEntitySpawnDetails(go));
        }
Ejemplo n.º 3
0
 public IEntitySpawnResults TrySpawnEntity(IGameObjectPrefabSpawnContext context)
 {
     return(TrySpawnEntity(Vector3.zero, Quaternion.identity, Vector3.zero, context));
 }