コード例 #1
0
 public void initFromWrapper(ERPathToVertexPathWrapper wrapper)
 {
     pathWrapper   = wrapper;
     totalDistance = pathWrapper.TotalDistance;
     positions     = pathWrapper.Positions;
     directions    = pathWrapper.Directions;
     rotations     = pathWrapper.Rotations;
     distances     = pathWrapper.Distances;
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 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");
 }