public void ReplaceTesting(TestTries newValue) { var entity = testingEntity; if (entity == null) { entity = SetTesting(newValue); } else { entity.ReplaceTesting(newValue); } }
public GameEntity SetTesting(TestTries newValue) { if (hasTesting) { throw new Entitas.EntitasException("Could not set Testing!\n" + this + " already has an entity with TestingComponent!", "You should check if the context already has a testingEntity before setting it or use context.ReplaceTesting()."); } var entity = CreateEntity(); entity.AddTesting(newValue); return entity; }
public void ReplaceTesting(TestTries newValue) { var index = GameComponentsLookup.Testing; var component = CreateComponent<TestingComponent>(index); component.value = newValue; ReplaceComponent(index, component); }