Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. // Fill out your copyright notice in the Description page of Project Settings.
  2.  
  3. #include "Vmpc.h"
  4. #include "Runtime/Engine/Classes/Components/StaticMeshComponent.h"
  5. #include "Runtime/CoreUObject/Public/UObject/ConstructorHelpers.h"
  6.  
  7. #include "Logger.hpp"
  8. #include <vector>
  9.  
  10. // Sets default values
  11. AVmpc::AVmpc()
  12. {
  13. moduru::Logger::l.setPath("C:/Users/Izmar/vMPC/vmpc.log");
  14. // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
  15. PrimaryActorTick.bCanEverTick = true;
  16.  
  17. RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
  18.  
  19. std::vector<FString> meshNames = { "After", "BankA", "BankB", "BankC", "BankD", "BarEnd", "BarStart", "Body", "Cursor", "DataWheel", "DisplayCase", "DisplayDock", "Enter", "Erase", "F1", "F2", "F3", "F4", "F5", "F6", "FrontPanel", "FullLevel", "GoTo", "MainScreen", "NextSeq", "NextStep", "Num0", "Num1", "Num2", "Num3", "Num4", "Num5", "Num6", "Num7", "Num8", "Num9", "OpenWindow", "Overdub", "Pads", "Play", "PlayStart", "PrevStep", "Rec", "RecGain", "Shift", "SixteenLevels", "Slider", "Stop", "Tap", "TrackMute", "UndoSeq", "Volume" };
  20. for (auto& s : meshNames)
  21. addMesh(s);
  22. }
  23.  
  24. void AVmpc::addMesh(FString name) {
  25. FString fullName = "mpc_" + name;
  26. fullName += "." + fullName;
  27. fullName = "StaticMesh'/VmpcPlugin/Mpc/" + fullName + "'";
  28.  
  29. UStaticMeshComponent* MeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(*name);
  30. ConstructorHelpers::FObjectFinder<UStaticMesh> StaticMeshBox(*fullName);
  31. MeshComponent->SetStaticMesh(StaticMeshBox.Object);
  32. MeshComponent->SetupAttachment(RootComponent);
  33. MeshComponent->RegisterComponent();
  34. }
  35.  
  36. // Called when the game starts or when spawned
  37. void AVmpc::BeginPlay()
  38. {
  39. Super::BeginPlay();
  40.  
  41. }
  42.  
  43. // Called every frame
  44. void AVmpc::Tick(float DeltaTime)
  45. {
  46. Super::Tick(DeltaTime);
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement