Пример #1
0
        public override void Initialize(FObjectInitializer initializer)
        {
            base.Initialize(initializer);

            // Set default pawn class to our character
            DefaultPawnClass = TSubclassOf <APawn> .From <ASideScrollerCharacter>();
        }
Пример #2
0
        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>();
        }
Пример #3
0
 public T GetComponentByClass <T>() where T : UActorComponent
 {
     return((T)GetComponentByClass(TSubclassOf <UActorComponent> .From <T>()));
 }
Пример #4
0
 public void AddClaimedResource <T>() where T : UGameplayTaskResource
 {
     AddClaimedResource(TSubclassOf <UGameplayTaskResource> .From <T>());
 }