public void initFromWrapper(ERPathToVertexPathWrapper wrapper) { pathWrapper = wrapper; totalDistance = pathWrapper.TotalDistance; positions = pathWrapper.Positions; directions = pathWrapper.Directions; rotations = pathWrapper.Rotations; distances = pathWrapper.Distances; }
private ERPathAdapter AppendAdapter(ERModularRoad road, ERPathToVertexPathWrapper wrapper) { var adapter = road.GetComponent <ERPathAdapter>(); if (!adapter) { adapter = (ERPathAdapter)road.gameObject.AddComponent(typeof(ERPathAdapter)); adapter.initFromWrapper(wrapper); DebugLog($"Added new adapter to road {road.name}"); } else { DebugLog($"Found existing adapter for road {road.name}"); } adapter.initFromWrapper(wrapper); return(adapter); }
private void InitVertexPathWrapper(ERModularRoad road, ERPathToVertexPathWrapper wrapper) { wrapper.Init(road); DebugLog($"Wrapper for road {road.name} initialized with {wrapper.Positions.Length} points and {wrapper.TotalDistance} length"); }