Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fill out your copyright notice in the Description page of Project Settings.
- #include "Vmpc.h"
- #include "Runtime/Engine/Classes/Components/StaticMeshComponent.h"
- #include "Runtime/CoreUObject/Public/UObject/ConstructorHelpers.h"
- #include "Logger.hpp"
- #include <vector>
- // Sets default values
- AVmpc::AVmpc()
- {
- moduru::Logger::l.setPath("C:/Users/Izmar/vMPC/vmpc.log");
- // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
- PrimaryActorTick.bCanEverTick = true;
- RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
- 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" };
- for (auto& s : meshNames)
- addMesh(s);
- }
- void AVmpc::addMesh(FString name) {
- FString fullName = "mpc_" + name;
- fullName += "." + fullName;
- fullName = "StaticMesh'/VmpcPlugin/Mpc/" + fullName + "'";
- UStaticMeshComponent* MeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(*name);
- ConstructorHelpers::FObjectFinder<UStaticMesh> StaticMeshBox(*fullName);
- MeshComponent->SetStaticMesh(StaticMeshBox.Object);
- MeshComponent->SetupAttachment(RootComponent);
- MeshComponent->RegisterComponent();
- }
- // Called when the game starts or when spawned
- void AVmpc::BeginPlay()
- {
- Super::BeginPlay();
- }
- // Called every frame
- void AVmpc::Tick(float DeltaTime)
- {
- Super::Tick(DeltaTime);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement