// Fill out your copyright notice in the Description page of Project Settings. #include "ResComStatistics.h" void UResComStatistics::NewState(FString state) { if (prevState.duration != 0.0f) { prevState.duration = GetWorld()->GetTimeSeconds() - prevState.duration; stateHistory.Add(prevState); } prevState.state = state; prevState.duration = GetWorld()->GetTimeSeconds(); } FString UResComStatistics::GetStateHistoryString() { FString strTmp(""); for (auto& state : stateHistory) { strTmp += "->" + state.state; } return strTmp; } void UResComStatistics::StartVR() { timeLastStartVR = GetWorld()->GetTimeSeconds(); } void UResComStatistics::EndVR() { timeVR += GetWorld()->GetTimeSeconds() - timeLastStartVR; }