Esempio n. 1
0
        public override void Initialize(FObjectInitializer initializer)
        {
            base.Initialize(initializer);

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