public override void Initialize(FObjectInitializer initializer) { base.Initialize(initializer); // Set default pawn class to our character DefaultPawnClass = TSubclassOf <APawn> .From <ASideScrollerCharacter>(); }
public override void Initialize(FObjectInitializer initializer) { base.Initialize(initializer); // This syntax isn't the best but it ensures that the class is strongly typed. We could use SetClass<T>() but as it's a struct and // we want to modify a property, this doesn't work. An alternative would be to make a local var, call SetClass then assign the property. PlayerControllerClass = TSubclassOf <APlayerController> .From <APuzzlePlayerController>(); DefaultPawnClass = TSubclassOf <APawn> .From <APuzzlePlayerCharacter>(); }
public T GetComponentByClass <T>() where T : UActorComponent { return((T)GetComponentByClass(TSubclassOf <UActorComponent> .From <T>())); }
public void AddClaimedResource <T>() where T : UGameplayTaskResource { AddClaimedResource(TSubclassOf <UGameplayTaskResource> .From <T>()); }