public IEntitySpawnResults TrySpawnEntity(Vector3 position, Quaternion rotation, IGameObjectPrefabSpawnContext context) { return(TrySpawnEntity(position, rotation, Vector3.zero, context)); }
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)); }
public IEntitySpawnResults TrySpawnEntity(IGameObjectPrefabSpawnContext context) { return(TrySpawnEntity(Vector3.zero, Quaternion.identity, Vector3.zero, context)); }