public void ReplaceRectGlobals(RectGlobals newValue) { var index = GameComponentsLookup.RectGlobals; var component = CreateComponent <RectGlobalsComponent>(index); component.value = newValue; ReplaceComponent(index, component); }
public GameEntity SetRectGlobals(RectGlobals newValue) { if (hasRectGlobals) { throw new Entitas.EntitasException("Could not set RectGlobals!\n" + this + " already has an entity with RectGlobalsComponent!", "You should check if the context already has a rectGlobalsEntity before setting it or use context.ReplaceRectGlobals()."); } var entity = CreateEntity(); entity.AddRectGlobals(newValue); return(entity); }
public void ReplaceRectGlobals(RectGlobals newValue) { var entity = rectGlobalsEntity; if (entity == null) { entity = SetRectGlobals(newValue); } else { entity.ReplaceRectGlobals(newValue); } }