Пример #1
0
    private static string GetFilePathByName(string mapName, PathDataType pathDataType)
    {
        switch (pathDataType)
        {
        case PathDataType.height:
            break;

        case PathDataType.trail:
            mapName = mapName + "_trails";
            break;

        default:
            break;
        }
        #if UNITY_EDITOR
        return(Application.dataPath + "/StreamingAssets/" + mapName);
        #endif

        #if UNITY_IPHONE
        return(Application.dataPath + "/Raw/" + mapName);
        #endif

        #if UNITY_ANDROID
        return("jar:file://" + Application.dataPath + "!/assets/" + mapName);
        #endif
        #pragma warning disable CS0162 // Unreachable code detected
        return(mapName);

        #pragma warning restore CS0162 // Unreachable code detected
    }
Пример #2
0
 public PathData(PathDataType type)
 {
     this.Type = type;
     if (type != PathDataType.PathClosePath)
     {
         Points = new Point[PointNumbers[(int)type]];
     }
     else
     {
         Points = null;
     }
 }
Пример #3
0
 public static PathDataType FromDTO(this DTO.PathDataType source)
 {
     var h = new PathDataType();
     h.Path = source.Path;
     h.UserData = source.UserData;
     //h.Exclusion = source.Exclusion.ToList().ConvertAll(wld => wld.FromDTO());
     //h.Inclusion = source.Inclusion.ToList().ConvertAll(wld => wld.FromDTO());
     if (source.Exclusion != null)
         h.Exclusion = source.Exclusion.Select(wld => wld.FromDTO()).ToList();
     if (source.Inclusion != null)
         h.Inclusion = source.Inclusion.Select(wld => wld.FromDTO()).ToList();
     return h;
 }
Пример #4
0
        public static DTO.PathDataType ToDTO(this PathDataType source)
        {
            var h = new DTO.PathDataType();

            h.Path     = source.Path;
            h.UserData = source.UserData;
            if (source.Exclusion != null)
            {
                h.Exclusion = source.Exclusion.ConvertAll(wld => wld.ToDTO()).ToArray();
            }
            if (source.Inclusion != null)
            {
                h.Inclusion = source.Inclusion.ConvertAll(wld => wld.ToDTO()).ToArray();
            }
            return(h);
        }
Пример #5
0
        public static PathDataType FromDTO(this DTO.PathDataType source)
        {
            var h = new PathDataType();

            h.Path     = source.Path;
            h.UserData = source.UserData;
            //h.Exclusion = source.Exclusion.ToList().ConvertAll(wld => wld.FromDTO());
            //h.Inclusion = source.Inclusion.ToList().ConvertAll(wld => wld.FromDTO());
            if (source.Exclusion != null)
            {
                h.Exclusion = source.Exclusion.Select(wld => wld.FromDTO()).ToList();
            }
            if (source.Inclusion != null)
            {
                h.Inclusion = source.Inclusion.Select(wld => wld.FromDTO()).ToList();
            }
            return(h);
        }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PathViewModel"/> class.
 /// </summary>
 public PathViewModel()
 {
     data = new PathDataType();
     data.Path = "Moese, hehehe";
 }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PathViewModel"/> class.
 /// </summary>
 public PathViewModel()
 {
     data      = new PathDataType();
     data.Path = "Moese, hehehe";
 }
Пример #8
0
 public PathData(PathDataType type)
 {
     this._type = type;
 }
Пример #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PathViewModel"/> class.
 /// </summary>
 /// <param name="path">The path.</param>
 public PathViewModel(PathDataType path)
 {
     this.data = path;
 }
Пример #10
0
		public extern static  uint CreatePath(PathFormat pathFormat, PathDataType datatype, float scale, float bias, int segmentCapacityHint, int coordCapacityHint, PathCapabilities capabilities);