示例#1
0
 /// <summary>
 /// Writes the Int2 to the binary stream.
 /// </summary>
 /// <param name="stream">The stream.</param>
 /// <param name="value">The value to write.</param>
 public static void Write(this BinaryWriter stream, Int2 value)
 {
     stream.Write(value.X);
     stream.Write(value.Y);
 }
示例#2
0
        /// <summary>
        /// Adds the patch.
        /// </summary>
        /// <param name="patchX">The patch X location (coordinate).</param>
        /// <param name="patchZ">The patch Z location (coordinate).</param>
        public void AddPatch(int patchX, int patchZ)
        {
            var patchCoord = new Int2(patchX, patchZ);

            AddPatch(ref patchCoord);
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Int3" /> struct.
 /// </summary>
 /// <param name="value">A vector containing the values with which to initialize the X and Y components.</param>
 /// <param name="z">Initial value for the Z component of the vector.</param>
 public Int3(Int2 value, int z)
 {
     X = value.X;
     Y = value.Y;
     Z = z;
 }
示例#4
0
 /// <summary>
 /// Setups the terrain patch layer weights using the specified splatmaps data.
 /// </summary>
 /// <param name="patchCoord">The patch location (x and z coordinates).</param>
 /// <param name="index">The zero-based index of the splatmap texture.</param>
 /// <param name="splatMapLength">The splatmap map array length. It must match the terrain descriptor, so it should be (chunkSize*4+1)^2. Patch is a 4 by 4 square made of chunks. Each chunk has chunkSize quads on edge.</param>
 /// <param name="splatMap">The splat map. Each array item contains 4 layer weights.</param>
 /// <param name="forceUseVirtualStorage">If set to <c>true</c> patch will use virtual storage by force. Otherwise it can use normal texture asset storage on drive (valid only during Editor). Runtime-created terrain can only use virtual storage (in RAM).</param>
 public unsafe void SetupPatchSplatMap(ref Int2 patchCoord, int index, int splatMapLength, Color32 *splatMap, bool forceUseVirtualStorage = false)
 {
     if (Internal_SetupPatchSplatMap(unmanagedPtr, ref patchCoord, index, splatMapLength, splatMap, forceUseVirtualStorage))
         throw new Exception("Failed to setup terrain patch. See log for more info."); }