public void ReplaceFrame(ECS.Data.Frame newValue) { var index = InputComponentsLookup.Frame; var component = (FrameComponent)CreateComponent(index, typeof(FrameComponent)); component.value = newValue; ReplaceComponent(index, component); }
public InputEntity SetFrame(ECS.Data.Frame newValue) { if (hasFrame) { throw new Entitas.EntitasException("Could not set Frame!\n" + this + " already has an entity with FrameComponent!", "You should check if the context already has a frameEntity before setting it or use context.ReplaceFrame()."); } var entity = CreateEntity(); entity.AddFrame(newValue); return(entity); }
public void ReplaceFrame(ECS.Data.Frame newValue) { var entity = frameEntity; if (entity == null) { entity = SetFrame(newValue); } else { entity.ReplaceFrame(newValue); } }