Skip to content
Snippets Groups Projects
Commit b755cf50 authored by Heine, Eric R's avatar Heine, Eric R
Browse files

Made the position/rotation logger a little more flexible about the event it logs.

parent 033dece7
No related branches found
No related tags found
No related merge requests found
...@@ -5,12 +5,14 @@ namespace Shared.EventLog { ...@@ -5,12 +5,14 @@ namespace Shared.EventLog {
public class PositionRotationLogger : IntervalEventLogger { public class PositionRotationLogger : IntervalEventLogger {
[Tooltip("Transform to log position and rotation for")] [Tooltip("Transform to log position and rotation for")]
public Transform transformToLog; public Transform transformToLog;
[Tooltip("The prefix for the event log key for our events")]
public string eventLogKeyPrefix = "Player";
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Add the Transform's position and rotation to the event log // Add the Transform's position and rotation to the event log
protected override void LogEvent() { protected override void LogEvent() {
eventLog.Add("Player Position", "\"" + transformToLog.position.ToString() + "\""); eventLog.Add($"{eventLogKeyPrefix} Position", "\"" + transformToLog.position.ToString() + "\"");
eventLog.Add("Player Rotation", "\"" + transformToLog.rotation.eulerAngles.ToString() + "\""); eventLog.Add($"{eventLogKeyPrefix} Rotation", "\"" + transformToLog.rotation.eulerAngles.ToString() + "\"");
} }
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "com.futuretech.shared", "name": "com.futuretech.shared",
"displayName": "FutureTech Shared", "displayName": "FutureTech Shared",
"description": "Contains shared items such as the Scriptable Variables.", "description": "Contains shared items such as the Scriptable Variables.",
"version": "0.1.25", "version": "0.1.26",
"unity": "2019.3", "unity": "2019.3",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment