public GameEntity ReplaceCoroutineDirector(Assets.Code.Services.ICoroutineDirectorService newValue) { var index = GameComponentsLookup.CoroutineDirector; var component = (Assets.Code.Components.CoroutineDirector)CreateComponent(index, typeof(Assets.Code.Components.CoroutineDirector)); component.Value = newValue; ReplaceComponent(index, component); return(this); }
public GameEntity SetCoroutineDirector(Assets.Code.Services.ICoroutineDirectorService newValue) { if (hasCoroutineDirector) { throw new Entitas.EntitasException("Could not set CoroutineDirector!\n" + this + " already has an entity with Assets.Code.Components.CoroutineDirector!", "You should check if the context already has a coroutineDirectorEntity before setting it or use context.ReplaceCoroutineDirector()."); } var entity = CreateEntity(); entity.AddCoroutineDirector(newValue); return(entity); }
public void ReplaceCoroutineDirector(Assets.Code.Services.ICoroutineDirectorService newValue) { var entity = coroutineDirectorEntity; if (entity == null) { entity = SetCoroutineDirector(newValue); } else { entity.ReplaceCoroutineDirector(newValue); } }