1234567891011121314151617181920212223242526272829303132 |
- using CSVReader;
- using System.Collections.Generic;
- using UnityEngine;
- public class MapSensor : IMapSensor
- {
- public override void SetSensorList(Dictionary<int, GameObject> sensors)
- {
- SensorList = sensors;
- }
- public override List<InputObject> MapToWorldPositions(List<InputObject> inputs)
- {
- if (inputs.Count == 0)
- {
- Debug.LogError("Input to Map was of Length 0!");
- return inputs;
- }
- inputs.ForEach(x =>
- {
- if (!SensorList.ContainsKey(x.SensorID))
- {
- Debug.LogError("SensorID not Found!");
- return;
- }
- x.Pos = SensorList[x.SensorID].transform.TransformPoint(x.Pos);
- x.Rot = SensorList[x.SensorID].transform.TransformDirection(x.Rot);
- });
- return inputs;
- }
- }
|