This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000021 RID: 33
public enum AttibuteType
{
// Token: 0x040000ED RID: 237
Position,
// Token: 0x040000EE RID: 238
UV0,
// Token: 0x040000EF RID: 239
UV1,
// Token: 0x040000F0 RID: 240
UV2,
// Token: 0x040000F1 RID: 241
UV3,
// Token: 0x040000F2 RID: 242
Color,
// Token: 0x040000F3 RID: 243
Normal,
// Token: 0x040000F4 RID: 244
Tangent
}
}
+21
View File
@@ -0,0 +1,21 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x0200001B RID: 27
public enum Axis
{
// Token: 0x040000D3 RID: 211
Right,
// Token: 0x040000D4 RID: 212
Left,
// Token: 0x040000D5 RID: 213
Up,
// Token: 0x040000D6 RID: 214
Down,
// Token: 0x040000D7 RID: 215
Forward,
// Token: 0x040000D8 RID: 216
Backward
}
}
+15
View File
@@ -0,0 +1,15 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000018 RID: 24
public enum ColliderType
{
// Token: 0x040000BA RID: 186
None,
// Token: 0x040000BB RID: 187
BoxCollider,
// Token: 0x040000BC RID: 188
MeshCollider
}
}
+15
View File
@@ -0,0 +1,15 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x0200001F RID: 31
public enum Culling
{
// Token: 0x040000E4 RID: 228
Back,
// Token: 0x040000E5 RID: 229
Front,
// Token: 0x040000E6 RID: 230
FrontBack
}
}
+15
View File
@@ -0,0 +1,15 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000015 RID: 21
public enum DragSelectMode
{
// Token: 0x040000AC RID: 172
Add,
// Token: 0x040000AD RID: 173
Subtract,
// Token: 0x040000AE RID: 174
Difference
}
}
+108
View File
@@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace ProBuilder2.Common
{
// Token: 0x0200000F RID: 15
public static class EdgeExtensions
{
// Token: 0x06000079 RID: 121 RVA: 0x0000E57C File Offset: 0x0000C97C
public static bool ContainsDuplicate(this List<pb_Edge> edges, pb_Edge edge, Dictionary<int, int> lookup)
{
int num = 0;
for (int i = 0; i < edges.Count; i++)
{
if (edges[i].Equals(edge, lookup) && ++num > 1)
{
return true;
}
}
return false;
}
// Token: 0x0600007A RID: 122 RVA: 0x0000E5C4 File Offset: 0x0000C9C4
public static bool Contains(this pb_Edge[] edges, pb_Edge edge)
{
for (int i = 0; i < edges.Length; i++)
{
if (edges[i].Equals(edge))
{
return true;
}
}
return false;
}
// Token: 0x0600007B RID: 123 RVA: 0x0000E5F8 File Offset: 0x0000C9F8
public static bool Contains(this pb_Edge[] edges, int x, int y)
{
for (int i = 0; i < edges.Length; i++)
{
if ((x == edges[i].x && y == edges[i].y) || (x == edges[i].y && y == edges[i].x))
{
return true;
}
}
return false;
}
// Token: 0x0600007C RID: 124 RVA: 0x0000E654 File Offset: 0x0000CA54
public static IEnumerable<pb_Edge> DistinctCommon(this IEnumerable<pb_Edge> edges, Dictionary<int, int> lookup)
{
IEnumerable<pb_EdgeLookup> enumerable = edges.Select((pb_Edge x) => new pb_EdgeLookup(new pb_Edge(lookup[x.x], lookup[x.y]), x));
enumerable = enumerable.Distinct<pb_EdgeLookup>();
return enumerable.Select((pb_EdgeLookup x) => x.local);
}
// Token: 0x0600007D RID: 125 RVA: 0x0000E6AC File Offset: 0x0000CAAC
public static int IndexOf(this IList<pb_Edge> edges, pb_Edge edge, Dictionary<int, int> lookup)
{
for (int i = 0; i < edges.Count; i++)
{
if (edges[i].Equals(edge, lookup))
{
return i;
}
}
return -1;
}
// Token: 0x0600007E RID: 126 RVA: 0x0000E6E8 File Offset: 0x0000CAE8
public static List<int> ToIntList(this List<pb_Edge> edges)
{
List<int> list = new List<int>();
foreach (pb_Edge pb_Edge in edges)
{
list.Add(pb_Edge.x);
list.Add(pb_Edge.y);
}
return list;
}
// Token: 0x0600007F RID: 127 RVA: 0x0000E758 File Offset: 0x0000CB58
public static int[] AllTriangles(this pb_Edge[] edges)
{
int[] array = new int[edges.Length * 2];
int num = 0;
for (int i = 0; i < edges.Length; i++)
{
array[num++] = edges[i].x;
array[num++] = edges[i].y;
}
return array;
}
// Token: 0x06000080 RID: 128 RVA: 0x0000E7A8 File Offset: 0x0000CBA8
public static List<int> AllTriangles(this List<pb_Edge> edges)
{
List<int> list = new List<int>();
for (int i = 0; i < edges.Count; i++)
{
list.Add(edges[i].x);
list.Add(edges[i].y);
}
return list;
}
}
}
+18
View File
@@ -0,0 +1,18 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000013 RID: 19
[Flags]
public enum EditLevel
{
// Token: 0x040000A3 RID: 163
Top = 0,
// Token: 0x040000A4 RID: 164
Geometry = 1,
// Token: 0x040000A5 RID: 165
Texture = 2,
// Token: 0x040000A6 RID: 166
Plugin = 4
}
}
+19
View File
@@ -0,0 +1,19 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000016 RID: 22
public enum EntityType
{
// Token: 0x040000B0 RID: 176
Detail,
// Token: 0x040000B1 RID: 177
Occluder,
// Token: 0x040000B2 RID: 178
Trigger,
// Token: 0x040000B3 RID: 179
Collider,
// Token: 0x040000B4 RID: 180
Mover
}
}
+15
View File
@@ -0,0 +1,15 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000024 RID: 36
public enum ExtrudeMethod
{
// Token: 0x04000101 RID: 257
IndividualFaces,
// Token: 0x04000102 RID: 258
VertexNormal,
// Token: 0x04000103 RID: 259
FaceNormal
}
}
+15
View File
@@ -0,0 +1,15 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000014 RID: 20
public enum HandleAlignment
{
// Token: 0x040000A8 RID: 168
World,
// Token: 0x040000A9 RID: 169
Local,
// Token: 0x040000AA RID: 170
Plane
}
}
+15
View File
@@ -0,0 +1,15 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000022 RID: 34
public enum IndexFormat
{
// Token: 0x040000F6 RID: 246
Local,
// Token: 0x040000F7 RID: 247
Common,
// Token: 0x040000F8 RID: 248
Both
}
}
@@ -0,0 +1,17 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000020 RID: 32
public enum MeshRebuildReason
{
// Token: 0x040000E8 RID: 232
Null,
// Token: 0x040000E9 RID: 233
InstanceIDMismatch,
// Token: 0x040000EA RID: 234
Lightmap,
// Token: 0x040000EB RID: 235
None
}
}
@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{99604A24-13D0-4C83-A3AA-9A315339FA51}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>ProBuilder2.Common</RootNamespace>
<AssemblyName>ProBuilderCore-Unity5</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
</PropertyGroup>
<ItemGroup />
<ItemGroup>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Compile Include="AttibuteType.cs" />
<Compile Include="Axis.cs" />
<Compile Include="ColliderType.cs" />
<Compile Include="Culling.cs" />
<Compile Include="DragSelectMode.cs" />
<Compile Include="EdgeExtensions.cs" />
<Compile Include="EditLevel.cs" />
<Compile Include="EntityType.cs" />
<Compile Include="ExtrudeMethod.cs" />
<Compile Include="HandleAlignment.cs" />
<Compile Include="IndexFormat.cs" />
<Compile Include="MeshRebuildReason.cs" />
<Compile Include="pbTransformUtil.cs" />
<Compile Include="pbUtil.cs" />
<Compile Include="pb_ActionResult.cs" />
<Compile Include="pb_BezierPoint.cs" />
<Compile Include="pb_BezierShape.cs" />
<Compile Include="pb_BezierTangentDirection.cs" />
<Compile Include="pb_BezierTangentMode.cs" />
<Compile Include="pb_Bounds2D.cs" />
<Compile Include="pb_CIE_Lab_Color.cs" />
<Compile Include="pb_Color.cs" />
<Compile Include="pb_ColorPalette.cs" />
<Compile Include="pb_ColorUtil.cs" />
<Compile Include="pb_Constant.cs" />
<Compile Include="pb_DummyScript.cs" />
<Compile Include="pb_Edge.cs" />
<Compile Include="pb_EdgeConnection.cs" />
<Compile Include="pb_EdgeLookup.cs" />
<Compile Include="pb_ElementGraphics.cs" />
<Compile Include="pb_Entity.cs" />
<Compile Include="pb_Face.cs" />
<Compile Include="pb_FaceRebuildData.cs" />
<Compile Include="pb_HandleConstraint2D.cs" />
<Compile Include="pb_HandleUtility.cs" />
<Compile Include="pb_HsvColor.cs" />
<Compile Include="pb_IHasDefault.cs" />
<Compile Include="pb_IntArray.cs" />
<Compile Include="pb_IntArrayUtility.cs" />
<Compile Include="pb_IntVec3.cs" />
<Compile Include="pb_LineRenderer.cs" />
<Compile Include="pb_Log.cs" />
<Compile Include="pb_LogLevel.cs" />
<Compile Include="pb_LogOutput.cs" />
<Compile Include="pb_Math.cs" />
<Compile Include="pb_MeshRenderer.cs" />
<Compile Include="pb_MeshUtility.cs" />
<Compile Include="pb_MonoBehaviourSingleton.cs" />
<Compile Include="pb_Object.cs" />
<Compile Include="pb_ObjectPool.cs" />
<Compile Include="pb_Object_Utility.cs" />
<Compile Include="pb_PolyShape.cs" />
<Compile Include="pb_PreferenceDictionary.cs" />
<Compile Include="pb_PreferenceDictionaryEnumerator.cs" />
<Compile Include="pb_Projection.cs" />
<Compile Include="pb_RaycastHit.cs" />
<Compile Include="pb_Renderable.cs" />
<Compile Include="pb_SelectionPicker.cs" />
<Compile Include="pb_ShapeGenerator.cs" />
<Compile Include="pb_Shortcut.cs" />
<Compile Include="pb_Snap.cs" />
<Compile Include="pb_Spline.cs" />
<Compile Include="pb_Transform2D.cs" />
<Compile Include="pb_Tuple.2.cs" />
<Compile Include="pb_Tuple.3.cs" />
<Compile Include="pb_Tuple.cs" />
<Compile Include="pb_Type.cs" />
<Compile Include="pb_UnwrapParameters.cs" />
<Compile Include="pb_UV.cs" />
<Compile Include="pb_UVUtility.cs" />
<Compile Include="pb_Vector.cs" />
<Compile Include="pb_Vertex.cs" />
<Compile Include="pb_VertexConnection.cs" />
<Compile Include="pb_WingedEdge.cs" />
<Compile Include="pb_WingedEdgeEnumerator.cs" />
<Compile Include="pb_XYZ_Color.cs" />
<Compile Include="ProGridsConditionalSnapAttribute.cs" />
<Compile Include="ProGridsNoSnapAttribute.cs" />
<Compile Include="ProjectionAxis.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RefreshMask.cs" />
<Compile Include="SelectionRenderState.cs" />
<Compile Include="SelectMode.cs" />
<Compile Include="Shape.cs" />
<Compile Include="SortMethod.cs" />
<Compile Include="Status.cs" />
<Compile Include="UV2Method.cs" />
<Compile Include="WindingOrder.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\mscorlib\mscorlib.csproj">
<Project>{99604a24-13d0-4c83-a3aa-9a315339fa4c}</Project>
<Name>mscorlib</Name>
</ProjectReference>
<ProjectReference Include="..\System.Core\System.Core.csproj">
<Project>{99604a24-13d0-4c83-a3aa-9a315339fa55}</Project>
<Name>System.Core</Name>
</ProjectReference>
<ProjectReference Include="..\System\System.csproj">
<Project>{99604a24-13d0-4c83-a3aa-9a315339fa56}</Project>
<Name>System</Name>
</ProjectReference>
<ProjectReference Include="..\UnityEngine\UnityEngine.csproj">
<Project>{99604a24-13d0-4c83-a3aa-9a315339fa58}</Project>
<Name>UnityEngine</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,10 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000029 RID: 41
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public class ProGridsConditionalSnapAttribute : Attribute
{
}
}
@@ -0,0 +1,10 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000028 RID: 40
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public class ProGridsNoSnapAttribute : Attribute
{
}
}
+21
View File
@@ -0,0 +1,21 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000019 RID: 25
public enum ProjectionAxis
{
// Token: 0x040000BE RID: 190
X,
// Token: 0x040000BF RID: 191
Y,
// Token: 0x040000C0 RID: 192
Z,
// Token: 0x040000C1 RID: 193
X_Negative,
// Token: 0x040000C2 RID: 194
Y_Negative,
// Token: 0x040000C3 RID: 195
Z_Negative
}
}
@@ -0,0 +1,5 @@
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyVersion("0.0.0.0")]
+22
View File
@@ -0,0 +1,22 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000023 RID: 35
[Flags]
public enum RefreshMask : ushort
{
// Token: 0x040000FA RID: 250
All = 255,
// Token: 0x040000FB RID: 251
UV = 1,
// Token: 0x040000FC RID: 252
Colors = 2,
// Token: 0x040000FD RID: 253
Normals = 4,
// Token: 0x040000FE RID: 254
Tangents = 8,
// Token: 0x040000FF RID: 255
Collisions = 16
}
}
+16
View File
@@ -0,0 +1,16 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000012 RID: 18
[Flags]
public enum SelectMode
{
// Token: 0x0400009F RID: 159
Vertex = 0,
// Token: 0x040000A0 RID: 160
Edge = 1,
// Token: 0x040000A1 RID: 161
Face = 2
}
}
@@ -0,0 +1,16 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000017 RID: 23
[Flags]
public enum SelectionRenderState
{
// Token: 0x040000B6 RID: 182
None = 0,
// Token: 0x040000B7 RID: 183
Wireframe = 1,
// Token: 0x040000B8 RID: 184
Outline = 2
}
}
+35
View File
@@ -0,0 +1,35 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x0200001A RID: 26
public enum Shape
{
// Token: 0x040000C5 RID: 197
Cube,
// Token: 0x040000C6 RID: 198
Stair,
// Token: 0x040000C7 RID: 199
Prism,
// Token: 0x040000C8 RID: 200
Cylinder,
// Token: 0x040000C9 RID: 201
Plane,
// Token: 0x040000CA RID: 202
Door,
// Token: 0x040000CB RID: 203
Pipe,
// Token: 0x040000CC RID: 204
Cone,
// Token: 0x040000CD RID: 205
Sprite,
// Token: 0x040000CE RID: 206
Arch,
// Token: 0x040000CF RID: 207
Icosahedron,
// Token: 0x040000D0 RID: 208
Torus,
// Token: 0x040000D1 RID: 209
Custom
}
}
+13
View File
@@ -0,0 +1,13 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x0200001E RID: 30
public enum SortMethod
{
// Token: 0x040000E1 RID: 225
Clockwise,
// Token: 0x040000E2 RID: 226
CounterClockwise
}
}
+17
View File
@@ -0,0 +1,17 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000005 RID: 5
public enum Status
{
// Token: 0x04000005 RID: 5
Success,
// Token: 0x04000006 RID: 6
Failure,
// Token: 0x04000007 RID: 7
Canceled,
// Token: 0x04000008 RID: 8
NoChange
}
}
+13
View File
@@ -0,0 +1,13 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x0200001C RID: 28
public enum UV2Method
{
// Token: 0x040000DA RID: 218
Unity,
// Token: 0x040000DB RID: 219
BinPack
}
}
+15
View File
@@ -0,0 +1,15 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x0200001D RID: 29
public enum WindingOrder
{
// Token: 0x040000DD RID: 221
Unknown,
// Token: 0x040000DE RID: 222
Clockwise,
// Token: 0x040000DF RID: 223
CounterClockwise
}
}
+40
View File
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000002 RID: 2
public static class pbTransformUtil
{
// Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000450
public static void UnparentChildren(Transform t)
{
Transform[] array = new Transform[t.childCount];
for (int i = 0; i < t.childCount; i++)
{
Transform child = t.GetChild(i);
array[i] = child;
child.SetParent(null, true);
}
pbTransformUtil._childrenStack.Add(t, array);
}
// Token: 0x06000002 RID: 2 RVA: 0x000020A0 File Offset: 0x000004A0
public static void ReparentChildren(Transform t)
{
Transform[] array;
if (pbTransformUtil._childrenStack.TryGetValue(t, out array))
{
foreach (Transform transform in array)
{
transform.SetParent(t, true);
}
pbTransformUtil._childrenStack.Remove(t);
}
}
// Token: 0x04000001 RID: 1
private static Dictionary<Transform, Transform[]> _childrenStack = new Dictionary<Transform, Transform[]>();
}
}
+593
View File
@@ -0,0 +1,593 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000003 RID: 3
public static class pbUtil
{
// Token: 0x06000004 RID: 4 RVA: 0x000020FC File Offset: 0x000004FC
public static T[] GetComponents<T>(this GameObject[] _gameObjects) where T : Component
{
List<T> list = new List<T>();
for (int i = 0; i < _gameObjects.Length; i++)
{
list.AddRange(_gameObjects[i].transform.GetComponentsInChildren<T>());
}
return list.ToArray();
}
// Token: 0x06000005 RID: 5 RVA: 0x0000213C File Offset: 0x0000053C
public static T[] GetComponents<T>(GameObject go) where T : Component
{
return new Transform[] { go.transform }.GetComponents<T>();
}
// Token: 0x06000006 RID: 6 RVA: 0x00002154 File Offset: 0x00000554
public static T[] GetComponents<T>(this Transform[] _transforms) where T : Component
{
List<T> list = new List<T>();
foreach (Transform transform in _transforms)
{
list.AddRange(transform.GetComponentsInChildren<T>());
}
return list.ToArray();
}
// Token: 0x06000007 RID: 7 RVA: 0x00002194 File Offset: 0x00000594
public static Vector3[] ToWorldSpace(this Transform t, Vector3[] v)
{
Vector3[] array = new Vector3[v.Length];
for (int i = 0; i < array.Length; i++)
{
array[i] = t.TransformPoint(v[i]);
}
return array;
}
// Token: 0x06000008 RID: 8 RVA: 0x000021E0 File Offset: 0x000005E0
public static GameObject EmptyGameObjectWithTransform(Transform t)
{
return new GameObject
{
transform =
{
position = t.position,
localRotation = t.localRotation,
localScale = t.localScale
}
};
}
// Token: 0x06000009 RID: 9 RVA: 0x00002228 File Offset: 0x00000628
public static T[] ValuesWithIndices<T>(this T[] arr, int[] indices)
{
T[] array = new T[indices.Length];
for (int i = 0; i < indices.Length; i++)
{
array[i] = arr[indices[i]];
}
return array;
}
// Token: 0x0600000A RID: 10 RVA: 0x00002264 File Offset: 0x00000664
public static List<T> ValuesWithIndices<T>(this IList<T> arr, IList<int> indices)
{
List<T> list = new List<T>();
foreach (int num in indices)
{
list.Add(arr[num]);
}
return list;
}
// Token: 0x0600000B RID: 11 RVA: 0x000022C8 File Offset: 0x000006C8
public static int[] AllIndexesOf<T>(T[] arr, T instance)
{
List<int> list = new List<int>();
for (int i = 0; i < arr.Length; i++)
{
if (arr[i].Equals(instance))
{
list.Add(i);
}
}
return list.ToArray();
}
// Token: 0x0600000C RID: 12 RVA: 0x0000231C File Offset: 0x0000071C
public static bool IsEqual<T>(T[] a, T[] b)
{
if (a == null && b == null)
{
return true;
}
if ((a == null && b != null) || (a != null && b == null))
{
return false;
}
if (a.Length != b.Length)
{
return false;
}
for (int i = 0; i < a.Length; i++)
{
if (!a[i].Equals(b[i]))
{
return false;
}
}
return true;
}
// Token: 0x0600000D RID: 13 RVA: 0x0000239C File Offset: 0x0000079C
public static T[] Add<T>(this T[] arr, T val)
{
T[] array = new T[arr.Length + 1];
Array.ConstrainedCopy(arr, 0, array, 0, arr.Length);
array[arr.Length] = val;
return array;
}
// Token: 0x0600000E RID: 14 RVA: 0x000023CC File Offset: 0x000007CC
public static T[] AddRange<T>(this T[] arr, T[] val)
{
T[] array = new T[arr.Length + val.Length];
Array.ConstrainedCopy(arr, 0, array, 0, arr.Length);
Array.ConstrainedCopy(val, 0, array, arr.Length, val.Length);
return array;
}
// Token: 0x0600000F RID: 15 RVA: 0x00002404 File Offset: 0x00000804
public static T[] Remove<T>(this T[] arr, T val)
{
List<T> list = new List<T>(arr);
list.Remove(val);
return list.ToArray();
}
// Token: 0x06000010 RID: 16 RVA: 0x00002426 File Offset: 0x00000826
public static T[] Remove<T>(this T[] arr, IEnumerable<T> val)
{
return arr.Except(val).ToArray<T>();
}
// Token: 0x06000011 RID: 17 RVA: 0x00002434 File Offset: 0x00000834
public static T[] RemoveAt<T>(this T[] arr, int index)
{
T[] array = new T[arr.Length - 1];
int num = 0;
for (int i = 0; i < arr.Length; i++)
{
if (i != index)
{
array[num] = arr[i];
num++;
}
}
return array;
}
// Token: 0x06000012 RID: 18 RVA: 0x0000247C File Offset: 0x0000087C
public static T[] RemoveAt<T>(this IList<T> list, IEnumerable<int> indices)
{
List<int> list2 = new List<int>(indices);
list2.Sort();
return list.SortedRemoveAt(list2);
}
// Token: 0x06000013 RID: 19 RVA: 0x000024A0 File Offset: 0x000008A0
public static T[] SortedRemoveAt<T>(this IList<T> list, IList<int> sorted_indices)
{
int count = sorted_indices.Count;
int count2 = list.Count;
T[] array = new T[count2 - count];
int num = 0;
for (int i = 0; i < count2; i++)
{
if (num < count && sorted_indices[num] == i)
{
while (num < count && sorted_indices[num] == i)
{
num++;
}
}
else
{
array[i - num] = list[i];
}
}
return array;
}
// Token: 0x06000014 RID: 20 RVA: 0x00002528 File Offset: 0x00000928
public static int NearestIndexPriorToValue<T>(IList<T> sorted_list, T value) where T : IComparable<T>
{
int count = sorted_list.Count;
if (count < 1)
{
return -1;
}
pbUtil.SearchRange searchRange = new pbUtil.SearchRange(0, count - 1);
if (value.CompareTo(sorted_list[0]) < 0)
{
return -1;
}
if (value.CompareTo(sorted_list[count - 1]) > 0)
{
return count - 1;
}
while (searchRange.Valid())
{
T t = sorted_list[searchRange.Center()];
if (t.CompareTo(value) > 0)
{
searchRange.end = searchRange.Center();
}
else
{
searchRange.begin = searchRange.Center();
T t2 = sorted_list[searchRange.begin + 1];
if (t2.CompareTo(value) >= 0)
{
return searchRange.begin;
}
}
}
return 0;
}
// Token: 0x06000015 RID: 21 RVA: 0x0000260D File Offset: 0x00000A0D
public static T[] Fill<T>(T val, int length)
{
return pbUtil.FilledArray<T>(val, length);
}
// Token: 0x06000016 RID: 22 RVA: 0x00002618 File Offset: 0x00000A18
public static List<T> Fill<T>(Func<int, T> ctor, int length)
{
List<T> list = new List<T>(length);
for (int i = 0; i < length; i++)
{
list.Add(ctor(i));
}
return list;
}
// Token: 0x06000017 RID: 23 RVA: 0x0000264C File Offset: 0x00000A4C
public static T[] FilledArray<T>(T val, int length)
{
T[] array = new T[length];
for (int i = 0; i < length; i++)
{
array[i] = val;
}
return array;
}
// Token: 0x06000018 RID: 24 RVA: 0x0000267C File Offset: 0x00000A7C
public static bool ContainsMatch<T>(this T[] a, T[] b)
{
for (int i = 0; i < a.Length; i++)
{
int num = Array.IndexOf<T>(b, a[i]);
if (num > -1)
{
return true;
}
}
return false;
}
// Token: 0x06000019 RID: 25 RVA: 0x000026B7 File Offset: 0x00000AB7
public static bool ContainsMatch<T>(this T[] a, T[] b, out int index_a, out int index_b)
{
index_b = -1;
for (index_a = 0; index_a < a.Length; index_a++)
{
index_b = Array.IndexOf<T>(b, a[index_a]);
if (index_b > -1)
{
return true;
}
}
return false;
}
// Token: 0x0600001A RID: 26 RVA: 0x000026F0 File Offset: 0x00000AF0
public static T[] Concat<T>(this T[] x, T[] y)
{
if (x == null)
{
throw new ArgumentNullException("x");
}
if (y == null)
{
throw new ArgumentNullException("y");
}
int num = x.Length;
Array.Resize<T>(ref x, x.Length + y.Length);
Array.Copy(y, 0, x, num, y.Length);
return x;
}
// Token: 0x0600001B RID: 27 RVA: 0x00002740 File Offset: 0x00000B40
public static int IndexOf<T>(this List<List<T>> InList, T InValue)
{
for (int i = 0; i < InList.Count; i++)
{
for (int j = 0; j < InList[i].Count; j++)
{
T t = InList[i][j];
if (t.Equals(InValue))
{
return i;
}
}
}
return -1;
}
// Token: 0x0600001C RID: 28 RVA: 0x000027AC File Offset: 0x00000BAC
public static T[] Fill<T>(int count, Func<int, T> ctor)
{
T[] array = new T[count];
for (int i = 0; i < count; i++)
{
array[i] = ctor(i);
}
return array;
}
// Token: 0x0600001D RID: 29 RVA: 0x000027E4 File Offset: 0x00000BE4
public static void AddOrAppend<T, K>(this Dictionary<T, List<K>> dictionary, T key, K value)
{
List<K> list;
if (dictionary.TryGetValue(key, out list))
{
list.Add(value);
}
else
{
dictionary.Add(key, new List<K> { value });
}
}
// Token: 0x0600001E RID: 30 RVA: 0x00002820 File Offset: 0x00000C20
public static void AddOrAppendRange<T, K>(this Dictionary<T, List<K>> dictionary, T key, List<K> value)
{
List<K> list;
if (dictionary.TryGetValue(key, out list))
{
list.AddRange(value);
}
else
{
dictionary.Add(key, value);
}
}
// Token: 0x0600001F RID: 31 RVA: 0x00002850 File Offset: 0x00000C50
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
{
HashSet<TKey> knownKeys = new HashSet<TKey>();
return source.Where((TSource x) => knownKeys.Add(keySelector(x)));
}
// Token: 0x06000020 RID: 32 RVA: 0x00002887 File Offset: 0x00000C87
[Obsolete]
public static string ToFormattedString<T>(this T[] t, string _delimiter)
{
return t.ToFormattedString(_delimiter, 0, -1);
}
// Token: 0x06000021 RID: 33 RVA: 0x00002894 File Offset: 0x00000C94
[Obsolete]
public static string ToFormattedString<T>(this T[] t, string _delimiter, int entriesPerLine, int maxEntries)
{
int num = ((maxEntries <= 0) ? t.Length : Mathf.Min(t.Length, maxEntries));
if (t == null || num < 1)
{
return "Empty Array.";
}
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < num - 1; i++)
{
if (entriesPerLine > 0 && (i + 1) % entriesPerLine == 0)
{
stringBuilder.AppendLine(((t[i] != null) ? t[i].ToString() : "null") + _delimiter);
}
else
{
stringBuilder.Append(((t[i] != null) ? t[i].ToString() : "null") + _delimiter);
}
}
stringBuilder.Append((t[num - 1] != null) ? t[num - 1].ToString() : "null");
return stringBuilder.ToString();
}
// Token: 0x06000022 RID: 34 RVA: 0x000029B5 File Offset: 0x00000DB5
[Obsolete]
public static string ToFormattedString<T>(this List<T> t, string _delimiter)
{
return t.ToArray().ToFormattedString(_delimiter);
}
// Token: 0x06000023 RID: 35 RVA: 0x000029C3 File Offset: 0x00000DC3
[Obsolete]
public static string ToFormattedString<T>(this HashSet<T> t, string _delimiter)
{
return t.ToArray<T>().ToFormattedString(_delimiter);
}
// Token: 0x06000024 RID: 36 RVA: 0x000029D4 File Offset: 0x00000DD4
public static string ToString<TKey, TValue>(this Dictionary<TKey, TValue> dict)
{
StringBuilder stringBuilder = new StringBuilder();
foreach (KeyValuePair<TKey, TValue> keyValuePair in dict)
{
stringBuilder.AppendLine(string.Format("Key: {0} Value: {1}", keyValuePair.Key, keyValuePair.Value));
}
return stringBuilder.ToString();
}
// Token: 0x06000025 RID: 37 RVA: 0x00002A5C File Offset: 0x00000E5C
public static string ToString<T>(this IEnumerable<T> arr, string separator = ", ")
{
return string.Join(separator, arr.Select((T x) => x.ToString()).ToArray<string>());
}
// Token: 0x06000026 RID: 38 RVA: 0x00002A7C File Offset: 0x00000E7C
public static string ControlKeyString(char character)
{
if (character == '⌘')
{
return "Control";
}
if (character == '⇧')
{
return "Shift";
}
if (character == '⌥')
{
return "Alt";
}
if (character == '⎇')
{
return "Alt";
}
if (character == '⌫')
{
return "Delete";
}
return character.ToString();
}
// Token: 0x06000027 RID: 39 RVA: 0x00002AEB File Offset: 0x00000EEB
[Obsolete("ColorWithString is deprecated. Use TryParseColor.")]
public static bool ColorWithString(string value, out Color col)
{
col = Color.white;
return pbUtil.TryParseColor(value, ref col);
}
// Token: 0x06000028 RID: 40 RVA: 0x00002B00 File Offset: 0x00000F00
public static bool TryParseColor(string value, ref Color col)
{
string valid = "01234567890.,";
value = new string(value.Where((char c) => valid.Contains(c)).ToArray<char>());
string[] array = value.Split(new char[] { ',' });
if (array.Length < 4)
{
return false;
}
try
{
float num = float.Parse(array[0]);
float num2 = float.Parse(array[1]);
float num3 = float.Parse(array[2]);
float num4 = float.Parse(array[3]);
col.r = num;
col.g = num2;
col.b = num3;
col.a = num4;
}
catch
{
return false;
}
return true;
}
// Token: 0x06000029 RID: 41 RVA: 0x00002BC0 File Offset: 0x00000FC0
public static Vector3[] StringToVector3Array(string str)
{
List<Vector3> list = new List<Vector3>();
str = str.Replace(" ", string.Empty);
string[] array = str.Split(new char[] { '\n' });
foreach (string text in array)
{
if (!text.Contains("//"))
{
string[] array3 = text.Split(new char[] { ',' });
if (array3.Length >= 3)
{
float num;
if (float.TryParse(array3[0], NumberStyles.Any, CultureInfo.InvariantCulture, out num))
{
float num2;
if (float.TryParse(array3[1], NumberStyles.Any, CultureInfo.InvariantCulture, out num2))
{
float num3;
if (float.TryParse(array3[2], NumberStyles.Any, CultureInfo.InvariantCulture, out num3))
{
list.Add(new Vector3(num, num2, num3));
}
}
}
}
}
}
return list.ToArray();
}
// Token: 0x0600002A RID: 42 RVA: 0x00002CC1 File Offset: 0x000010C1
public static Vector2 DivideBy(this Vector2 v, Vector2 o)
{
return new Vector2(v.x / o.x, v.y / o.y);
}
// Token: 0x0600002B RID: 43 RVA: 0x00002CE6 File Offset: 0x000010E6
public static Vector3 DivideBy(this Vector3 v, Vector3 o)
{
return new Vector3(v.x / o.x, v.y / o.y, v.z / o.z);
}
// Token: 0x02000004 RID: 4
private struct SearchRange
{
// Token: 0x0600002D RID: 45 RVA: 0x00002D29 File Offset: 0x00001129
public SearchRange(int begin, int end)
{
this.begin = begin;
this.end = end;
}
// Token: 0x0600002E RID: 46 RVA: 0x00002D39 File Offset: 0x00001139
public bool Valid()
{
return this.end - this.begin > 1;
}
// Token: 0x0600002F RID: 47 RVA: 0x00002D4B File Offset: 0x0000114B
public int Center()
{
return this.begin + (this.end - this.begin) / 2;
}
// Token: 0x06000030 RID: 48 RVA: 0x00002D64 File Offset: 0x00001164
public override string ToString()
{
return string.Concat(new object[]
{
"{",
this.begin,
", ",
this.end,
"} : ",
this.Center()
});
}
// Token: 0x04000002 RID: 2
public int begin;
// Token: 0x04000003 RID: 3
public int end;
}
}
}
+57
View File
@@ -0,0 +1,57 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000006 RID: 6
public class pb_ActionResult
{
// Token: 0x06000031 RID: 49 RVA: 0x00002DF5 File Offset: 0x000011F5
public pb_ActionResult(Status status, string notification)
{
this.status = status;
this.notification = notification;
}
// Token: 0x06000032 RID: 50 RVA: 0x00002E16 File Offset: 0x00001216
public static implicit operator bool(pb_ActionResult res)
{
return res.status == Status.Success;
}
// Token: 0x17000001 RID: 1
// (get) Token: 0x06000033 RID: 51 RVA: 0x00002E21 File Offset: 0x00001221
public static pb_ActionResult Success
{
get
{
return new pb_ActionResult(Status.Success, string.Empty);
}
}
// Token: 0x17000002 RID: 2
// (get) Token: 0x06000034 RID: 52 RVA: 0x00002E2E File Offset: 0x0000122E
public static pb_ActionResult NoSelection
{
get
{
return new pb_ActionResult(Status.Canceled, "Nothing Selected");
}
}
// Token: 0x17000003 RID: 3
// (get) Token: 0x06000035 RID: 53 RVA: 0x00002E3B File Offset: 0x0000123B
public static pb_ActionResult UserCanceled
{
get
{
return new pb_ActionResult(Status.Canceled, "User Canceled");
}
}
// Token: 0x04000009 RID: 9
public Status status;
// Token: 0x0400000A RID: 10
public string notification = string.Empty;
}
}
+119
View File
@@ -0,0 +1,119 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000048 RID: 72
[Serializable]
public struct pb_BezierPoint
{
// Token: 0x0600022A RID: 554 RVA: 0x0001DB57 File Offset: 0x0001BF57
public pb_BezierPoint(Vector3 position, Vector3 tangentIn, Vector3 tangentOut, Quaternion rotation)
{
this.position = position;
this.tangentIn = tangentIn;
this.tangentOut = tangentOut;
this.rotation = rotation;
}
// Token: 0x0600022B RID: 555 RVA: 0x0001DB78 File Offset: 0x0001BF78
public void EnforceTangentMode(pb_BezierTangentDirection master, pb_BezierTangentMode mode)
{
if (mode == pb_BezierTangentMode.Aligned)
{
if (master == pb_BezierTangentDirection.In)
{
this.tangentOut = this.position + (this.tangentOut - this.position).normalized * (this.tangentIn - this.position).magnitude;
}
else
{
this.tangentIn = this.position + (this.tangentIn - this.position).normalized * (this.tangentOut - this.position).magnitude;
}
}
else if (mode == pb_BezierTangentMode.Mirrored)
{
if (master == pb_BezierTangentDirection.In)
{
this.tangentOut = this.position - (this.tangentIn - this.position);
}
else
{
this.tangentIn = this.position - (this.tangentOut - this.position);
}
}
}
// Token: 0x0600022C RID: 556 RVA: 0x0001DC84 File Offset: 0x0001C084
public void SetPosition(Vector3 position)
{
Vector3 vector = position - this.position;
this.position = position;
this.tangentIn += vector;
this.tangentOut += vector;
}
// Token: 0x0600022D RID: 557 RVA: 0x0001DCC9 File Offset: 0x0001C0C9
public void SetTangentIn(Vector3 tangent, pb_BezierTangentMode mode)
{
this.tangentIn = tangent;
this.EnforceTangentMode(pb_BezierTangentDirection.In, mode);
}
// Token: 0x0600022E RID: 558 RVA: 0x0001DCDA File Offset: 0x0001C0DA
public void SetTangentOut(Vector3 tangent, pb_BezierTangentMode mode)
{
this.tangentOut = tangent;
this.EnforceTangentMode(pb_BezierTangentDirection.Out, mode);
}
// Token: 0x0600022F RID: 559 RVA: 0x0001DCEC File Offset: 0x0001C0EC
public static Vector3 QuadraticPosition(pb_BezierPoint a, pb_BezierPoint b, float t)
{
float num = (1f - t) * (1f - t) * a.position.x + 2f * (1f - t) * t * a.tangentOut.x + t * t * b.position.x;
float num2 = (1f - t) * (1f - t) * a.position.y + 2f * (1f - t) * t * a.tangentOut.y + t * t * b.position.y;
float num3 = (1f - t) * (1f - t) * a.position.z + 2f * (1f - t) * t * a.tangentOut.z + t * t * b.position.z;
return new Vector3(num, num2, num3);
}
// Token: 0x06000230 RID: 560 RVA: 0x0001DDE4 File Offset: 0x0001C1E4
public static Vector3 CubicPosition(pb_BezierPoint a, pb_BezierPoint b, float t)
{
t = Mathf.Clamp01(t);
float num = 1f - t;
return num * num * num * a.position + 3f * num * num * t * a.tangentOut + 3f * num * t * t * b.tangentIn + t * t * t * b.position;
}
// Token: 0x06000231 RID: 561 RVA: 0x0001DE60 File Offset: 0x0001C260
public static Vector3 GetLookDirection(IList<pb_BezierPoint> points, int index, int previous, int next)
{
if (previous < 0)
{
return (points[index].position - pb_BezierPoint.QuadraticPosition(points[index], points[next], 0.1f)).normalized;
}
if (next < 0)
{
return (pb_BezierPoint.QuadraticPosition(points[index], points[previous], 0.1f) - points[index].position).normalized;
}
if (next > -1 && previous > -1)
{
Vector3 normalized = (pb_BezierPoint.QuadraticPosition(points[index], points[previous], 0.1f) - points[index].position).normalized;
Vector3 normalized2 = (pb_BezierPoint.QuadraticPosition(points[index], points[next], 0.1f) - points[index].position).normalized;
return ((normalized + normalized2) * 0.5f).normalized;
}
return Vector3.forward;
}
// Token: 0x040001A4 RID: 420
public Vector3 position;
// Token: 0x040001A5 RID: 421
public Vector3 tangentIn;
// Token: 0x040001A6 RID: 422
public Vector3 tangentOut;
// Token: 0x040001A7 RID: 423
public Quaternion rotation;
}
}
+71
View File
@@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000007 RID: 7
[AddComponentMenu("")]
[DisallowMultipleComponent]
public class pb_BezierShape : MonoBehaviour
{
// Token: 0x17000004 RID: 4
// (get) Token: 0x06000037 RID: 55 RVA: 0x00002E7C File Offset: 0x0000127C
// (set) Token: 0x06000038 RID: 56 RVA: 0x00002EA1 File Offset: 0x000012A1
public pb_Object mesh
{
get
{
if (this.m_Mesh == null)
{
this.m_Mesh = base.GetComponent<pb_Object>();
}
return this.m_Mesh;
}
set
{
this.m_Mesh = value;
}
}
// Token: 0x06000039 RID: 57 RVA: 0x00002EAC File Offset: 0x000012AC
public void Init()
{
Vector3 vector = new Vector3(0f, 0f, 2f);
Vector3 vector2 = new Vector3(3f, 0f, 0f);
this.m_Points.Add(new pb_BezierPoint(Vector3.zero, -vector, vector, Quaternion.identity));
this.m_Points.Add(new pb_BezierPoint(vector2, vector2 + vector, vector2 + -vector, Quaternion.identity));
}
// Token: 0x0600003A RID: 58 RVA: 0x00002F30 File Offset: 0x00001330
public void Refresh()
{
pb_Object mesh = this.mesh;
pb_Spline.Extrude(this.m_Points, this.m_Radius, this.m_Columns, this.m_Rows, this.m_CloseLoop, this.m_Smooth, ref mesh);
}
// Token: 0x0400000B RID: 11
public List<pb_BezierPoint> m_Points = new List<pb_BezierPoint>();
// Token: 0x0400000C RID: 12
public bool m_CloseLoop;
// Token: 0x0400000D RID: 13
public float m_Radius = 0.5f;
// Token: 0x0400000E RID: 14
public int m_Rows = 8;
// Token: 0x0400000F RID: 15
public int m_Columns = 16;
// Token: 0x04000010 RID: 16
public bool m_Smooth = true;
// Token: 0x04000011 RID: 17
public bool m_IsEditing;
// Token: 0x04000012 RID: 18
private pb_Object m_Mesh;
}
}
@@ -0,0 +1,13 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000047 RID: 71
public enum pb_BezierTangentDirection
{
// Token: 0x040001A2 RID: 418
In,
// Token: 0x040001A3 RID: 419
Out
}
}
@@ -0,0 +1,15 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000046 RID: 70
public enum pb_BezierTangentMode
{
// Token: 0x0400019E RID: 414
Free,
// Token: 0x0400019F RID: 415
Aligned,
// Token: 0x040001A0 RID: 416
Mirrored
}
}
+332
View File
@@ -0,0 +1,332 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000049 RID: 73
public class pb_Bounds2D
{
// Token: 0x06000232 RID: 562 RVA: 0x0001DF85 File Offset: 0x0001C385
public pb_Bounds2D()
{
}
// Token: 0x06000233 RID: 563 RVA: 0x0001DFAE File Offset: 0x0001C3AE
public pb_Bounds2D(Vector2 center, Vector2 size)
{
this.center = center;
this.size = size;
}
// Token: 0x06000234 RID: 564 RVA: 0x0001DFE5 File Offset: 0x0001C3E5
public pb_Bounds2D(Vector2[] points)
{
this.SetWithPoints(points);
}
// Token: 0x06000235 RID: 565 RVA: 0x0001E015 File Offset: 0x0001C415
public pb_Bounds2D(Vector2[] points, int[] indices)
{
this.SetWithPoints(points, indices);
}
// Token: 0x06000236 RID: 566 RVA: 0x0001E048 File Offset: 0x0001C448
public pb_Bounds2D(Vector2[] points, pb_Edge[] edges)
{
float num = 0f;
float num2 = 0f;
float num3 = 0f;
float num4 = 0f;
if (points.Length > 0 && edges.Length > 0)
{
num = points[edges[0].x].x;
num3 = points[edges[0].x].y;
num2 = num;
num4 = num3;
for (int i = 0; i < edges.Length; i++)
{
num = Mathf.Min(num, points[edges[i].x].x);
num = Mathf.Min(num, points[edges[i].y].x);
num3 = Mathf.Min(num3, points[edges[i].x].y);
num3 = Mathf.Min(num3, points[edges[i].y].y);
num2 = Mathf.Max(num2, points[edges[i].x].x);
num2 = Mathf.Max(num2, points[edges[i].y].x);
num4 = Mathf.Max(num4, points[edges[i].x].y);
num4 = Mathf.Max(num4, points[edges[i].y].y);
}
}
this.center = new Vector2((num + num2) / 2f, (num3 + num4) / 2f);
this.size = new Vector3(num2 - num, num4 - num3);
}
// Token: 0x06000237 RID: 567 RVA: 0x0001E1F8 File Offset: 0x0001C5F8
public pb_Bounds2D(Vector2[] points, int length)
{
float num = 0f;
float num2 = 0f;
float num3 = 0f;
float num4 = 0f;
if (points.Length > 0)
{
num = points[0].x;
num3 = points[0].y;
num2 = num;
num4 = num3;
for (int i = 1; i < length; i++)
{
num = Mathf.Min(num, points[i].x);
num3 = Mathf.Min(num3, points[i].y);
num2 = Mathf.Max(num2, points[i].x);
num4 = Mathf.Max(num4, points[i].y);
}
}
this.center = new Vector2((num + num2) / 2f, (num3 + num4) / 2f);
this.size = new Vector3(num2 - num, num4 - num3);
}
// Token: 0x17000036 RID: 54
// (get) Token: 0x06000238 RID: 568 RVA: 0x0001E304 File Offset: 0x0001C704
// (set) Token: 0x06000239 RID: 569 RVA: 0x0001E30C File Offset: 0x0001C70C
public Vector2 size
{
get
{
return this._size;
}
set
{
this._size = value;
this._extents.x = this._size.x * 0.5f;
this._extents.y = this._size.y * 0.5f;
}
}
// Token: 0x17000037 RID: 55
// (get) Token: 0x0600023A RID: 570 RVA: 0x0001E358 File Offset: 0x0001C758
public Vector2 extents
{
get
{
return this._extents;
}
}
// Token: 0x17000038 RID: 56
// (get) Token: 0x0600023B RID: 571 RVA: 0x0001E360 File Offset: 0x0001C760
public Vector2[] corners
{
get
{
return new Vector2[]
{
new Vector2(this.center.x - this.extents.x, this.center.y + this.extents.y),
new Vector2(this.center.x + this.extents.x, this.center.y + this.extents.y),
new Vector2(this.center.x - this.extents.x, this.center.y - this.extents.y),
new Vector2(this.center.x + this.extents.x, this.center.y - this.extents.y)
};
}
}
// Token: 0x0600023C RID: 572 RVA: 0x0001E48C File Offset: 0x0001C88C
public bool ContainsPoint(Vector2 point)
{
return point.x <= this.center.x + this.extents.x && point.x >= this.center.x - this.extents.x && point.y <= this.center.y + this.extents.y && point.y >= this.center.y - this.extents.y;
}
// Token: 0x0600023D RID: 573 RVA: 0x0001E534 File Offset: 0x0001C934
public bool IntersectsLineSegment(Vector2 lineStart, Vector2 lineEnd)
{
if (this.ContainsPoint(lineStart) || this.ContainsPoint(lineEnd))
{
return true;
}
Vector2[] corners = this.corners;
return pb_Math.GetLineSegmentIntersect(corners[0], corners[1], lineStart, lineEnd) || pb_Math.GetLineSegmentIntersect(corners[1], corners[3], lineStart, lineEnd) || pb_Math.GetLineSegmentIntersect(corners[3], corners[2], lineStart, lineEnd) || pb_Math.GetLineSegmentIntersect(corners[2], corners[0], lineStart, lineEnd);
}
// Token: 0x0600023E RID: 574 RVA: 0x0001E5F0 File Offset: 0x0001C9F0
public bool Intersects(pb_Bounds2D bounds)
{
Vector2 vector = this.center - bounds.center;
Vector2 vector2 = this.size + bounds.size;
return Mathf.Abs(vector.x) * 2f < vector2.x && Mathf.Abs(vector.y) * 2f < vector2.y;
}
// Token: 0x0600023F RID: 575 RVA: 0x0001E660 File Offset: 0x0001CA60
public bool Intersects(Rect rect)
{
Vector2 vector = this.center - rect.center;
Vector2 vector2 = this.size + rect.size;
return Mathf.Abs(vector.x) * 2f < vector2.x && Mathf.Abs(vector.y) * 2f < vector2.y;
}
// Token: 0x06000240 RID: 576 RVA: 0x0001E6D0 File Offset: 0x0001CAD0
public void SetWithPoints(IList<Vector2> points)
{
float num = 0f;
float num2 = 0f;
float num3 = 0f;
float num4 = 0f;
int count = points.Count;
if (count > 0)
{
num = points[0].x;
num3 = points[0].y;
num2 = num;
num4 = num3;
for (int i = 1; i < count; i++)
{
float x = points[i].x;
float y = points[i].y;
if (x < num)
{
num = x;
}
if (x > num2)
{
num2 = x;
}
if (y < num3)
{
num3 = y;
}
if (y > num4)
{
num4 = y;
}
}
}
this.center.x = (num + num2) / 2f;
this.center.y = (num3 + num4) / 2f;
this._size.x = num2 - num;
this._size.y = num4 - num3;
this._extents.x = this._size.x * 0.5f;
this._extents.y = this._size.y * 0.5f;
}
// Token: 0x06000241 RID: 577 RVA: 0x0001E810 File Offset: 0x0001CC10
public void SetWithPoints(IList<Vector2> points, IList<int> indices)
{
float num = 0f;
float num2 = 0f;
float num3 = 0f;
float num4 = 0f;
if (points.Count > 0 && indices.Count > 0)
{
num = points[indices[0]].x;
num3 = points[indices[0]].y;
num2 = num;
num4 = num3;
for (int i = 1; i < indices.Count; i++)
{
float x = points[indices[i]].x;
float y = points[indices[i]].y;
if (x < num)
{
num = x;
}
if (x > num2)
{
num2 = x;
}
if (y < num3)
{
num3 = y;
}
if (y > num4)
{
num4 = y;
}
}
}
this.center.x = (num + num2) / 2f;
this.center.y = (num3 + num4) / 2f;
this._size.x = num2 - num;
this._size.y = num4 - num3;
this._extents.x = this._size.x * 0.5f;
this._extents.y = this._size.y * 0.5f;
}
// Token: 0x06000242 RID: 578 RVA: 0x0001E974 File Offset: 0x0001CD74
public static Vector2 Center(Vector2[] points, int length = -1)
{
int num = ((length >= 1) ? length : points.Length);
float num2 = points[0].x;
float num3 = points[0].y;
float num4 = num2;
float num5 = num3;
for (int i = 1; i < num; i++)
{
float x = points[i].x;
float y = points[i].y;
if (x < num2)
{
num2 = x;
}
if (x > num4)
{
num4 = x;
}
if (y < num3)
{
num3 = y;
}
if (y > num5)
{
num5 = y;
}
}
return new Vector2((num2 + num4) / 2f, (num3 + num5) / 2f);
}
// Token: 0x06000243 RID: 579 RVA: 0x0001EA44 File Offset: 0x0001CE44
public static Vector2 Center(Vector2[] points, int[] indices)
{
int num = indices.Length;
float num2 = points[indices[0]].x;
float num3 = points[indices[0]].y;
float num4 = num2;
float num5 = num3;
for (int i = 1; i < num; i++)
{
float x = points[indices[i]].x;
float y = points[indices[i]].y;
if (x < num2)
{
num2 = x;
}
if (x > num4)
{
num4 = x;
}
if (y < num3)
{
num3 = y;
}
if (y > num5)
{
num5 = y;
}
}
return new Vector2((num2 + num4) / 2f, (num3 + num5) / 2f);
}
// Token: 0x06000244 RID: 580 RVA: 0x0001EB0C File Offset: 0x0001CF0C
public override string ToString()
{
return string.Concat(new object[] { "[cen: ", this.center, " size: ", this.size, "]" });
}
// Token: 0x040001A8 RID: 424
public Vector2 center = Vector2.zero;
// Token: 0x040001A9 RID: 425
[SerializeField]
private Vector2 _size = Vector2.zero;
// Token: 0x040001AA RID: 426
[SerializeField]
private Vector2 _extents = Vector2.zero;
}
}
+45
View File
@@ -0,0 +1,45 @@
using System;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x0200000A RID: 10
public class pb_CIE_Lab_Color
{
// Token: 0x06000044 RID: 68 RVA: 0x00003077 File Offset: 0x00001477
public pb_CIE_Lab_Color(float L, float a, float b)
{
this.L = L;
this.a = a;
this.b = b;
}
// Token: 0x06000045 RID: 69 RVA: 0x00003094 File Offset: 0x00001494
public static pb_CIE_Lab_Color FromXYZ(pb_XYZ_Color xyz)
{
return pb_ColorUtil.XYZToCIE_Lab(xyz);
}
// Token: 0x06000046 RID: 70 RVA: 0x0000309C File Offset: 0x0000149C
public static pb_CIE_Lab_Color FromRGB(Color col)
{
pb_XYZ_Color pb_XYZ_Color = pb_XYZ_Color.FromRGB(col);
return pb_ColorUtil.XYZToCIE_Lab(pb_XYZ_Color);
}
// Token: 0x06000047 RID: 71 RVA: 0x000030B6 File Offset: 0x000014B6
public override string ToString()
{
return string.Format("( {0}, {1}, {2} )", this.L, this.a, this.b);
}
// Token: 0x04000019 RID: 25
public float L;
// Token: 0x0400001A RID: 26
public float a;
// Token: 0x0400001B RID: 27
public float b;
}
}
+58
View File
@@ -0,0 +1,58 @@
using System;
using UnityEngine;
// Token: 0x0200004A RID: 74
[Serializable]
public class pb_Color
{
// Token: 0x06000245 RID: 581 RVA: 0x0001EB58 File Offset: 0x0001CF58
public pb_Color()
{
this.r = 0f;
this.g = 0f;
this.b = 0f;
this.a = 0f;
}
// Token: 0x06000246 RID: 582 RVA: 0x0001EB8C File Offset: 0x0001CF8C
public pb_Color(Color c)
{
this.r = c.r;
this.g = c.g;
this.b = c.b;
this.a = c.a;
}
// Token: 0x06000247 RID: 583 RVA: 0x0001EBC8 File Offset: 0x0001CFC8
public pb_Color(float r, float g, float b, float a)
{
this.r = r;
this.g = g;
this.b = b;
this.a = a;
}
// Token: 0x06000248 RID: 584 RVA: 0x0001EBED File Offset: 0x0001CFED
public static implicit operator Color(pb_Color c)
{
return new Color(c.r, c.g, c.b, c.a);
}
// Token: 0x06000249 RID: 585 RVA: 0x0001EC0C File Offset: 0x0001D00C
public static implicit operator pb_Color(Color c)
{
return new pb_Color(c);
}
// Token: 0x040001AB RID: 427
public float r;
// Token: 0x040001AC RID: 428
public float g;
// Token: 0x040001AD RID: 429
public float b;
// Token: 0x040001AE RID: 430
public float a;
}
+47
View File
@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x0200004B RID: 75
[Serializable]
public class pb_ColorPalette : ScriptableObject, pb_IHasDefault
{
// Token: 0x0600024B RID: 587 RVA: 0x0001EC28 File Offset: 0x0001D028
public void SetDefaultValues()
{
this.colors = new List<Color>
{
new Color(0f, 0.122f, 0.247f, 1f),
new Color(0f, 0.455f, 0.851f, 1f),
new Color(0.498f, 0.859f, 1f, 1f),
new Color(0.224f, 0.8f, 0.8f, 1f),
new Color(0.239f, 0.6f, 0.439f, 1f),
new Color(0.18f, 0.8f, 0.251f, 1f),
new Color(0.004f, 1f, 0.439f, 1f),
new Color(1f, 0.863f, 0f, 1f),
new Color(1f, 0.522f, 0.106f, 1f),
new Color(1f, 0.255f, 0.212f, 1f),
new Color(0.522f, 0.078f, 0.294f, 1f),
new Color(0.941f, 0.071f, 0.745f, 1f),
new Color(0.694f, 0.051f, 0.788f, 1f),
new Color(0.067f, 0.067f, 0.067f, 1f),
new Color(0.667f, 0.667f, 0.667f, 1f),
new Color(0.867f, 0.867f, 0.867f, 1f)
};
}
// Token: 0x0600024C RID: 588 RVA: 0x0001EE32 File Offset: 0x0001D232
public void CopyTo(pb_ColorPalette target)
{
target.colors = new List<Color>(this.colors);
}
// Token: 0x040001AF RID: 431
public Color current = Color.white;
// Token: 0x040001B0 RID: 432
public List<Color> colors;
}
}
+4896
View File
@@ -0,0 +1,4896 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x0200000B RID: 11
public static class pb_ColorUtil
{
// Token: 0x06000048 RID: 72 RVA: 0x000030E3 File Offset: 0x000014E3
private static bool approx(float lhs, float rhs)
{
return Mathf.Abs(lhs - rhs) < Mathf.Epsilon;
}
// Token: 0x06000049 RID: 73 RVA: 0x000030F4 File Offset: 0x000014F4
public static pb_XYZ_Color RGBToXYZ(Color col)
{
return pb_ColorUtil.RGBToXYZ(col.r, col.g, col.b);
}
// Token: 0x0600004A RID: 74 RVA: 0x00003110 File Offset: 0x00001510
public static pb_XYZ_Color RGBToXYZ(float r, float g, float b)
{
if (r > 0.04045f)
{
r = Mathf.Pow((r + 0.055f) / 1.055f, 2.4f);
}
else
{
r /= 12.92f;
}
if (g > 0.04045f)
{
g = Mathf.Pow((g + 0.055f) / 1.055f, 2.4f);
}
else
{
g /= 12.92f;
}
if (b > 0.04045f)
{
b = Mathf.Pow((b + 0.055f) / 1.055f, 2.4f);
}
else
{
b /= 12.92f;
}
r *= 100f;
g *= 100f;
b *= 100f;
float num = r * 0.4124f + g * 0.3576f + b * 0.1805f;
float num2 = r * 0.2126f + g * 0.7152f + b * 0.0722f;
float num3 = r * 0.0193f + g * 0.1192f + b * 0.9505f;
return new pb_XYZ_Color(num, num2, num3);
}
// Token: 0x0600004B RID: 75 RVA: 0x00003220 File Offset: 0x00001620
public static pb_CIE_Lab_Color XYZToCIE_Lab(pb_XYZ_Color xyz)
{
float num = xyz.x / 95.047f;
float num2 = xyz.y / 100f;
float num3 = xyz.z / 108.883f;
if (num > 0.008856f)
{
num = Mathf.Pow(num, 0.33333334f);
}
else
{
num = 7.787f * num + 0.13793103f;
}
if (num2 > 0.008856f)
{
num2 = Mathf.Pow(num2, 0.33333334f);
}
else
{
num2 = 7.787f * num2 + 0.13793103f;
}
if (num3 > 0.008856f)
{
num3 = Mathf.Pow(num3, 0.33333334f);
}
else
{
num3 = 7.787f * num3 + 0.13793103f;
}
float num4 = 116f * num2 - 16f;
float num5 = 500f * (num - num2);
float num6 = 200f * (num2 - num3);
return new pb_CIE_Lab_Color(num4, num5, num6);
}
// Token: 0x0600004C RID: 76 RVA: 0x00003300 File Offset: 0x00001700
public static float DeltaE(pb_CIE_Lab_Color lhs, pb_CIE_Lab_Color rhs)
{
return Mathf.Sqrt(Mathf.Pow(lhs.L - rhs.L, 2f) + Mathf.Pow(lhs.a - rhs.a, 2f) + Mathf.Pow(lhs.b - rhs.b, 2f));
}
// Token: 0x0600004D RID: 77 RVA: 0x00003359 File Offset: 0x00001759
public static Color HSVtoRGB(pb_HsvColor hsv)
{
return pb_ColorUtil.HSVtoRGB(hsv.h, hsv.s, hsv.v);
}
// Token: 0x0600004E RID: 78 RVA: 0x00003374 File Offset: 0x00001774
public static Color HSVtoRGB(float h, float s, float v)
{
if (s == 0f)
{
return new Color(v, v, v, 1f);
}
h /= 60f;
int num = (int)Mathf.Floor(h);
float num2 = h - (float)num;
float num3 = v * (1f - s);
float num4 = v * (1f - s * num2);
float num5 = v * (1f - s * (1f - num2));
float num6;
float num7;
float num8;
switch (num)
{
case 0:
num6 = v;
num7 = num5;
num8 = num3;
break;
case 1:
num6 = num4;
num7 = v;
num8 = num3;
break;
case 2:
num6 = num3;
num7 = v;
num8 = num5;
break;
case 3:
num6 = num3;
num7 = num4;
num8 = v;
break;
case 4:
num6 = num5;
num7 = num3;
num8 = v;
break;
default:
num6 = v;
num7 = num3;
num8 = num4;
break;
}
return new Color(num6, num7, num8, 1f);
}
// Token: 0x0600004F RID: 79 RVA: 0x00003458 File Offset: 0x00001858
public static pb_HsvColor RGBtoHSV(Color color)
{
float r = color.r;
float b = color.b;
float g = color.g;
float num = Mathf.Min(Mathf.Min(r, g), b);
float num2 = Mathf.Max(Mathf.Max(r, g), b);
float num3 = num2;
float num4 = num2 - num;
float num5;
float num6;
if (num2 != 0f)
{
num5 = num4 / num2;
if (pb_ColorUtil.approx(r, num2))
{
num6 = (g - b) / num4;
if (float.IsNaN(num6))
{
num6 = 0f;
}
}
else if (pb_ColorUtil.approx(g, num2))
{
num6 = 2f + (b - r) / num4;
}
else
{
num6 = 4f + (r - g) / num4;
}
num6 *= 60f;
if (num6 < 0f)
{
num6 += 360f;
}
return new pb_HsvColor(num6, num5, num3);
}
num5 = 0f;
num6 = 0f;
return new pb_HsvColor(num6, num5, num3);
}
// Token: 0x06000050 RID: 80 RVA: 0x00003558 File Offset: 0x00001958
public static string GetColorName(Color InColor)
{
pb_CIE_Lab_Color pb_CIE_Lab_Color = pb_CIE_Lab_Color.FromRGB(InColor);
string text = "Unknown";
float num = float.PositiveInfinity;
foreach (KeyValuePair<string, pb_CIE_Lab_Color> keyValuePair in pb_ColorUtil.ColorNameLookup)
{
float num2 = Mathf.Abs(pb_ColorUtil.DeltaE(pb_CIE_Lab_Color, keyValuePair.Value));
if (num2 < num)
{
num = num2;
text = keyValuePair.Key;
}
}
return text;
}
// Token: 0x06000051 RID: 81 RVA: 0x000035E8 File Offset: 0x000019E8
private static pb_CIE_Lab_Color CIELabFromRGB(float R, float G, float B, float Scale)
{
float num = 1f / Scale;
pb_XYZ_Color pb_XYZ_Color = pb_XYZ_Color.FromRGB(R * num, G * num, B * num);
return pb_CIE_Lab_Color.FromXYZ(pb_XYZ_Color);
}
// Token: 0x0400001C RID: 28
private static readonly Dictionary<string, pb_CIE_Lab_Color> ColorNameLookup = new Dictionary<string, pb_CIE_Lab_Color>
{
{
"Acid Green",
pb_ColorUtil.CIELabFromRGB(69f, 75f, 10f, 100f)
},
{
"Aero",
pb_ColorUtil.CIELabFromRGB(49f, 73f, 91f, 100f)
},
{
"Aero Blue",
pb_ColorUtil.CIELabFromRGB(79f, 100f, 90f, 100f)
},
{
"African Violet",
pb_ColorUtil.CIELabFromRGB(70f, 52f, 75f, 100f)
},
{
"Air Force Blue (RAF)",
pb_ColorUtil.CIELabFromRGB(36f, 54f, 66f, 100f)
},
{
"Air Force Blue (USAF)",
pb_ColorUtil.CIELabFromRGB(0f, 19f, 56f, 100f)
},
{
"Air Superiority Blue",
pb_ColorUtil.CIELabFromRGB(45f, 63f, 76f, 100f)
},
{
"Alabama Crimson",
pb_ColorUtil.CIELabFromRGB(69f, 0f, 16f, 100f)
},
{
"Alice Blue",
pb_ColorUtil.CIELabFromRGB(94f, 97f, 100f, 100f)
},
{
"Alizarin Crimson",
pb_ColorUtil.CIELabFromRGB(89f, 15f, 21f, 100f)
},
{
"Alloy Orange",
pb_ColorUtil.CIELabFromRGB(77f, 38f, 6f, 100f)
},
{
"Almond",
pb_ColorUtil.CIELabFromRGB(94f, 87f, 80f, 100f)
},
{
"Amaranth",
pb_ColorUtil.CIELabFromRGB(90f, 17f, 31f, 100f)
},
{
"Amaranth Deep Purple",
pb_ColorUtil.CIELabFromRGB(67f, 15f, 31f, 100f)
},
{
"Amaranth Pink",
pb_ColorUtil.CIELabFromRGB(95f, 61f, 73f, 100f)
},
{
"Amaranth Purple",
pb_ColorUtil.CIELabFromRGB(67f, 15f, 31f, 100f)
},
{
"Amaranth Red",
pb_ColorUtil.CIELabFromRGB(83f, 13f, 18f, 100f)
},
{
"Amazon",
pb_ColorUtil.CIELabFromRGB(23f, 48f, 34f, 100f)
},
{
"Amber",
pb_ColorUtil.CIELabFromRGB(100f, 75f, 0f, 100f)
},
{
"Amber (SAE/ECE)",
pb_ColorUtil.CIELabFromRGB(100f, 49f, 0f, 100f)
},
{
"American Rose",
pb_ColorUtil.CIELabFromRGB(100f, 1f, 24f, 100f)
},
{
"Amethyst",
pb_ColorUtil.CIELabFromRGB(60f, 40f, 80f, 100f)
},
{
"Android Green",
pb_ColorUtil.CIELabFromRGB(64f, 78f, 22f, 100f)
},
{
"Anti-Flash White",
pb_ColorUtil.CIELabFromRGB(95f, 95f, 96f, 100f)
},
{
"Antique Brass",
pb_ColorUtil.CIELabFromRGB(80f, 58f, 46f, 100f)
},
{
"Antique Bronze",
pb_ColorUtil.CIELabFromRGB(40f, 36f, 12f, 100f)
},
{
"Antique Fuchsia",
pb_ColorUtil.CIELabFromRGB(57f, 36f, 51f, 100f)
},
{
"Antique Ruby",
pb_ColorUtil.CIELabFromRGB(52f, 11f, 18f, 100f)
},
{
"Antique White",
pb_ColorUtil.CIELabFromRGB(98f, 92f, 84f, 100f)
},
{
"Ao (English)",
pb_ColorUtil.CIELabFromRGB(0f, 50f, 0f, 100f)
},
{
"Apple Green",
pb_ColorUtil.CIELabFromRGB(55f, 71f, 0f, 100f)
},
{
"Apricot",
pb_ColorUtil.CIELabFromRGB(98f, 81f, 69f, 100f)
},
{
"Aqua",
pb_ColorUtil.CIELabFromRGB(0f, 100f, 100f, 100f)
},
{
"Aquamarine",
pb_ColorUtil.CIELabFromRGB(50f, 100f, 83f, 100f)
},
{
"Army Green",
pb_ColorUtil.CIELabFromRGB(29f, 33f, 13f, 100f)
},
{
"Arsenic",
pb_ColorUtil.CIELabFromRGB(23f, 27f, 29f, 100f)
},
{
"Artichoke",
pb_ColorUtil.CIELabFromRGB(56f, 59f, 47f, 100f)
},
{
"Arylide Yellow",
pb_ColorUtil.CIELabFromRGB(91f, 84f, 42f, 100f)
},
{
"Ash Grey",
pb_ColorUtil.CIELabFromRGB(70f, 75f, 71f, 100f)
},
{
"Asparagus",
pb_ColorUtil.CIELabFromRGB(53f, 66f, 42f, 100f)
},
{
"Atomic Tangerine",
pb_ColorUtil.CIELabFromRGB(100f, 60f, 40f, 100f)
},
{
"Auburn",
pb_ColorUtil.CIELabFromRGB(65f, 16f, 16f, 100f)
},
{
"Aureolin",
pb_ColorUtil.CIELabFromRGB(99f, 93f, 0f, 100f)
},
{
"AuroMetalSaurus",
pb_ColorUtil.CIELabFromRGB(43f, 50f, 50f, 100f)
},
{
"Avocado",
pb_ColorUtil.CIELabFromRGB(34f, 51f, 1f, 100f)
},
{
"Azure",
pb_ColorUtil.CIELabFromRGB(0f, 50f, 100f, 100f)
},
{
"Azure (Web Color)",
pb_ColorUtil.CIELabFromRGB(94f, 100f, 100f, 100f)
},
{
"Azure Mist",
pb_ColorUtil.CIELabFromRGB(94f, 100f, 100f, 100f)
},
{
"Azureish White",
pb_ColorUtil.CIELabFromRGB(86f, 91f, 96f, 100f)
},
{
"Baby Blue",
pb_ColorUtil.CIELabFromRGB(54f, 81f, 94f, 100f)
},
{
"Baby Blue Eyes",
pb_ColorUtil.CIELabFromRGB(63f, 79f, 95f, 100f)
},
{
"Baby Pink",
pb_ColorUtil.CIELabFromRGB(96f, 76f, 76f, 100f)
},
{
"Baby Powder",
pb_ColorUtil.CIELabFromRGB(100f, 100f, 98f, 100f)
},
{
"Baker-Miller Pink",
pb_ColorUtil.CIELabFromRGB(100f, 57f, 69f, 100f)
},
{
"Ball Blue",
pb_ColorUtil.CIELabFromRGB(13f, 67f, 80f, 100f)
},
{
"Banana Mania",
pb_ColorUtil.CIELabFromRGB(98f, 91f, 71f, 100f)
},
{
"Banana Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 88f, 21f, 100f)
},
{
"Bangladesh Green",
pb_ColorUtil.CIELabFromRGB(0f, 42f, 31f, 100f)
},
{
"Barbie Pink",
pb_ColorUtil.CIELabFromRGB(88f, 13f, 54f, 100f)
},
{
"Barn Red",
pb_ColorUtil.CIELabFromRGB(49f, 4f, 1f, 100f)
},
{
"Battleship Grey",
pb_ColorUtil.CIELabFromRGB(52f, 52f, 51f, 100f)
},
{
"Bazaar",
pb_ColorUtil.CIELabFromRGB(60f, 47f, 48f, 100f)
},
{
"Beau Blue",
pb_ColorUtil.CIELabFromRGB(74f, 83f, 90f, 100f)
},
{
"Beaver",
pb_ColorUtil.CIELabFromRGB(62f, 51f, 44f, 100f)
},
{
"Beige",
pb_ColorUtil.CIELabFromRGB(96f, 96f, 86f, 100f)
},
{
"B'dazzled Blue",
pb_ColorUtil.CIELabFromRGB(18f, 35f, 58f, 100f)
},
{
"Big Dip Oruby",
pb_ColorUtil.CIELabFromRGB(61f, 15f, 26f, 100f)
},
{
"Bisque",
pb_ColorUtil.CIELabFromRGB(100f, 89f, 77f, 100f)
},
{
"Bistre",
pb_ColorUtil.CIELabFromRGB(24f, 17f, 12f, 100f)
},
{
"Bistre Brown",
pb_ColorUtil.CIELabFromRGB(59f, 44f, 9f, 100f)
},
{
"Bitter Lemon",
pb_ColorUtil.CIELabFromRGB(79f, 88f, 5f, 100f)
},
{
"Bitter Lime",
pb_ColorUtil.CIELabFromRGB(75f, 100f, 0f, 100f)
},
{
"Bittersweet",
pb_ColorUtil.CIELabFromRGB(100f, 44f, 37f, 100f)
},
{
"Bittersweet Shimmer",
pb_ColorUtil.CIELabFromRGB(75f, 31f, 32f, 100f)
},
{
"Black",
pb_ColorUtil.CIELabFromRGB(0f, 0f, 0f, 100f)
},
{
"Black Bean",
pb_ColorUtil.CIELabFromRGB(24f, 5f, 1f, 100f)
},
{
"Black Leather Jacket",
pb_ColorUtil.CIELabFromRGB(15f, 21f, 16f, 100f)
},
{
"Black Olive",
pb_ColorUtil.CIELabFromRGB(23f, 24f, 21f, 100f)
},
{
"Blanched Almond",
pb_ColorUtil.CIELabFromRGB(100f, 92f, 80f, 100f)
},
{
"Blast-Off Bronze",
pb_ColorUtil.CIELabFromRGB(65f, 44f, 39f, 100f)
},
{
"Bleu De France",
pb_ColorUtil.CIELabFromRGB(19f, 55f, 91f, 100f)
},
{
"Blizzard Blue",
pb_ColorUtil.CIELabFromRGB(67f, 90f, 93f, 100f)
},
{
"Blond",
pb_ColorUtil.CIELabFromRGB(98f, 94f, 75f, 100f)
},
{
"Blue",
pb_ColorUtil.CIELabFromRGB(0f, 0f, 100f, 100f)
},
{
"Blue (Crayola)",
pb_ColorUtil.CIELabFromRGB(12f, 46f, 100f, 100f)
},
{
"Blue (Munsell)",
pb_ColorUtil.CIELabFromRGB(0f, 58f, 69f, 100f)
},
{
"Blue (NCS)",
pb_ColorUtil.CIELabFromRGB(0f, 53f, 74f, 100f)
},
{
"Blue (Pantone)",
pb_ColorUtil.CIELabFromRGB(0f, 9f, 66f, 100f)
},
{
"Blue (Pigment)",
pb_ColorUtil.CIELabFromRGB(20f, 20f, 60f, 100f)
},
{
"Blue (RYB)",
pb_ColorUtil.CIELabFromRGB(1f, 28f, 100f, 100f)
},
{
"Blue Bell",
pb_ColorUtil.CIELabFromRGB(64f, 64f, 82f, 100f)
},
{
"Blue-Gray",
pb_ColorUtil.CIELabFromRGB(40f, 60f, 80f, 100f)
},
{
"Blue-Green",
pb_ColorUtil.CIELabFromRGB(5f, 60f, 73f, 100f)
},
{
"Blue Lagoon",
pb_ColorUtil.CIELabFromRGB(37f, 58f, 63f, 100f)
},
{
"Blue-Magenta Violet",
pb_ColorUtil.CIELabFromRGB(33f, 21f, 57f, 100f)
},
{
"Blue Sapphire",
pb_ColorUtil.CIELabFromRGB(7f, 38f, 50f, 100f)
},
{
"Blue-Violet",
pb_ColorUtil.CIELabFromRGB(54f, 17f, 89f, 100f)
},
{
"Blue Yonder",
pb_ColorUtil.CIELabFromRGB(31f, 45f, 65f, 100f)
},
{
"Blueberry",
pb_ColorUtil.CIELabFromRGB(31f, 53f, 97f, 100f)
},
{
"Bluebonnet",
pb_ColorUtil.CIELabFromRGB(11f, 11f, 94f, 100f)
},
{
"Blush",
pb_ColorUtil.CIELabFromRGB(87f, 36f, 51f, 100f)
},
{
"Bole",
pb_ColorUtil.CIELabFromRGB(47f, 27f, 23f, 100f)
},
{
"Bondi Blue",
pb_ColorUtil.CIELabFromRGB(0f, 58f, 71f, 100f)
},
{
"Bone",
pb_ColorUtil.CIELabFromRGB(89f, 85f, 79f, 100f)
},
{
"Boston University Red",
pb_ColorUtil.CIELabFromRGB(80f, 0f, 0f, 100f)
},
{
"Bottle Green",
pb_ColorUtil.CIELabFromRGB(0f, 42f, 31f, 100f)
},
{
"Boysenberry",
pb_ColorUtil.CIELabFromRGB(53f, 20f, 38f, 100f)
},
{
"Brandeis Blue",
pb_ColorUtil.CIELabFromRGB(0f, 44f, 100f, 100f)
},
{
"Brass",
pb_ColorUtil.CIELabFromRGB(71f, 65f, 26f, 100f)
},
{
"Brick Red",
pb_ColorUtil.CIELabFromRGB(80f, 25f, 33f, 100f)
},
{
"Bright Cerulean",
pb_ColorUtil.CIELabFromRGB(11f, 67f, 84f, 100f)
},
{
"Bright Green",
pb_ColorUtil.CIELabFromRGB(40f, 100f, 0f, 100f)
},
{
"Bright Lavender",
pb_ColorUtil.CIELabFromRGB(75f, 58f, 89f, 100f)
},
{
"Bright Lilac",
pb_ColorUtil.CIELabFromRGB(85f, 57f, 94f, 100f)
},
{
"Bright Maroon",
pb_ColorUtil.CIELabFromRGB(76f, 13f, 28f, 100f)
},
{
"Bright Navy Blue",
pb_ColorUtil.CIELabFromRGB(10f, 45f, 82f, 100f)
},
{
"Bright Pink",
pb_ColorUtil.CIELabFromRGB(100f, 0f, 50f, 100f)
},
{
"Bright Turquoise",
pb_ColorUtil.CIELabFromRGB(3f, 91f, 87f, 100f)
},
{
"Bright Ube",
pb_ColorUtil.CIELabFromRGB(82f, 62f, 91f, 100f)
},
{
"Brilliant Azure",
pb_ColorUtil.CIELabFromRGB(20f, 60f, 100f, 100f)
},
{
"Brilliant Lavender",
pb_ColorUtil.CIELabFromRGB(96f, 73f, 100f, 100f)
},
{
"Brilliant Rose",
pb_ColorUtil.CIELabFromRGB(100f, 33f, 64f, 100f)
},
{
"Brink Pink",
pb_ColorUtil.CIELabFromRGB(98f, 38f, 50f, 100f)
},
{
"British Racing Green",
pb_ColorUtil.CIELabFromRGB(0f, 26f, 15f, 100f)
},
{
"Bronze",
pb_ColorUtil.CIELabFromRGB(80f, 50f, 20f, 100f)
},
{
"Bronze Yellow",
pb_ColorUtil.CIELabFromRGB(45f, 44f, 0f, 100f)
},
{
"Brown (Traditional)",
pb_ColorUtil.CIELabFromRGB(59f, 29f, 0f, 100f)
},
{
"Brown (Web)",
pb_ColorUtil.CIELabFromRGB(65f, 16f, 16f, 100f)
},
{
"Brown-Nose",
pb_ColorUtil.CIELabFromRGB(42f, 27f, 14f, 100f)
},
{
"Brown Yellow",
pb_ColorUtil.CIELabFromRGB(80f, 60f, 40f, 100f)
},
{
"Brunswick Green",
pb_ColorUtil.CIELabFromRGB(11f, 30f, 24f, 100f)
},
{
"Bubble Gum",
pb_ColorUtil.CIELabFromRGB(100f, 76f, 80f, 100f)
},
{
"Bubbles",
pb_ColorUtil.CIELabFromRGB(91f, 100f, 100f, 100f)
},
{
"Buff",
pb_ColorUtil.CIELabFromRGB(94f, 86f, 51f, 100f)
},
{
"Bud Green",
pb_ColorUtil.CIELabFromRGB(48f, 71f, 38f, 100f)
},
{
"Bulgarian Rose",
pb_ColorUtil.CIELabFromRGB(28f, 2f, 3f, 100f)
},
{
"Burgundy",
pb_ColorUtil.CIELabFromRGB(50f, 0f, 13f, 100f)
},
{
"Burlywood",
pb_ColorUtil.CIELabFromRGB(87f, 72f, 53f, 100f)
},
{
"Burnt Orange",
pb_ColorUtil.CIELabFromRGB(80f, 33f, 0f, 100f)
},
{
"Burnt Sienna",
pb_ColorUtil.CIELabFromRGB(91f, 45f, 32f, 100f)
},
{
"Burnt Umber",
pb_ColorUtil.CIELabFromRGB(54f, 20f, 14f, 100f)
},
{
"Byzantine",
pb_ColorUtil.CIELabFromRGB(74f, 20f, 64f, 100f)
},
{
"Byzantium",
pb_ColorUtil.CIELabFromRGB(44f, 16f, 39f, 100f)
},
{
"Cadet",
pb_ColorUtil.CIELabFromRGB(33f, 41f, 45f, 100f)
},
{
"Cadet Blue",
pb_ColorUtil.CIELabFromRGB(37f, 62f, 63f, 100f)
},
{
"Cadet Grey",
pb_ColorUtil.CIELabFromRGB(57f, 64f, 69f, 100f)
},
{
"Cadmium Green",
pb_ColorUtil.CIELabFromRGB(0f, 42f, 24f, 100f)
},
{
"Cadmium Orange",
pb_ColorUtil.CIELabFromRGB(93f, 53f, 18f, 100f)
},
{
"Cadmium Red",
pb_ColorUtil.CIELabFromRGB(89f, 0f, 13f, 100f)
},
{
"Cadmium Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 96f, 0f, 100f)
},
{
"Cafe Au Lait",
pb_ColorUtil.CIELabFromRGB(65f, 48f, 36f, 100f)
},
{
"Cafe Noir",
pb_ColorUtil.CIELabFromRGB(29f, 21f, 13f, 100f)
},
{
"Cal Poly Green",
pb_ColorUtil.CIELabFromRGB(12f, 30f, 17f, 100f)
},
{
"Cambridge Blue",
pb_ColorUtil.CIELabFromRGB(64f, 76f, 68f, 100f)
},
{
"Camel",
pb_ColorUtil.CIELabFromRGB(76f, 60f, 42f, 100f)
},
{
"Cameo Pink",
pb_ColorUtil.CIELabFromRGB(94f, 73f, 80f, 100f)
},
{
"Camouflage Green",
pb_ColorUtil.CIELabFromRGB(47f, 53f, 42f, 100f)
},
{
"Canary Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 94f, 0f, 100f)
},
{
"Candy Apple Red",
pb_ColorUtil.CIELabFromRGB(100f, 3f, 0f, 100f)
},
{
"Candy Pink",
pb_ColorUtil.CIELabFromRGB(89f, 44f, 48f, 100f)
},
{
"Capri",
pb_ColorUtil.CIELabFromRGB(0f, 75f, 100f, 100f)
},
{
"Caput Mortuum",
pb_ColorUtil.CIELabFromRGB(35f, 15f, 13f, 100f)
},
{
"Cardinal",
pb_ColorUtil.CIELabFromRGB(77f, 12f, 23f, 100f)
},
{
"Caribbean Green",
pb_ColorUtil.CIELabFromRGB(0f, 80f, 60f, 100f)
},
{
"Carmine",
pb_ColorUtil.CIELabFromRGB(59f, 0f, 9f, 100f)
},
{
"Carmine (M&P)",
pb_ColorUtil.CIELabFromRGB(84f, 0f, 25f, 100f)
},
{
"Carmine Pink",
pb_ColorUtil.CIELabFromRGB(92f, 30f, 26f, 100f)
},
{
"Carmine Red",
pb_ColorUtil.CIELabFromRGB(100f, 0f, 22f, 100f)
},
{
"Carnation Pink",
pb_ColorUtil.CIELabFromRGB(100f, 65f, 79f, 100f)
},
{
"Carnelian",
pb_ColorUtil.CIELabFromRGB(70f, 11f, 11f, 100f)
},
{
"Carolina Blue",
pb_ColorUtil.CIELabFromRGB(34f, 63f, 83f, 100f)
},
{
"Carrot Orange",
pb_ColorUtil.CIELabFromRGB(93f, 57f, 13f, 100f)
},
{
"Castleton Green",
pb_ColorUtil.CIELabFromRGB(0f, 34f, 25f, 100f)
},
{
"Catalina Blue",
pb_ColorUtil.CIELabFromRGB(2f, 16f, 47f, 100f)
},
{
"Catawba",
pb_ColorUtil.CIELabFromRGB(44f, 21f, 26f, 100f)
},
{
"Cedar Chest",
pb_ColorUtil.CIELabFromRGB(79f, 35f, 29f, 100f)
},
{
"Ceil",
pb_ColorUtil.CIELabFromRGB(57f, 63f, 81f, 100f)
},
{
"Celadon",
pb_ColorUtil.CIELabFromRGB(67f, 88f, 69f, 100f)
},
{
"Celadon Blue",
pb_ColorUtil.CIELabFromRGB(0f, 48f, 65f, 100f)
},
{
"Celadon Green",
pb_ColorUtil.CIELabFromRGB(18f, 52f, 49f, 100f)
},
{
"Celeste",
pb_ColorUtil.CIELabFromRGB(70f, 100f, 100f, 100f)
},
{
"Celestial Blue",
pb_ColorUtil.CIELabFromRGB(29f, 59f, 82f, 100f)
},
{
"Cerise",
pb_ColorUtil.CIELabFromRGB(87f, 19f, 39f, 100f)
},
{
"Cerise Pink",
pb_ColorUtil.CIELabFromRGB(93f, 23f, 51f, 100f)
},
{
"Cerulean",
pb_ColorUtil.CIELabFromRGB(0f, 48f, 65f, 100f)
},
{
"Cerulean Blue",
pb_ColorUtil.CIELabFromRGB(16f, 32f, 75f, 100f)
},
{
"Cerulean Frost",
pb_ColorUtil.CIELabFromRGB(43f, 61f, 76f, 100f)
},
{
"CG Blue",
pb_ColorUtil.CIELabFromRGB(0f, 48f, 65f, 100f)
},
{
"CG Red",
pb_ColorUtil.CIELabFromRGB(88f, 24f, 19f, 100f)
},
{
"Chamoisee",
pb_ColorUtil.CIELabFromRGB(63f, 47f, 35f, 100f)
},
{
"Champagne",
pb_ColorUtil.CIELabFromRGB(97f, 91f, 81f, 100f)
},
{
"Charcoal",
pb_ColorUtil.CIELabFromRGB(21f, 27f, 31f, 100f)
},
{
"Charleston Green",
pb_ColorUtil.CIELabFromRGB(14f, 17f, 17f, 100f)
},
{
"Charm Pink",
pb_ColorUtil.CIELabFromRGB(90f, 56f, 67f, 100f)
},
{
"Chartreuse (Traditional)",
pb_ColorUtil.CIELabFromRGB(87f, 100f, 0f, 100f)
},
{
"Chartreuse (Web)",
pb_ColorUtil.CIELabFromRGB(50f, 100f, 0f, 100f)
},
{
"Cherry",
pb_ColorUtil.CIELabFromRGB(87f, 19f, 39f, 100f)
},
{
"Cherry Blossom Pink",
pb_ColorUtil.CIELabFromRGB(100f, 72f, 77f, 100f)
},
{
"Chestnut",
pb_ColorUtil.CIELabFromRGB(58f, 27f, 21f, 100f)
},
{
"China Pink",
pb_ColorUtil.CIELabFromRGB(87f, 44f, 63f, 100f)
},
{
"China Rose",
pb_ColorUtil.CIELabFromRGB(66f, 32f, 43f, 100f)
},
{
"Chinese Red",
pb_ColorUtil.CIELabFromRGB(67f, 22f, 12f, 100f)
},
{
"Chinese Violet",
pb_ColorUtil.CIELabFromRGB(52f, 38f, 53f, 100f)
},
{
"Chocolate (Traditional)",
pb_ColorUtil.CIELabFromRGB(48f, 25f, 0f, 100f)
},
{
"Chocolate (Web)",
pb_ColorUtil.CIELabFromRGB(82f, 41f, 12f, 100f)
},
{
"Chrome Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 65f, 0f, 100f)
},
{
"Cinereous",
pb_ColorUtil.CIELabFromRGB(60f, 51f, 48f, 100f)
},
{
"Cinnabar",
pb_ColorUtil.CIELabFromRGB(89f, 26f, 20f, 100f)
},
{
"Cinnamon",
pb_ColorUtil.CIELabFromRGB(82f, 41f, 12f, 100f)
},
{
"Citrine",
pb_ColorUtil.CIELabFromRGB(89f, 82f, 4f, 100f)
},
{
"Citron",
pb_ColorUtil.CIELabFromRGB(62f, 66f, 12f, 100f)
},
{
"Claret",
pb_ColorUtil.CIELabFromRGB(50f, 9f, 20f, 100f)
},
{
"Classic Rose",
pb_ColorUtil.CIELabFromRGB(98f, 80f, 91f, 100f)
},
{
"Cobalt Blue",
pb_ColorUtil.CIELabFromRGB(0f, 28f, 67f, 100f)
},
{
"Cocoa Brown",
pb_ColorUtil.CIELabFromRGB(82f, 41f, 12f, 100f)
},
{
"Coconut",
pb_ColorUtil.CIELabFromRGB(59f, 35f, 24f, 100f)
},
{
"Coffee",
pb_ColorUtil.CIELabFromRGB(44f, 31f, 22f, 100f)
},
{
"Columbia Blue",
pb_ColorUtil.CIELabFromRGB(77f, 85f, 89f, 100f)
},
{
"Congo Pink",
pb_ColorUtil.CIELabFromRGB(97f, 51f, 47f, 100f)
},
{
"Cool Black",
pb_ColorUtil.CIELabFromRGB(0f, 18f, 39f, 100f)
},
{
"Cool Grey",
pb_ColorUtil.CIELabFromRGB(55f, 57f, 67f, 100f)
},
{
"Copper",
pb_ColorUtil.CIELabFromRGB(72f, 45f, 20f, 100f)
},
{
"Copper (Crayola)",
pb_ColorUtil.CIELabFromRGB(85f, 54f, 40f, 100f)
},
{
"Copper Penny",
pb_ColorUtil.CIELabFromRGB(68f, 44f, 41f, 100f)
},
{
"Copper Red",
pb_ColorUtil.CIELabFromRGB(80f, 43f, 32f, 100f)
},
{
"Copper Rose",
pb_ColorUtil.CIELabFromRGB(60f, 40f, 40f, 100f)
},
{
"Coquelicot",
pb_ColorUtil.CIELabFromRGB(100f, 22f, 0f, 100f)
},
{
"Coral",
pb_ColorUtil.CIELabFromRGB(100f, 50f, 31f, 100f)
},
{
"Coral Pink",
pb_ColorUtil.CIELabFromRGB(97f, 51f, 47f, 100f)
},
{
"Coral Red",
pb_ColorUtil.CIELabFromRGB(100f, 25f, 25f, 100f)
},
{
"Cordovan",
pb_ColorUtil.CIELabFromRGB(54f, 25f, 27f, 100f)
},
{
"Corn",
pb_ColorUtil.CIELabFromRGB(98f, 93f, 36f, 100f)
},
{
"Cornell Red",
pb_ColorUtil.CIELabFromRGB(70f, 11f, 11f, 100f)
},
{
"Cornflower Blue",
pb_ColorUtil.CIELabFromRGB(39f, 58f, 93f, 100f)
},
{
"Cornsilk",
pb_ColorUtil.CIELabFromRGB(100f, 97f, 86f, 100f)
},
{
"Cosmic Latte",
pb_ColorUtil.CIELabFromRGB(100f, 97f, 91f, 100f)
},
{
"Coyote Brown",
pb_ColorUtil.CIELabFromRGB(51f, 38f, 24f, 100f)
},
{
"Cotton Candy",
pb_ColorUtil.CIELabFromRGB(100f, 74f, 85f, 100f)
},
{
"Cream",
pb_ColorUtil.CIELabFromRGB(100f, 99f, 82f, 100f)
},
{
"Crimson",
pb_ColorUtil.CIELabFromRGB(86f, 8f, 24f, 100f)
},
{
"Crimson Glory",
pb_ColorUtil.CIELabFromRGB(75f, 0f, 20f, 100f)
},
{
"Crimson Red",
pb_ColorUtil.CIELabFromRGB(60f, 0f, 0f, 100f)
},
{
"Cyan",
pb_ColorUtil.CIELabFromRGB(0f, 100f, 100f, 100f)
},
{
"Cyan Azure",
pb_ColorUtil.CIELabFromRGB(31f, 51f, 71f, 100f)
},
{
"Cyan-Blue Azure",
pb_ColorUtil.CIELabFromRGB(27f, 51f, 75f, 100f)
},
{
"Cyan Cobalt Blue",
pb_ColorUtil.CIELabFromRGB(16f, 35f, 61f, 100f)
},
{
"Cyan Cornflower Blue",
pb_ColorUtil.CIELabFromRGB(9f, 55f, 76f, 100f)
},
{
"Cyan (Process)",
pb_ColorUtil.CIELabFromRGB(0f, 72f, 92f, 100f)
},
{
"Cyber Grape",
pb_ColorUtil.CIELabFromRGB(35f, 26f, 49f, 100f)
},
{
"Cyber Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 83f, 0f, 100f)
},
{
"Daffodil",
pb_ColorUtil.CIELabFromRGB(100f, 100f, 19f, 100f)
},
{
"Dandelion",
pb_ColorUtil.CIELabFromRGB(94f, 88f, 19f, 100f)
},
{
"Dark Blue",
pb_ColorUtil.CIELabFromRGB(0f, 0f, 55f, 100f)
},
{
"Dark Blue-Gray",
pb_ColorUtil.CIELabFromRGB(40f, 40f, 60f, 100f)
},
{
"Dark Brown",
pb_ColorUtil.CIELabFromRGB(40f, 26f, 13f, 100f)
},
{
"Dark Brown-Tangelo",
pb_ColorUtil.CIELabFromRGB(53f, 40f, 31f, 100f)
},
{
"Dark Byzantium",
pb_ColorUtil.CIELabFromRGB(36f, 22f, 33f, 100f)
},
{
"Dark Candy Apple Red",
pb_ColorUtil.CIELabFromRGB(64f, 0f, 0f, 100f)
},
{
"Dark Cerulean",
pb_ColorUtil.CIELabFromRGB(3f, 27f, 49f, 100f)
},
{
"Dark Chestnut",
pb_ColorUtil.CIELabFromRGB(60f, 41f, 38f, 100f)
},
{
"Dark Coral",
pb_ColorUtil.CIELabFromRGB(80f, 36f, 27f, 100f)
},
{
"Dark Cyan",
pb_ColorUtil.CIELabFromRGB(0f, 55f, 55f, 100f)
},
{
"Dark Electric Blue",
pb_ColorUtil.CIELabFromRGB(33f, 41f, 47f, 100f)
},
{
"Dark Goldenrod",
pb_ColorUtil.CIELabFromRGB(72f, 53f, 4f, 100f)
},
{
"Dark Gray (X11)",
pb_ColorUtil.CIELabFromRGB(66f, 66f, 66f, 100f)
},
{
"Dark Green",
pb_ColorUtil.CIELabFromRGB(0f, 20f, 13f, 100f)
},
{
"Dark Green (X11)",
pb_ColorUtil.CIELabFromRGB(0f, 39f, 0f, 100f)
},
{
"Dark Imperial Blue",
pb_ColorUtil.CIELabFromRGB(0f, 25f, 42f, 100f)
},
{
"Dark Imperial-er Blue",
pb_ColorUtil.CIELabFromRGB(0f, 8f, 49f, 100f)
},
{
"Dark Jungle Green",
pb_ColorUtil.CIELabFromRGB(10f, 14f, 13f, 100f)
},
{
"Dark Khaki",
pb_ColorUtil.CIELabFromRGB(74f, 72f, 42f, 100f)
},
{
"Dark Lava",
pb_ColorUtil.CIELabFromRGB(28f, 24f, 20f, 100f)
},
{
"Dark Lavender",
pb_ColorUtil.CIELabFromRGB(45f, 31f, 59f, 100f)
},
{
"Dark Liver",
pb_ColorUtil.CIELabFromRGB(33f, 29f, 31f, 100f)
},
{
"Dark Liver (Horses)",
pb_ColorUtil.CIELabFromRGB(33f, 24f, 22f, 100f)
},
{
"Dark Magenta",
pb_ColorUtil.CIELabFromRGB(55f, 0f, 55f, 100f)
},
{
"Dark Medium Gray",
pb_ColorUtil.CIELabFromRGB(66f, 66f, 66f, 100f)
},
{
"Dark Midnight Blue",
pb_ColorUtil.CIELabFromRGB(0f, 20f, 40f, 100f)
},
{
"Dark Moss Green",
pb_ColorUtil.CIELabFromRGB(29f, 36f, 14f, 100f)
},
{
"Dark Olive Green",
pb_ColorUtil.CIELabFromRGB(33f, 42f, 18f, 100f)
},
{
"Dark Orange",
pb_ColorUtil.CIELabFromRGB(100f, 55f, 0f, 100f)
},
{
"Dark Orchid",
pb_ColorUtil.CIELabFromRGB(60f, 20f, 80f, 100f)
},
{
"Dark Pastel Blue",
pb_ColorUtil.CIELabFromRGB(47f, 62f, 80f, 100f)
},
{
"Dark Pastel Green",
pb_ColorUtil.CIELabFromRGB(1f, 75f, 24f, 100f)
},
{
"Dark Pastel Purple",
pb_ColorUtil.CIELabFromRGB(59f, 44f, 84f, 100f)
},
{
"Dark Pastel Red",
pb_ColorUtil.CIELabFromRGB(76f, 23f, 13f, 100f)
},
{
"Dark Pink",
pb_ColorUtil.CIELabFromRGB(91f, 33f, 50f, 100f)
},
{
"Dark Powder Blue",
pb_ColorUtil.CIELabFromRGB(0f, 20f, 60f, 100f)
},
{
"Dark Puce",
pb_ColorUtil.CIELabFromRGB(31f, 23f, 24f, 100f)
},
{
"Dark Purple",
pb_ColorUtil.CIELabFromRGB(19f, 10f, 20f, 100f)
},
{
"Dark Raspberry",
pb_ColorUtil.CIELabFromRGB(53f, 15f, 34f, 100f)
},
{
"Dark Red",
pb_ColorUtil.CIELabFromRGB(55f, 0f, 0f, 100f)
},
{
"Dark Salmon",
pb_ColorUtil.CIELabFromRGB(91f, 59f, 48f, 100f)
},
{
"Dark Scarlet",
pb_ColorUtil.CIELabFromRGB(34f, 1f, 10f, 100f)
},
{
"Dark Sea Green",
pb_ColorUtil.CIELabFromRGB(56f, 74f, 56f, 100f)
},
{
"Dark Sienna",
pb_ColorUtil.CIELabFromRGB(24f, 8f, 8f, 100f)
},
{
"Dark Sky Blue",
pb_ColorUtil.CIELabFromRGB(55f, 75f, 84f, 100f)
},
{
"Dark Slate Blue",
pb_ColorUtil.CIELabFromRGB(28f, 24f, 55f, 100f)
},
{
"Dark Slate Gray",
pb_ColorUtil.CIELabFromRGB(18f, 31f, 31f, 100f)
},
{
"Dark Spring Green",
pb_ColorUtil.CIELabFromRGB(9f, 45f, 27f, 100f)
},
{
"Dark Tan",
pb_ColorUtil.CIELabFromRGB(57f, 51f, 32f, 100f)
},
{
"Dark Tangerine",
pb_ColorUtil.CIELabFromRGB(100f, 66f, 7f, 100f)
},
{
"Dark Taupe",
pb_ColorUtil.CIELabFromRGB(28f, 24f, 20f, 100f)
},
{
"Dark Terra Cotta",
pb_ColorUtil.CIELabFromRGB(80f, 31f, 36f, 100f)
},
{
"Dark Turquoise",
pb_ColorUtil.CIELabFromRGB(0f, 81f, 82f, 100f)
},
{
"Dark Vanilla",
pb_ColorUtil.CIELabFromRGB(82f, 75f, 66f, 100f)
},
{
"Dark Violet",
pb_ColorUtil.CIELabFromRGB(58f, 0f, 83f, 100f)
},
{
"Dark Yellow",
pb_ColorUtil.CIELabFromRGB(61f, 53f, 5f, 100f)
},
{
"Dartmouth Green",
pb_ColorUtil.CIELabFromRGB(0f, 44f, 24f, 100f)
},
{
"Davy's Grey",
pb_ColorUtil.CIELabFromRGB(33f, 33f, 33f, 100f)
},
{
"Debian Red",
pb_ColorUtil.CIELabFromRGB(84f, 4f, 33f, 100f)
},
{
"Deep Aquamarine",
pb_ColorUtil.CIELabFromRGB(25f, 51f, 43f, 100f)
},
{
"Deep Carmine",
pb_ColorUtil.CIELabFromRGB(66f, 13f, 24f, 100f)
},
{
"Deep Carmine Pink",
pb_ColorUtil.CIELabFromRGB(94f, 19f, 22f, 100f)
},
{
"Deep Carrot Orange",
pb_ColorUtil.CIELabFromRGB(91f, 41f, 17f, 100f)
},
{
"Deep Cerise",
pb_ColorUtil.CIELabFromRGB(85f, 20f, 53f, 100f)
},
{
"Deep Champagne",
pb_ColorUtil.CIELabFromRGB(98f, 84f, 65f, 100f)
},
{
"Deep Chestnut",
pb_ColorUtil.CIELabFromRGB(73f, 31f, 28f, 100f)
},
{
"Deep Coffee",
pb_ColorUtil.CIELabFromRGB(44f, 26f, 25f, 100f)
},
{
"Deep Fuchsia",
pb_ColorUtil.CIELabFromRGB(76f, 33f, 76f, 100f)
},
{
"Deep Green",
pb_ColorUtil.CIELabFromRGB(2f, 40f, 3f, 100f)
},
{
"Deep Green-Cyan Turquoise",
pb_ColorUtil.CIELabFromRGB(5f, 49f, 38f, 100f)
},
{
"Deep Jungle Green",
pb_ColorUtil.CIELabFromRGB(0f, 29f, 29f, 100f)
},
{
"Deep Koamaru",
pb_ColorUtil.CIELabFromRGB(20f, 20f, 40f, 100f)
},
{
"Deep Lemon",
pb_ColorUtil.CIELabFromRGB(96f, 78f, 10f, 100f)
},
{
"Deep Lilac",
pb_ColorUtil.CIELabFromRGB(60f, 33f, 73f, 100f)
},
{
"Deep Magenta",
pb_ColorUtil.CIELabFromRGB(80f, 0f, 80f, 100f)
},
{
"Deep Maroon",
pb_ColorUtil.CIELabFromRGB(51f, 0f, 0f, 100f)
},
{
"Deep Mauve",
pb_ColorUtil.CIELabFromRGB(83f, 45f, 83f, 100f)
},
{
"Deep Moss Green",
pb_ColorUtil.CIELabFromRGB(21f, 37f, 23f, 100f)
},
{
"Deep Peach",
pb_ColorUtil.CIELabFromRGB(100f, 80f, 64f, 100f)
},
{
"Deep Pink",
pb_ColorUtil.CIELabFromRGB(100f, 8f, 58f, 100f)
},
{
"Deep Puce",
pb_ColorUtil.CIELabFromRGB(66f, 36f, 41f, 100f)
},
{
"Deep Red",
pb_ColorUtil.CIELabFromRGB(52f, 0f, 0f, 100f)
},
{
"Deep Ruby",
pb_ColorUtil.CIELabFromRGB(52f, 25f, 36f, 100f)
},
{
"Deep Saffron",
pb_ColorUtil.CIELabFromRGB(100f, 60f, 20f, 100f)
},
{
"Deep Sky Blue",
pb_ColorUtil.CIELabFromRGB(0f, 75f, 100f, 100f)
},
{
"Deep Space Sparkle",
pb_ColorUtil.CIELabFromRGB(29f, 39f, 42f, 100f)
},
{
"Deep Spring Bud",
pb_ColorUtil.CIELabFromRGB(33f, 42f, 18f, 100f)
},
{
"Deep Taupe",
pb_ColorUtil.CIELabFromRGB(49f, 37f, 38f, 100f)
},
{
"Deep Tuscan Red",
pb_ColorUtil.CIELabFromRGB(40f, 26f, 30f, 100f)
},
{
"Deep Violet",
pb_ColorUtil.CIELabFromRGB(20f, 0f, 40f, 100f)
},
{
"Deer",
pb_ColorUtil.CIELabFromRGB(73f, 53f, 35f, 100f)
},
{
"Denim",
pb_ColorUtil.CIELabFromRGB(8f, 38f, 74f, 100f)
},
{
"Desaturated Cyan",
pb_ColorUtil.CIELabFromRGB(40f, 60f, 60f, 100f)
},
{
"Desert",
pb_ColorUtil.CIELabFromRGB(76f, 60f, 42f, 100f)
},
{
"Desert Sand",
pb_ColorUtil.CIELabFromRGB(93f, 79f, 69f, 100f)
},
{
"Desire",
pb_ColorUtil.CIELabFromRGB(92f, 24f, 33f, 100f)
},
{
"Diamond",
pb_ColorUtil.CIELabFromRGB(73f, 95f, 100f, 100f)
},
{
"Dim Gray",
pb_ColorUtil.CIELabFromRGB(41f, 41f, 41f, 100f)
},
{
"Dirt",
pb_ColorUtil.CIELabFromRGB(61f, 46f, 33f, 100f)
},
{
"Dodger Blue",
pb_ColorUtil.CIELabFromRGB(12f, 56f, 100f, 100f)
},
{
"Dogwood Rose",
pb_ColorUtil.CIELabFromRGB(84f, 9f, 41f, 100f)
},
{
"Dollar Bill",
pb_ColorUtil.CIELabFromRGB(52f, 73f, 40f, 100f)
},
{
"Donkey Brown",
pb_ColorUtil.CIELabFromRGB(40f, 30f, 16f, 100f)
},
{
"Drab",
pb_ColorUtil.CIELabFromRGB(59f, 44f, 9f, 100f)
},
{
"Duke Blue",
pb_ColorUtil.CIELabFromRGB(0f, 0f, 61f, 100f)
},
{
"Dust Storm",
pb_ColorUtil.CIELabFromRGB(90f, 80f, 79f, 100f)
},
{
"Dutch White",
pb_ColorUtil.CIELabFromRGB(94f, 87f, 73f, 100f)
},
{
"Earth Yellow",
pb_ColorUtil.CIELabFromRGB(88f, 66f, 37f, 100f)
},
{
"Ebony",
pb_ColorUtil.CIELabFromRGB(33f, 36f, 31f, 100f)
},
{
"Ecru",
pb_ColorUtil.CIELabFromRGB(76f, 70f, 50f, 100f)
},
{
"Eerie Black",
pb_ColorUtil.CIELabFromRGB(11f, 11f, 11f, 100f)
},
{
"Eggplant",
pb_ColorUtil.CIELabFromRGB(38f, 25f, 32f, 100f)
},
{
"Eggshell",
pb_ColorUtil.CIELabFromRGB(94f, 92f, 84f, 100f)
},
{
"Egyptian Blue",
pb_ColorUtil.CIELabFromRGB(6f, 20f, 65f, 100f)
},
{
"Electric Blue",
pb_ColorUtil.CIELabFromRGB(49f, 98f, 100f, 100f)
},
{
"Electric Crimson",
pb_ColorUtil.CIELabFromRGB(100f, 0f, 25f, 100f)
},
{
"Electric Cyan",
pb_ColorUtil.CIELabFromRGB(0f, 100f, 100f, 100f)
},
{
"Electric Green",
pb_ColorUtil.CIELabFromRGB(0f, 100f, 0f, 100f)
},
{
"Electric Indigo",
pb_ColorUtil.CIELabFromRGB(44f, 0f, 100f, 100f)
},
{
"Electric Lavender",
pb_ColorUtil.CIELabFromRGB(96f, 73f, 100f, 100f)
},
{
"Electric Lime",
pb_ColorUtil.CIELabFromRGB(80f, 100f, 0f, 100f)
},
{
"Electric Purple",
pb_ColorUtil.CIELabFromRGB(75f, 0f, 100f, 100f)
},
{
"Electric Ultramarine",
pb_ColorUtil.CIELabFromRGB(25f, 0f, 100f, 100f)
},
{
"Electric Violet",
pb_ColorUtil.CIELabFromRGB(56f, 0f, 100f, 100f)
},
{
"Electric Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 100f, 20f, 100f)
},
{
"Emerald",
pb_ColorUtil.CIELabFromRGB(31f, 78f, 47f, 100f)
},
{
"Eminence",
pb_ColorUtil.CIELabFromRGB(42f, 19f, 51f, 100f)
},
{
"English Green",
pb_ColorUtil.CIELabFromRGB(11f, 30f, 24f, 100f)
},
{
"English Lavender",
pb_ColorUtil.CIELabFromRGB(71f, 51f, 58f, 100f)
},
{
"English Red",
pb_ColorUtil.CIELabFromRGB(67f, 29f, 32f, 100f)
},
{
"English Violet",
pb_ColorUtil.CIELabFromRGB(34f, 24f, 36f, 100f)
},
{
"Eton Blue",
pb_ColorUtil.CIELabFromRGB(59f, 78f, 64f, 100f)
},
{
"Eucalyptus",
pb_ColorUtil.CIELabFromRGB(27f, 84f, 66f, 100f)
},
{
"Fallow",
pb_ColorUtil.CIELabFromRGB(76f, 60f, 42f, 100f)
},
{
"Falu Red",
pb_ColorUtil.CIELabFromRGB(50f, 9f, 9f, 100f)
},
{
"Fandango",
pb_ColorUtil.CIELabFromRGB(71f, 20f, 54f, 100f)
},
{
"Fandango Pink",
pb_ColorUtil.CIELabFromRGB(87f, 32f, 52f, 100f)
},
{
"Fashion Fuchsia",
pb_ColorUtil.CIELabFromRGB(96f, 0f, 63f, 100f)
},
{
"Fawn",
pb_ColorUtil.CIELabFromRGB(90f, 67f, 44f, 100f)
},
{
"Feldgrau",
pb_ColorUtil.CIELabFromRGB(30f, 36f, 33f, 100f)
},
{
"Feldspar",
pb_ColorUtil.CIELabFromRGB(99f, 84f, 69f, 100f)
},
{
"Fern Green",
pb_ColorUtil.CIELabFromRGB(31f, 47f, 26f, 100f)
},
{
"Ferrari Red",
pb_ColorUtil.CIELabFromRGB(100f, 16f, 0f, 100f)
},
{
"Field Drab",
pb_ColorUtil.CIELabFromRGB(42f, 33f, 12f, 100f)
},
{
"Firebrick",
pb_ColorUtil.CIELabFromRGB(70f, 13f, 13f, 100f)
},
{
"Fire Engine Red",
pb_ColorUtil.CIELabFromRGB(81f, 13f, 16f, 100f)
},
{
"Flame",
pb_ColorUtil.CIELabFromRGB(89f, 35f, 13f, 100f)
},
{
"Flamingo Pink",
pb_ColorUtil.CIELabFromRGB(99f, 56f, 67f, 100f)
},
{
"Flattery",
pb_ColorUtil.CIELabFromRGB(42f, 27f, 14f, 100f)
},
{
"Flavescent",
pb_ColorUtil.CIELabFromRGB(97f, 91f, 56f, 100f)
},
{
"Flax",
pb_ColorUtil.CIELabFromRGB(93f, 86f, 51f, 100f)
},
{
"Flirt",
pb_ColorUtil.CIELabFromRGB(64f, 0f, 43f, 100f)
},
{
"Floral White",
pb_ColorUtil.CIELabFromRGB(100f, 98f, 94f, 100f)
},
{
"Fluorescent Orange",
pb_ColorUtil.CIELabFromRGB(100f, 75f, 0f, 100f)
},
{
"Fluorescent Pink",
pb_ColorUtil.CIELabFromRGB(100f, 8f, 58f, 100f)
},
{
"Fluorescent Yellow",
pb_ColorUtil.CIELabFromRGB(80f, 100f, 0f, 100f)
},
{
"Folly",
pb_ColorUtil.CIELabFromRGB(100f, 0f, 31f, 100f)
},
{
"Forest Green (Traditional)",
pb_ColorUtil.CIELabFromRGB(0f, 27f, 13f, 100f)
},
{
"Forest Green (Web)",
pb_ColorUtil.CIELabFromRGB(13f, 55f, 13f, 100f)
},
{
"French Beige",
pb_ColorUtil.CIELabFromRGB(65f, 48f, 36f, 100f)
},
{
"French Bistre",
pb_ColorUtil.CIELabFromRGB(52f, 43f, 30f, 100f)
},
{
"French Blue",
pb_ColorUtil.CIELabFromRGB(0f, 45f, 73f, 100f)
},
{
"French Fuchsia",
pb_ColorUtil.CIELabFromRGB(99f, 25f, 57f, 100f)
},
{
"French Lilac",
pb_ColorUtil.CIELabFromRGB(53f, 38f, 56f, 100f)
},
{
"French Lime",
pb_ColorUtil.CIELabFromRGB(62f, 99f, 22f, 100f)
},
{
"French Mauve",
pb_ColorUtil.CIELabFromRGB(83f, 45f, 83f, 100f)
},
{
"French Pink",
pb_ColorUtil.CIELabFromRGB(99f, 42f, 62f, 100f)
},
{
"French Plum",
pb_ColorUtil.CIELabFromRGB(51f, 8f, 33f, 100f)
},
{
"French Puce",
pb_ColorUtil.CIELabFromRGB(31f, 9f, 4f, 100f)
},
{
"French Raspberry",
pb_ColorUtil.CIELabFromRGB(78f, 17f, 28f, 100f)
},
{
"French Rose",
pb_ColorUtil.CIELabFromRGB(96f, 29f, 54f, 100f)
},
{
"French Sky Blue",
pb_ColorUtil.CIELabFromRGB(47f, 71f, 100f, 100f)
},
{
"French Violet",
pb_ColorUtil.CIELabFromRGB(53f, 2f, 81f, 100f)
},
{
"French Wine",
pb_ColorUtil.CIELabFromRGB(67f, 12f, 27f, 100f)
},
{
"Fresh Air",
pb_ColorUtil.CIELabFromRGB(65f, 91f, 100f, 100f)
},
{
"Fuchsia",
pb_ColorUtil.CIELabFromRGB(100f, 0f, 100f, 100f)
},
{
"Fuchsia (Crayola)",
pb_ColorUtil.CIELabFromRGB(76f, 33f, 76f, 100f)
},
{
"Fuchsia Pink",
pb_ColorUtil.CIELabFromRGB(100f, 47f, 100f, 100f)
},
{
"Fuchsia Purple",
pb_ColorUtil.CIELabFromRGB(80f, 22f, 48f, 100f)
},
{
"Fuchsia Rose",
pb_ColorUtil.CIELabFromRGB(78f, 26f, 46f, 100f)
},
{
"Fulvous",
pb_ColorUtil.CIELabFromRGB(89f, 52f, 0f, 100f)
},
{
"Fuzzy Wuzzy",
pb_ColorUtil.CIELabFromRGB(80f, 40f, 40f, 100f)
},
{
"Gainsboro",
pb_ColorUtil.CIELabFromRGB(86f, 86f, 86f, 100f)
},
{
"Gamboge",
pb_ColorUtil.CIELabFromRGB(89f, 61f, 6f, 100f)
},
{
"Gamboge Orange (Brown)",
pb_ColorUtil.CIELabFromRGB(60f, 40f, 0f, 100f)
},
{
"Generic Viridian",
pb_ColorUtil.CIELabFromRGB(0f, 50f, 40f, 100f)
},
{
"Ghost White",
pb_ColorUtil.CIELabFromRGB(97f, 97f, 100f, 100f)
},
{
"Giants Orange",
pb_ColorUtil.CIELabFromRGB(100f, 35f, 11f, 100f)
},
{
"Grussrel",
pb_ColorUtil.CIELabFromRGB(69f, 40f, 0f, 100f)
},
{
"Glaucous",
pb_ColorUtil.CIELabFromRGB(38f, 51f, 71f, 100f)
},
{
"Glitter",
pb_ColorUtil.CIELabFromRGB(90f, 91f, 98f, 100f)
},
{
"GO Green",
pb_ColorUtil.CIELabFromRGB(0f, 67f, 40f, 100f)
},
{
"Gold (Metallic)",
pb_ColorUtil.CIELabFromRGB(83f, 69f, 22f, 100f)
},
{
"Gold (Web) (Golden)",
pb_ColorUtil.CIELabFromRGB(100f, 84f, 0f, 100f)
},
{
"Gold Fusion",
pb_ColorUtil.CIELabFromRGB(52f, 46f, 31f, 100f)
},
{
"Golden Brown",
pb_ColorUtil.CIELabFromRGB(60f, 40f, 8f, 100f)
},
{
"Golden Poppy",
pb_ColorUtil.CIELabFromRGB(99f, 76f, 0f, 100f)
},
{
"Golden Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 87f, 0f, 100f)
},
{
"Goldenrod",
pb_ColorUtil.CIELabFromRGB(85f, 65f, 13f, 100f)
},
{
"Granny Smith Apple",
pb_ColorUtil.CIELabFromRGB(66f, 89f, 63f, 100f)
},
{
"Grape",
pb_ColorUtil.CIELabFromRGB(44f, 18f, 66f, 100f)
},
{
"Gray",
pb_ColorUtil.CIELabFromRGB(50f, 50f, 50f, 100f)
},
{
"Gray (HTML/CSS Gray)",
pb_ColorUtil.CIELabFromRGB(50f, 50f, 50f, 100f)
},
{
"Gray (X11 Gray)",
pb_ColorUtil.CIELabFromRGB(75f, 75f, 75f, 100f)
},
{
"Gray-Asparagus",
pb_ColorUtil.CIELabFromRGB(27f, 35f, 27f, 100f)
},
{
"Gray-Blue",
pb_ColorUtil.CIELabFromRGB(55f, 57f, 67f, 100f)
},
{
"Green (Color Wheel) (X11 Green)",
pb_ColorUtil.CIELabFromRGB(0f, 100f, 0f, 100f)
},
{
"Green (Crayola)",
pb_ColorUtil.CIELabFromRGB(11f, 67f, 47f, 100f)
},
{
"Green (HTML/CSS Color)",
pb_ColorUtil.CIELabFromRGB(0f, 50f, 0f, 100f)
},
{
"Green (Munsell)",
pb_ColorUtil.CIELabFromRGB(0f, 66f, 47f, 100f)
},
{
"Green (NCS)",
pb_ColorUtil.CIELabFromRGB(0f, 62f, 42f, 100f)
},
{
"Green (Pantone)",
pb_ColorUtil.CIELabFromRGB(0f, 68f, 26f, 100f)
},
{
"Green (Pigment)",
pb_ColorUtil.CIELabFromRGB(0f, 65f, 31f, 100f)
},
{
"Green (RYB)",
pb_ColorUtil.CIELabFromRGB(40f, 69f, 20f, 100f)
},
{
"Green-Blue",
pb_ColorUtil.CIELabFromRGB(7f, 39f, 71f, 100f)
},
{
"Green-Cyan",
pb_ColorUtil.CIELabFromRGB(0f, 60f, 40f, 100f)
},
{
"Green-Yellow",
pb_ColorUtil.CIELabFromRGB(68f, 100f, 18f, 100f)
},
{
"Grizzly",
pb_ColorUtil.CIELabFromRGB(53f, 35f, 9f, 100f)
},
{
"Grullo",
pb_ColorUtil.CIELabFromRGB(66f, 60f, 53f, 100f)
},
{
"Guppie Green",
pb_ColorUtil.CIELabFromRGB(0f, 100f, 50f, 100f)
},
{
"Halayà Úbe",
pb_ColorUtil.CIELabFromRGB(40f, 22f, 33f, 100f)
},
{
"Han Blue",
pb_ColorUtil.CIELabFromRGB(27f, 42f, 81f, 100f)
},
{
"Han Purple",
pb_ColorUtil.CIELabFromRGB(32f, 9f, 98f, 100f)
},
{
"Hansa Yellow",
pb_ColorUtil.CIELabFromRGB(91f, 84f, 42f, 100f)
},
{
"Harlequin",
pb_ColorUtil.CIELabFromRGB(25f, 100f, 0f, 100f)
},
{
"Harlequin Green",
pb_ColorUtil.CIELabFromRGB(27f, 80f, 9f, 100f)
},
{
"Harvard Crimson",
pb_ColorUtil.CIELabFromRGB(79f, 0f, 9f, 100f)
},
{
"Harvest Gold",
pb_ColorUtil.CIELabFromRGB(85f, 57f, 0f, 100f)
},
{
"Heart Gold",
pb_ColorUtil.CIELabFromRGB(50f, 50f, 0f, 100f)
},
{
"Heliotrope",
pb_ColorUtil.CIELabFromRGB(87f, 45f, 100f, 100f)
},
{
"Heliotrope Gray",
pb_ColorUtil.CIELabFromRGB(67f, 60f, 66f, 100f)
},
{
"Heliotrope Magenta",
pb_ColorUtil.CIELabFromRGB(67f, 0f, 73f, 100f)
},
{
"Hollywood Cerise",
pb_ColorUtil.CIELabFromRGB(96f, 0f, 63f, 100f)
},
{
"Honeydew",
pb_ColorUtil.CIELabFromRGB(94f, 100f, 94f, 100f)
},
{
"Honolulu Blue",
pb_ColorUtil.CIELabFromRGB(0f, 43f, 69f, 100f)
},
{
"Hooker's Green",
pb_ColorUtil.CIELabFromRGB(29f, 47f, 42f, 100f)
},
{
"Hot Magenta",
pb_ColorUtil.CIELabFromRGB(100f, 11f, 81f, 100f)
},
{
"Hot Pink",
pb_ColorUtil.CIELabFromRGB(100f, 41f, 71f, 100f)
},
{
"Hunter Green",
pb_ColorUtil.CIELabFromRGB(21f, 37f, 23f, 100f)
},
{
"Iceberg",
pb_ColorUtil.CIELabFromRGB(44f, 65f, 82f, 100f)
},
{
"Icterine",
pb_ColorUtil.CIELabFromRGB(99f, 97f, 37f, 100f)
},
{
"Illuminating Emerald",
pb_ColorUtil.CIELabFromRGB(19f, 57f, 47f, 100f)
},
{
"Imperial",
pb_ColorUtil.CIELabFromRGB(38f, 18f, 42f, 100f)
},
{
"Imperial Blue",
pb_ColorUtil.CIELabFromRGB(0f, 14f, 58f, 100f)
},
{
"Imperial Purple",
pb_ColorUtil.CIELabFromRGB(40f, 1f, 24f, 100f)
},
{
"Imperial Red",
pb_ColorUtil.CIELabFromRGB(93f, 16f, 22f, 100f)
},
{
"Inchworm",
pb_ColorUtil.CIELabFromRGB(70f, 93f, 36f, 100f)
},
{
"Independence",
pb_ColorUtil.CIELabFromRGB(30f, 32f, 43f, 100f)
},
{
"India Green",
pb_ColorUtil.CIELabFromRGB(7f, 53f, 3f, 100f)
},
{
"Indian Red",
pb_ColorUtil.CIELabFromRGB(80f, 36f, 36f, 100f)
},
{
"Indian Yellow",
pb_ColorUtil.CIELabFromRGB(89f, 66f, 34f, 100f)
},
{
"Indigo",
pb_ColorUtil.CIELabFromRGB(44f, 0f, 100f, 100f)
},
{
"Indigo Dye",
pb_ColorUtil.CIELabFromRGB(4f, 12f, 57f, 100f)
},
{
"Indigo (Web)",
pb_ColorUtil.CIELabFromRGB(29f, 0f, 51f, 100f)
},
{
"International Klein Blue",
pb_ColorUtil.CIELabFromRGB(0f, 18f, 65f, 100f)
},
{
"International Orange (Aerospace)",
pb_ColorUtil.CIELabFromRGB(100f, 31f, 0f, 100f)
},
{
"International Orange (Engineering)",
pb_ColorUtil.CIELabFromRGB(73f, 9f, 5f, 100f)
},
{
"International Orange (Golden Gate Bridge)",
pb_ColorUtil.CIELabFromRGB(75f, 21f, 17f, 100f)
},
{
"Iris",
pb_ColorUtil.CIELabFromRGB(35f, 31f, 81f, 100f)
},
{
"Irresistible",
pb_ColorUtil.CIELabFromRGB(70f, 27f, 42f, 100f)
},
{
"Isabelline",
pb_ColorUtil.CIELabFromRGB(96f, 94f, 93f, 100f)
},
{
"Islamic Green",
pb_ColorUtil.CIELabFromRGB(0f, 56f, 0f, 100f)
},
{
"Italian Sky Blue",
pb_ColorUtil.CIELabFromRGB(70f, 100f, 100f, 100f)
},
{
"Ivory",
pb_ColorUtil.CIELabFromRGB(100f, 100f, 94f, 100f)
},
{
"Jade",
pb_ColorUtil.CIELabFromRGB(0f, 66f, 42f, 100f)
},
{
"Japanese Carmine",
pb_ColorUtil.CIELabFromRGB(62f, 16f, 20f, 100f)
},
{
"Japanese Indigo",
pb_ColorUtil.CIELabFromRGB(15f, 26f, 28f, 100f)
},
{
"Japanese Violet",
pb_ColorUtil.CIELabFromRGB(36f, 20f, 34f, 100f)
},
{
"Jasmine",
pb_ColorUtil.CIELabFromRGB(97f, 87f, 49f, 100f)
},
{
"Jasper",
pb_ColorUtil.CIELabFromRGB(84f, 23f, 24f, 100f)
},
{
"Jazzberry Jam",
pb_ColorUtil.CIELabFromRGB(65f, 4f, 37f, 100f)
},
{
"Jelly Bean",
pb_ColorUtil.CIELabFromRGB(85f, 38f, 31f, 100f)
},
{
"Jet",
pb_ColorUtil.CIELabFromRGB(20f, 20f, 20f, 100f)
},
{
"Jonquil",
pb_ColorUtil.CIELabFromRGB(96f, 79f, 9f, 100f)
},
{
"Jordy Blue",
pb_ColorUtil.CIELabFromRGB(54f, 73f, 95f, 100f)
},
{
"June Bud",
pb_ColorUtil.CIELabFromRGB(74f, 85f, 34f, 100f)
},
{
"Jungle Green",
pb_ColorUtil.CIELabFromRGB(16f, 67f, 53f, 100f)
},
{
"Kelly Green",
pb_ColorUtil.CIELabFromRGB(30f, 73f, 9f, 100f)
},
{
"Kenyan Copper",
pb_ColorUtil.CIELabFromRGB(49f, 11f, 2f, 100f)
},
{
"Keppel",
pb_ColorUtil.CIELabFromRGB(23f, 69f, 62f, 100f)
},
{
"Jawad/Chicken Color (HTML/CSS) (Khaki)",
pb_ColorUtil.CIELabFromRGB(76f, 69f, 57f, 100f)
},
{
"Khaki (X11) (Light Khaki)",
pb_ColorUtil.CIELabFromRGB(94f, 90f, 55f, 100f)
},
{
"Kobe",
pb_ColorUtil.CIELabFromRGB(53f, 18f, 9f, 100f)
},
{
"Kobi",
pb_ColorUtil.CIELabFromRGB(91f, 62f, 77f, 100f)
},
{
"Kombu Green",
pb_ColorUtil.CIELabFromRGB(21f, 26f, 19f, 100f)
},
{
"KU Crimson",
pb_ColorUtil.CIELabFromRGB(91f, 0f, 5f, 100f)
},
{
"La Salle Green",
pb_ColorUtil.CIELabFromRGB(3f, 47f, 19f, 100f)
},
{
"Languid Lavender",
pb_ColorUtil.CIELabFromRGB(84f, 79f, 87f, 100f)
},
{
"Lapis Lazuli",
pb_ColorUtil.CIELabFromRGB(15f, 38f, 61f, 100f)
},
{
"Laser Lemon",
pb_ColorUtil.CIELabFromRGB(100f, 100f, 40f, 100f)
},
{
"Laurel Green",
pb_ColorUtil.CIELabFromRGB(66f, 73f, 62f, 100f)
},
{
"Lava",
pb_ColorUtil.CIELabFromRGB(81f, 6f, 13f, 100f)
},
{
"Lavender (Floral)",
pb_ColorUtil.CIELabFromRGB(71f, 49f, 86f, 100f)
},
{
"Lavender (Web)",
pb_ColorUtil.CIELabFromRGB(90f, 90f, 98f, 100f)
},
{
"Lavender Blue",
pb_ColorUtil.CIELabFromRGB(80f, 80f, 100f, 100f)
},
{
"Lavender Blush",
pb_ColorUtil.CIELabFromRGB(100f, 94f, 96f, 100f)
},
{
"Lavender Gray",
pb_ColorUtil.CIELabFromRGB(77f, 76f, 82f, 100f)
},
{
"Lavender Indigo",
pb_ColorUtil.CIELabFromRGB(58f, 34f, 92f, 100f)
},
{
"Lavender Magenta",
pb_ColorUtil.CIELabFromRGB(93f, 51f, 93f, 100f)
},
{
"Lavender Mist",
pb_ColorUtil.CIELabFromRGB(90f, 90f, 98f, 100f)
},
{
"Lavender Pink",
pb_ColorUtil.CIELabFromRGB(98f, 68f, 82f, 100f)
},
{
"Lavender Purple",
pb_ColorUtil.CIELabFromRGB(59f, 48f, 71f, 100f)
},
{
"Lavender Rose",
pb_ColorUtil.CIELabFromRGB(98f, 63f, 89f, 100f)
},
{
"Lawn Green",
pb_ColorUtil.CIELabFromRGB(49f, 99f, 0f, 100f)
},
{
"Lemon",
pb_ColorUtil.CIELabFromRGB(100f, 97f, 0f, 100f)
},
{
"Lemon Chiffon",
pb_ColorUtil.CIELabFromRGB(100f, 98f, 80f, 100f)
},
{
"Lemon Curry",
pb_ColorUtil.CIELabFromRGB(80f, 63f, 11f, 100f)
},
{
"Lemon Glacier",
pb_ColorUtil.CIELabFromRGB(99f, 100f, 0f, 100f)
},
{
"Lemon Lime",
pb_ColorUtil.CIELabFromRGB(89f, 100f, 0f, 100f)
},
{
"Lemon Meringue",
pb_ColorUtil.CIELabFromRGB(96f, 92f, 75f, 100f)
},
{
"Lemon Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 96f, 31f, 100f)
},
{
"Lenurple",
pb_ColorUtil.CIELabFromRGB(73f, 58f, 85f, 100f)
},
{
"Licorice",
pb_ColorUtil.CIELabFromRGB(10f, 7f, 6f, 100f)
},
{
"Liberty",
pb_ColorUtil.CIELabFromRGB(33f, 35f, 65f, 100f)
},
{
"Light Apricot",
pb_ColorUtil.CIELabFromRGB(99f, 84f, 69f, 100f)
},
{
"Light Blue",
pb_ColorUtil.CIELabFromRGB(68f, 85f, 90f, 100f)
},
{
"Light Brilliant Red",
pb_ColorUtil.CIELabFromRGB(100f, 18f, 18f, 100f)
},
{
"Light Brown",
pb_ColorUtil.CIELabFromRGB(71f, 40f, 11f, 100f)
},
{
"Light Carmine Pink",
pb_ColorUtil.CIELabFromRGB(90f, 40f, 44f, 100f)
},
{
"Light Cobalt Blue",
pb_ColorUtil.CIELabFromRGB(53f, 67f, 88f, 100f)
},
{
"Light Coral",
pb_ColorUtil.CIELabFromRGB(94f, 50f, 50f, 100f)
},
{
"Light Cornflower Blue",
pb_ColorUtil.CIELabFromRGB(58f, 80f, 92f, 100f)
},
{
"Light Crimson",
pb_ColorUtil.CIELabFromRGB(96f, 41f, 57f, 100f)
},
{
"Light Cyan",
pb_ColorUtil.CIELabFromRGB(88f, 100f, 100f, 100f)
},
{
"Light Deep Pink",
pb_ColorUtil.CIELabFromRGB(100f, 36f, 80f, 100f)
},
{
"Light French Beige",
pb_ColorUtil.CIELabFromRGB(78f, 68f, 50f, 100f)
},
{
"Light Fuchsia Pink",
pb_ColorUtil.CIELabFromRGB(98f, 52f, 94f, 100f)
},
{
"Light Goldenrod Yellow",
pb_ColorUtil.CIELabFromRGB(98f, 98f, 82f, 100f)
},
{
"Light Gray",
pb_ColorUtil.CIELabFromRGB(83f, 83f, 83f, 100f)
},
{
"Light Grayish Magenta",
pb_ColorUtil.CIELabFromRGB(80f, 60f, 80f, 100f)
},
{
"Light Green",
pb_ColorUtil.CIELabFromRGB(56f, 93f, 56f, 100f)
},
{
"Light Hot Pink",
pb_ColorUtil.CIELabFromRGB(100f, 70f, 87f, 100f)
},
{
"Light Khaki",
pb_ColorUtil.CIELabFromRGB(94f, 90f, 55f, 100f)
},
{
"Light Medium Orchid",
pb_ColorUtil.CIELabFromRGB(83f, 61f, 80f, 100f)
},
{
"Light Moss Green",
pb_ColorUtil.CIELabFromRGB(68f, 87f, 68f, 100f)
},
{
"Light Orchid",
pb_ColorUtil.CIELabFromRGB(90f, 66f, 84f, 100f)
},
{
"Light Pastel Purple",
pb_ColorUtil.CIELabFromRGB(69f, 61f, 85f, 100f)
},
{
"Light Pink",
pb_ColorUtil.CIELabFromRGB(100f, 71f, 76f, 100f)
},
{
"Light Red Ochre",
pb_ColorUtil.CIELabFromRGB(91f, 45f, 32f, 100f)
},
{
"Light Salmon",
pb_ColorUtil.CIELabFromRGB(100f, 63f, 48f, 100f)
},
{
"Light Salmon Pink",
pb_ColorUtil.CIELabFromRGB(100f, 60f, 60f, 100f)
},
{
"Light Sea Green",
pb_ColorUtil.CIELabFromRGB(13f, 70f, 67f, 100f)
},
{
"Light Sky Blue",
pb_ColorUtil.CIELabFromRGB(53f, 81f, 98f, 100f)
},
{
"Light Slate Gray",
pb_ColorUtil.CIELabFromRGB(47f, 53f, 60f, 100f)
},
{
"Light Steel Blue",
pb_ColorUtil.CIELabFromRGB(69f, 77f, 87f, 100f)
},
{
"Light Taupe",
pb_ColorUtil.CIELabFromRGB(70f, 55f, 43f, 100f)
},
{
"Light Thulian Pink",
pb_ColorUtil.CIELabFromRGB(90f, 56f, 67f, 100f)
},
{
"Light Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 100f, 88f, 100f)
},
{
"Lilac",
pb_ColorUtil.CIELabFromRGB(78f, 64f, 78f, 100f)
},
{
"Lime (Color Wheel)",
pb_ColorUtil.CIELabFromRGB(75f, 100f, 0f, 100f)
},
{
"Lime (Web) (X11 Green)",
pb_ColorUtil.CIELabFromRGB(0f, 100f, 0f, 100f)
},
{
"Lime Green",
pb_ColorUtil.CIELabFromRGB(20f, 80f, 20f, 100f)
},
{
"Limerick",
pb_ColorUtil.CIELabFromRGB(62f, 76f, 4f, 100f)
},
{
"Lincoln Green",
pb_ColorUtil.CIELabFromRGB(10f, 35f, 2f, 100f)
},
{
"Linen",
pb_ColorUtil.CIELabFromRGB(98f, 94f, 90f, 100f)
},
{
"Lion",
pb_ColorUtil.CIELabFromRGB(76f, 60f, 42f, 100f)
},
{
"Liseran Purple",
pb_ColorUtil.CIELabFromRGB(87f, 44f, 63f, 100f)
},
{
"Little Boy Blue",
pb_ColorUtil.CIELabFromRGB(42f, 63f, 86f, 100f)
},
{
"Liver",
pb_ColorUtil.CIELabFromRGB(40f, 30f, 28f, 100f)
},
{
"Liver (Dogs)",
pb_ColorUtil.CIELabFromRGB(72f, 43f, 16f, 100f)
},
{
"Liver (Organ)",
pb_ColorUtil.CIELabFromRGB(42f, 18f, 12f, 100f)
},
{
"Liver Chestnut",
pb_ColorUtil.CIELabFromRGB(60f, 45f, 34f, 100f)
},
{
"Livid",
pb_ColorUtil.CIELabFromRGB(40f, 60f, 80f, 100f)
},
{
"Lumber",
pb_ColorUtil.CIELabFromRGB(100f, 89f, 80f, 100f)
},
{
"Lust",
pb_ColorUtil.CIELabFromRGB(90f, 13f, 13f, 100f)
},
{
"Magenta",
pb_ColorUtil.CIELabFromRGB(100f, 0f, 100f, 100f)
},
{
"Magenta (Crayola)",
pb_ColorUtil.CIELabFromRGB(100f, 33f, 64f, 100f)
},
{
"Magenta (Dye)",
pb_ColorUtil.CIELabFromRGB(79f, 12f, 48f, 100f)
},
{
"Magenta (Pantone)",
pb_ColorUtil.CIELabFromRGB(82f, 25f, 49f, 100f)
},
{
"Magenta (Process)",
pb_ColorUtil.CIELabFromRGB(100f, 0f, 56f, 100f)
},
{
"Magenta Haze",
pb_ColorUtil.CIELabFromRGB(62f, 27f, 46f, 100f)
},
{
"Magenta-Pink",
pb_ColorUtil.CIELabFromRGB(80f, 20f, 55f, 100f)
},
{
"Magic Mint",
pb_ColorUtil.CIELabFromRGB(67f, 94f, 82f, 100f)
},
{
"Magnolia",
pb_ColorUtil.CIELabFromRGB(97f, 96f, 100f, 100f)
},
{
"Mahogany",
pb_ColorUtil.CIELabFromRGB(75f, 25f, 0f, 100f)
},
{
"Maize",
pb_ColorUtil.CIELabFromRGB(98f, 93f, 36f, 100f)
},
{
"Majorelle Blue",
pb_ColorUtil.CIELabFromRGB(38f, 31f, 86f, 100f)
},
{
"Malachite",
pb_ColorUtil.CIELabFromRGB(4f, 85f, 32f, 100f)
},
{
"Manatee",
pb_ColorUtil.CIELabFromRGB(59f, 60f, 67f, 100f)
},
{
"Mango Tango",
pb_ColorUtil.CIELabFromRGB(100f, 51f, 26f, 100f)
},
{
"Mantis",
pb_ColorUtil.CIELabFromRGB(45f, 76f, 40f, 100f)
},
{
"Mardi Gras",
pb_ColorUtil.CIELabFromRGB(53f, 0f, 52f, 100f)
},
{
"Marigold",
pb_ColorUtil.CIELabFromRGB(92f, 64f, 13f, 100f)
},
{
"Maroon (Crayola)",
pb_ColorUtil.CIELabFromRGB(76f, 13f, 28f, 100f)
},
{
"Maroon (HTML/CSS)",
pb_ColorUtil.CIELabFromRGB(50f, 0f, 0f, 100f)
},
{
"Maroon (X11)",
pb_ColorUtil.CIELabFromRGB(69f, 19f, 38f, 100f)
},
{
"Mauve",
pb_ColorUtil.CIELabFromRGB(88f, 69f, 100f, 100f)
},
{
"Mauve Taupe",
pb_ColorUtil.CIELabFromRGB(57f, 37f, 43f, 100f)
},
{
"Mauvelous",
pb_ColorUtil.CIELabFromRGB(94f, 60f, 67f, 100f)
},
{
"May Green",
pb_ColorUtil.CIELabFromRGB(30f, 57f, 25f, 100f)
},
{
"Maya Blue",
pb_ColorUtil.CIELabFromRGB(45f, 76f, 98f, 100f)
},
{
"Meat Brown",
pb_ColorUtil.CIELabFromRGB(90f, 72f, 23f, 100f)
},
{
"Medium Aquamarine",
pb_ColorUtil.CIELabFromRGB(40f, 87f, 67f, 100f)
},
{
"Medium Blue",
pb_ColorUtil.CIELabFromRGB(0f, 0f, 80f, 100f)
},
{
"Medium Candy Apple Red",
pb_ColorUtil.CIELabFromRGB(89f, 2f, 17f, 100f)
},
{
"Medium Carmine",
pb_ColorUtil.CIELabFromRGB(69f, 25f, 21f, 100f)
},
{
"Medium Champagne",
pb_ColorUtil.CIELabFromRGB(95f, 90f, 67f, 100f)
},
{
"Medium Electric Blue",
pb_ColorUtil.CIELabFromRGB(1f, 31f, 59f, 100f)
},
{
"Medium Jungle Green",
pb_ColorUtil.CIELabFromRGB(11f, 21f, 18f, 100f)
},
{
"Medium Lavender Magenta",
pb_ColorUtil.CIELabFromRGB(87f, 63f, 87f, 100f)
},
{
"Medium Orchid",
pb_ColorUtil.CIELabFromRGB(73f, 33f, 83f, 100f)
},
{
"Medium Persian Blue",
pb_ColorUtil.CIELabFromRGB(0f, 40f, 65f, 100f)
},
{
"Medium Purple",
pb_ColorUtil.CIELabFromRGB(58f, 44f, 86f, 100f)
},
{
"Medium Red-Violet",
pb_ColorUtil.CIELabFromRGB(73f, 20f, 52f, 100f)
},
{
"Medium Ruby",
pb_ColorUtil.CIELabFromRGB(67f, 25f, 41f, 100f)
},
{
"Medium Sea Green",
pb_ColorUtil.CIELabFromRGB(24f, 70f, 44f, 100f)
},
{
"Medium Sky Blue",
pb_ColorUtil.CIELabFromRGB(50f, 85f, 92f, 100f)
},
{
"Medium Slate Blue",
pb_ColorUtil.CIELabFromRGB(48f, 41f, 93f, 100f)
},
{
"Medium Spring Bud",
pb_ColorUtil.CIELabFromRGB(79f, 86f, 53f, 100f)
},
{
"Medium Spring Green",
pb_ColorUtil.CIELabFromRGB(0f, 98f, 60f, 100f)
},
{
"Medium Taupe",
pb_ColorUtil.CIELabFromRGB(40f, 30f, 28f, 100f)
},
{
"Medium Turquoise",
pb_ColorUtil.CIELabFromRGB(28f, 82f, 80f, 100f)
},
{
"Medium Tuscan Red",
pb_ColorUtil.CIELabFromRGB(47f, 27f, 23f, 100f)
},
{
"Medium Vermilion",
pb_ColorUtil.CIELabFromRGB(85f, 38f, 23f, 100f)
},
{
"Medium Violet-Red",
pb_ColorUtil.CIELabFromRGB(78f, 8f, 52f, 100f)
},
{
"Mellow Apricot",
pb_ColorUtil.CIELabFromRGB(97f, 72f, 47f, 100f)
},
{
"Mellow Yellow",
pb_ColorUtil.CIELabFromRGB(97f, 87f, 49f, 100f)
},
{
"Melon",
pb_ColorUtil.CIELabFromRGB(99f, 74f, 71f, 100f)
},
{
"Metallic Seaweed",
pb_ColorUtil.CIELabFromRGB(4f, 49f, 55f, 100f)
},
{
"Metallic Sunburst",
pb_ColorUtil.CIELabFromRGB(61f, 49f, 22f, 100f)
},
{
"Mexican Pink",
pb_ColorUtil.CIELabFromRGB(89f, 0f, 49f, 100f)
},
{
"Midnight Blue",
pb_ColorUtil.CIELabFromRGB(10f, 10f, 44f, 100f)
},
{
"Midnight Green (Eagle Green)",
pb_ColorUtil.CIELabFromRGB(0f, 29f, 33f, 100f)
},
{
"Mikado Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 77f, 5f, 100f)
},
{
"Mindaro",
pb_ColorUtil.CIELabFromRGB(89f, 98f, 53f, 100f)
},
{
"Ming",
pb_ColorUtil.CIELabFromRGB(21f, 45f, 49f, 100f)
},
{
"Mint",
pb_ColorUtil.CIELabFromRGB(24f, 71f, 54f, 100f)
},
{
"Mint Cream",
pb_ColorUtil.CIELabFromRGB(96f, 100f, 98f, 100f)
},
{
"Mint Green",
pb_ColorUtil.CIELabFromRGB(60f, 100f, 60f, 100f)
},
{
"Misty Rose",
pb_ColorUtil.CIELabFromRGB(100f, 89f, 88f, 100f)
},
{
"Moccasin",
pb_ColorUtil.CIELabFromRGB(98f, 92f, 84f, 100f)
},
{
"Mode Beige",
pb_ColorUtil.CIELabFromRGB(59f, 44f, 9f, 100f)
},
{
"Moonstone Blue",
pb_ColorUtil.CIELabFromRGB(45f, 66f, 76f, 100f)
},
{
"Mordant Red 19",
pb_ColorUtil.CIELabFromRGB(68f, 5f, 0f, 100f)
},
{
"Moss Green",
pb_ColorUtil.CIELabFromRGB(54f, 60f, 36f, 100f)
},
{
"Mountain Meadow",
pb_ColorUtil.CIELabFromRGB(19f, 73f, 56f, 100f)
},
{
"Mountbatten Pink",
pb_ColorUtil.CIELabFromRGB(60f, 48f, 55f, 100f)
},
{
"MSU Green",
pb_ColorUtil.CIELabFromRGB(9f, 27f, 23f, 100f)
},
{
"Mughal Green",
pb_ColorUtil.CIELabFromRGB(19f, 38f, 19f, 100f)
},
{
"Mulberry",
pb_ColorUtil.CIELabFromRGB(77f, 29f, 55f, 100f)
},
{
"Mustard",
pb_ColorUtil.CIELabFromRGB(100f, 86f, 35f, 100f)
},
{
"Myrtle Green",
pb_ColorUtil.CIELabFromRGB(19f, 47f, 45f, 100f)
},
{
"Nadeshiko Pink",
pb_ColorUtil.CIELabFromRGB(96f, 68f, 78f, 100f)
},
{
"Napier Green",
pb_ColorUtil.CIELabFromRGB(16f, 50f, 0f, 100f)
},
{
"Naples Yellow",
pb_ColorUtil.CIELabFromRGB(98f, 85f, 37f, 100f)
},
{
"Navajo White",
pb_ColorUtil.CIELabFromRGB(100f, 87f, 68f, 100f)
},
{
"Navy",
pb_ColorUtil.CIELabFromRGB(0f, 0f, 50f, 100f)
},
{
"Navy Purple",
pb_ColorUtil.CIELabFromRGB(58f, 34f, 92f, 100f)
},
{
"Neon Carrot",
pb_ColorUtil.CIELabFromRGB(100f, 64f, 26f, 100f)
},
{
"Neon Fuchsia",
pb_ColorUtil.CIELabFromRGB(100f, 25f, 39f, 100f)
},
{
"Neon Green",
pb_ColorUtil.CIELabFromRGB(22f, 100f, 8f, 100f)
},
{
"New Car",
pb_ColorUtil.CIELabFromRGB(13f, 31f, 78f, 100f)
},
{
"New York Pink",
pb_ColorUtil.CIELabFromRGB(84f, 51f, 50f, 100f)
},
{
"Non-Photo Blue",
pb_ColorUtil.CIELabFromRGB(64f, 87f, 93f, 100f)
},
{
"North Texas Green",
pb_ColorUtil.CIELabFromRGB(2f, 56f, 20f, 100f)
},
{
"Nyanza",
pb_ColorUtil.CIELabFromRGB(91f, 100f, 86f, 100f)
},
{
"Ocean Boat Blue",
pb_ColorUtil.CIELabFromRGB(0f, 47f, 75f, 100f)
},
{
"Ochre",
pb_ColorUtil.CIELabFromRGB(80f, 47f, 13f, 100f)
},
{
"Office Green",
pb_ColorUtil.CIELabFromRGB(0f, 50f, 0f, 100f)
},
{
"Old Burgundy",
pb_ColorUtil.CIELabFromRGB(26f, 19f, 18f, 100f)
},
{
"Old Gold",
pb_ColorUtil.CIELabFromRGB(81f, 71f, 23f, 100f)
},
{
"Old Heliotrope",
pb_ColorUtil.CIELabFromRGB(34f, 24f, 36f, 100f)
},
{
"Old Lace",
pb_ColorUtil.CIELabFromRGB(99f, 96f, 90f, 100f)
},
{
"Old Lavender",
pb_ColorUtil.CIELabFromRGB(47f, 41f, 47f, 100f)
},
{
"Old Mauve",
pb_ColorUtil.CIELabFromRGB(40f, 19f, 28f, 100f)
},
{
"Old Moss Green",
pb_ColorUtil.CIELabFromRGB(53f, 49f, 21f, 100f)
},
{
"Old Rose",
pb_ColorUtil.CIELabFromRGB(75f, 50f, 51f, 100f)
},
{
"Old Silver",
pb_ColorUtil.CIELabFromRGB(52f, 52f, 51f, 100f)
},
{
"Olive",
pb_ColorUtil.CIELabFromRGB(50f, 50f, 0f, 100f)
},
{
"Olive Drab",
pb_ColorUtil.CIELabFromRGB(24f, 20f, 12f, 100f)
},
{
"Olivine",
pb_ColorUtil.CIELabFromRGB(60f, 73f, 45f, 100f)
},
{
"Onyx",
pb_ColorUtil.CIELabFromRGB(21f, 22f, 22f, 100f)
},
{
"Opera Mauve",
pb_ColorUtil.CIELabFromRGB(72f, 52f, 65f, 100f)
},
{
"Orange (Color Wheel)",
pb_ColorUtil.CIELabFromRGB(100f, 50f, 0f, 100f)
},
{
"Orange (Crayola)",
pb_ColorUtil.CIELabFromRGB(100f, 46f, 22f, 100f)
},
{
"Orange (Pantone)",
pb_ColorUtil.CIELabFromRGB(100f, 35f, 0f, 100f)
},
{
"Orange (RYB)",
pb_ColorUtil.CIELabFromRGB(98f, 60f, 1f, 100f)
},
{
"Orange (Web)",
pb_ColorUtil.CIELabFromRGB(100f, 65f, 0f, 100f)
},
{
"Orange Peel",
pb_ColorUtil.CIELabFromRGB(100f, 62f, 0f, 100f)
},
{
"Orange-Red",
pb_ColorUtil.CIELabFromRGB(100f, 27f, 0f, 100f)
},
{
"Orange-Yellow",
pb_ColorUtil.CIELabFromRGB(97f, 84f, 41f, 100f)
},
{
"Orchid",
pb_ColorUtil.CIELabFromRGB(85f, 44f, 84f, 100f)
},
{
"Orchid Pink",
pb_ColorUtil.CIELabFromRGB(95f, 74f, 80f, 100f)
},
{
"Orioles Orange",
pb_ColorUtil.CIELabFromRGB(98f, 31f, 8f, 100f)
},
{
"Otter Brown",
pb_ColorUtil.CIELabFromRGB(40f, 26f, 13f, 100f)
},
{
"Outer Space",
pb_ColorUtil.CIELabFromRGB(25f, 29f, 30f, 100f)
},
{
"Outrageous Orange",
pb_ColorUtil.CIELabFromRGB(100f, 43f, 29f, 100f)
},
{
"Oxford Blue",
pb_ColorUtil.CIELabFromRGB(0f, 13f, 28f, 100f)
},
{
"OU Crimson Red",
pb_ColorUtil.CIELabFromRGB(60f, 0f, 0f, 100f)
},
{
"Pakistan Green",
pb_ColorUtil.CIELabFromRGB(0f, 40f, 0f, 100f)
},
{
"Palatinate Blue",
pb_ColorUtil.CIELabFromRGB(15f, 23f, 89f, 100f)
},
{
"Palatinate Purple",
pb_ColorUtil.CIELabFromRGB(41f, 16f, 38f, 100f)
},
{
"Pale Aqua",
pb_ColorUtil.CIELabFromRGB(74f, 83f, 90f, 100f)
},
{
"Pale Blue",
pb_ColorUtil.CIELabFromRGB(69f, 93f, 93f, 100f)
},
{
"Pale Brown",
pb_ColorUtil.CIELabFromRGB(60f, 46f, 33f, 100f)
},
{
"Pale Carmine",
pb_ColorUtil.CIELabFromRGB(69f, 25f, 21f, 100f)
},
{
"Pale Cerulean",
pb_ColorUtil.CIELabFromRGB(61f, 77f, 89f, 100f)
},
{
"Pale Chestnut",
pb_ColorUtil.CIELabFromRGB(87f, 68f, 69f, 100f)
},
{
"Pale Copper",
pb_ColorUtil.CIELabFromRGB(85f, 54f, 40f, 100f)
},
{
"Pale Cornflower Blue",
pb_ColorUtil.CIELabFromRGB(67f, 80f, 94f, 100f)
},
{
"Pale Cyan",
pb_ColorUtil.CIELabFromRGB(53f, 83f, 97f, 100f)
},
{
"Pale Gold",
pb_ColorUtil.CIELabFromRGB(90f, 75f, 54f, 100f)
},
{
"Pale Goldenrod",
pb_ColorUtil.CIELabFromRGB(93f, 91f, 67f, 100f)
},
{
"Pale Green",
pb_ColorUtil.CIELabFromRGB(60f, 98f, 60f, 100f)
},
{
"Pale Lavender",
pb_ColorUtil.CIELabFromRGB(86f, 82f, 100f, 100f)
},
{
"Pale Magenta",
pb_ColorUtil.CIELabFromRGB(98f, 52f, 90f, 100f)
},
{
"Pale Magenta-Pink",
pb_ColorUtil.CIELabFromRGB(100f, 60f, 80f, 100f)
},
{
"Pale Pink",
pb_ColorUtil.CIELabFromRGB(98f, 85f, 87f, 100f)
},
{
"Pale Plum",
pb_ColorUtil.CIELabFromRGB(87f, 63f, 87f, 100f)
},
{
"Pale Red-Violet",
pb_ColorUtil.CIELabFromRGB(86f, 44f, 58f, 100f)
},
{
"Pale Robin Egg Blue",
pb_ColorUtil.CIELabFromRGB(59f, 87f, 82f, 100f)
},
{
"Pale Silver",
pb_ColorUtil.CIELabFromRGB(79f, 75f, 73f, 100f)
},
{
"Pale Spring Bud",
pb_ColorUtil.CIELabFromRGB(93f, 92f, 74f, 100f)
},
{
"Pale Taupe",
pb_ColorUtil.CIELabFromRGB(74f, 60f, 49f, 100f)
},
{
"Pale Turquoise",
pb_ColorUtil.CIELabFromRGB(69f, 93f, 93f, 100f)
},
{
"Pale Violet",
pb_ColorUtil.CIELabFromRGB(80f, 60f, 100f, 100f)
},
{
"Pale Violet-Red",
pb_ColorUtil.CIELabFromRGB(86f, 44f, 58f, 100f)
},
{
"Pansy Purple",
pb_ColorUtil.CIELabFromRGB(47f, 9f, 29f, 100f)
},
{
"Paolo Veronese Green",
pb_ColorUtil.CIELabFromRGB(0f, 61f, 49f, 100f)
},
{
"Papaya Whip",
pb_ColorUtil.CIELabFromRGB(100f, 94f, 84f, 100f)
},
{
"Paradise Pink",
pb_ColorUtil.CIELabFromRGB(90f, 24f, 38f, 100f)
},
{
"Paris Green",
pb_ColorUtil.CIELabFromRGB(31f, 78f, 47f, 100f)
},
{
"Pastel Blue",
pb_ColorUtil.CIELabFromRGB(68f, 78f, 81f, 100f)
},
{
"Pastel Brown",
pb_ColorUtil.CIELabFromRGB(51f, 41f, 33f, 100f)
},
{
"Pastel Gray",
pb_ColorUtil.CIELabFromRGB(81f, 81f, 77f, 100f)
},
{
"Pastel Green",
pb_ColorUtil.CIELabFromRGB(47f, 87f, 47f, 100f)
},
{
"Pastel Magenta",
pb_ColorUtil.CIELabFromRGB(96f, 60f, 76f, 100f)
},
{
"Pastel Orange",
pb_ColorUtil.CIELabFromRGB(100f, 70f, 28f, 100f)
},
{
"Pastel Pink",
pb_ColorUtil.CIELabFromRGB(87f, 65f, 64f, 100f)
},
{
"Pastel Purple",
pb_ColorUtil.CIELabFromRGB(70f, 62f, 71f, 100f)
},
{
"Pastel Red",
pb_ColorUtil.CIELabFromRGB(100f, 41f, 38f, 100f)
},
{
"Pastel Violet",
pb_ColorUtil.CIELabFromRGB(80f, 60f, 79f, 100f)
},
{
"Pastel Yellow",
pb_ColorUtil.CIELabFromRGB(99f, 99f, 59f, 100f)
},
{
"Patriarch",
pb_ColorUtil.CIELabFromRGB(50f, 0f, 50f, 100f)
},
{
"Payne's Grey",
pb_ColorUtil.CIELabFromRGB(33f, 41f, 47f, 100f)
},
{
"Peachier",
pb_ColorUtil.CIELabFromRGB(100f, 90f, 71f, 100f)
},
{
"Peach",
pb_ColorUtil.CIELabFromRGB(100f, 80f, 64f, 100f)
},
{
"Peach-Orange",
pb_ColorUtil.CIELabFromRGB(100f, 80f, 60f, 100f)
},
{
"Peach Puff",
pb_ColorUtil.CIELabFromRGB(100f, 85f, 73f, 100f)
},
{
"Peach-Yellow",
pb_ColorUtil.CIELabFromRGB(98f, 87f, 68f, 100f)
},
{
"Pear",
pb_ColorUtil.CIELabFromRGB(82f, 89f, 19f, 100f)
},
{
"Pearl",
pb_ColorUtil.CIELabFromRGB(92f, 88f, 78f, 100f)
},
{
"Pearl Aqua",
pb_ColorUtil.CIELabFromRGB(53f, 85f, 75f, 100f)
},
{
"Pearly Purple",
pb_ColorUtil.CIELabFromRGB(72f, 41f, 64f, 100f)
},
{
"Peridot",
pb_ColorUtil.CIELabFromRGB(90f, 89f, 0f, 100f)
},
{
"Periwinkle",
pb_ColorUtil.CIELabFromRGB(80f, 80f, 100f, 100f)
},
{
"Persian Blue",
pb_ColorUtil.CIELabFromRGB(11f, 22f, 73f, 100f)
},
{
"Persian Green",
pb_ColorUtil.CIELabFromRGB(0f, 65f, 58f, 100f)
},
{
"Persian Indigo",
pb_ColorUtil.CIELabFromRGB(20f, 7f, 48f, 100f)
},
{
"Persian Orange",
pb_ColorUtil.CIELabFromRGB(85f, 56f, 35f, 100f)
},
{
"Persian Pink",
pb_ColorUtil.CIELabFromRGB(97f, 50f, 75f, 100f)
},
{
"Persian Plum",
pb_ColorUtil.CIELabFromRGB(44f, 11f, 11f, 100f)
},
{
"Persian Red",
pb_ColorUtil.CIELabFromRGB(80f, 20f, 20f, 100f)
},
{
"Persian Rose",
pb_ColorUtil.CIELabFromRGB(100f, 16f, 64f, 100f)
},
{
"Persimmon",
pb_ColorUtil.CIELabFromRGB(93f, 35f, 0f, 100f)
},
{
"Peru",
pb_ColorUtil.CIELabFromRGB(80f, 52f, 25f, 100f)
},
{
"Phlox",
pb_ColorUtil.CIELabFromRGB(87f, 0f, 100f, 100f)
},
{
"Phthalo Blue",
pb_ColorUtil.CIELabFromRGB(0f, 6f, 54f, 100f)
},
{
"Phthalo Green",
pb_ColorUtil.CIELabFromRGB(7f, 21f, 14f, 100f)
},
{
"Picton Blue",
pb_ColorUtil.CIELabFromRGB(27f, 69f, 91f, 100f)
},
{
"Pictorial Carmine",
pb_ColorUtil.CIELabFromRGB(76f, 4f, 31f, 100f)
},
{
"Piggy Pink",
pb_ColorUtil.CIELabFromRGB(99f, 87f, 90f, 100f)
},
{
"Pine Green",
pb_ColorUtil.CIELabFromRGB(0f, 47f, 44f, 100f)
},
{
"Pineapple",
pb_ColorUtil.CIELabFromRGB(34f, 24f, 5f, 100f)
},
{
"Pink",
pb_ColorUtil.CIELabFromRGB(100f, 75f, 80f, 100f)
},
{
"Pink (Pantone)",
pb_ColorUtil.CIELabFromRGB(84f, 28f, 58f, 100f)
},
{
"Pink Lace",
pb_ColorUtil.CIELabFromRGB(100f, 87f, 96f, 100f)
},
{
"Pink Lavender",
pb_ColorUtil.CIELabFromRGB(85f, 70f, 82f, 100f)
},
{
"Pink-Orange",
pb_ColorUtil.CIELabFromRGB(100f, 60f, 40f, 100f)
},
{
"Pink Pearl",
pb_ColorUtil.CIELabFromRGB(91f, 67f, 81f, 100f)
},
{
"Pink Raspberry",
pb_ColorUtil.CIELabFromRGB(60f, 0f, 21f, 100f)
},
{
"Pink Sherbet",
pb_ColorUtil.CIELabFromRGB(97f, 56f, 65f, 100f)
},
{
"Pistachio",
pb_ColorUtil.CIELabFromRGB(58f, 77f, 45f, 100f)
},
{
"Platinum",
pb_ColorUtil.CIELabFromRGB(90f, 89f, 89f, 100f)
},
{
"Plum",
pb_ColorUtil.CIELabFromRGB(56f, 27f, 52f, 100f)
},
{
"Plum (Web)",
pb_ColorUtil.CIELabFromRGB(87f, 63f, 87f, 100f)
},
{
"Pomp And Power",
pb_ColorUtil.CIELabFromRGB(53f, 38f, 56f, 100f)
},
{
"Popstar",
pb_ColorUtil.CIELabFromRGB(75f, 31f, 38f, 100f)
},
{
"Portland Orange",
pb_ColorUtil.CIELabFromRGB(100f, 35f, 21f, 100f)
},
{
"Powder Blue",
pb_ColorUtil.CIELabFromRGB(69f, 88f, 90f, 100f)
},
{
"Princeton Orange",
pb_ColorUtil.CIELabFromRGB(96f, 50f, 15f, 100f)
},
{
"Prune",
pb_ColorUtil.CIELabFromRGB(44f, 11f, 11f, 100f)
},
{
"Prussian Blue",
pb_ColorUtil.CIELabFromRGB(0f, 19f, 33f, 100f)
},
{
"Psychedelic Purple",
pb_ColorUtil.CIELabFromRGB(87f, 0f, 100f, 100f)
},
{
"Puce",
pb_ColorUtil.CIELabFromRGB(80f, 53f, 60f, 100f)
},
{
"Puce Red",
pb_ColorUtil.CIELabFromRGB(45f, 18f, 22f, 100f)
},
{
"Pullman Brown (UPS Brown)",
pb_ColorUtil.CIELabFromRGB(39f, 25f, 9f, 100f)
},
{
"Pullman Green",
pb_ColorUtil.CIELabFromRGB(23f, 20f, 11f, 100f)
},
{
"Pumpkin",
pb_ColorUtil.CIELabFromRGB(100f, 46f, 9f, 100f)
},
{
"Purple (HTML)",
pb_ColorUtil.CIELabFromRGB(50f, 0f, 50f, 100f)
},
{
"Purple (Munsell)",
pb_ColorUtil.CIELabFromRGB(62f, 0f, 77f, 100f)
},
{
"Purple (X11)",
pb_ColorUtil.CIELabFromRGB(63f, 13f, 94f, 100f)
},
{
"Purple Heart",
pb_ColorUtil.CIELabFromRGB(41f, 21f, 61f, 100f)
},
{
"Purple Mountain Majesty",
pb_ColorUtil.CIELabFromRGB(59f, 47f, 71f, 100f)
},
{
"Purple Navy",
pb_ColorUtil.CIELabFromRGB(31f, 32f, 50f, 100f)
},
{
"Purple Pizzazz",
pb_ColorUtil.CIELabFromRGB(100f, 31f, 85f, 100f)
},
{
"Purple Taupe",
pb_ColorUtil.CIELabFromRGB(31f, 25f, 30f, 100f)
},
{
"Purpureus",
pb_ColorUtil.CIELabFromRGB(60f, 31f, 68f, 100f)
},
{
"Quartz",
pb_ColorUtil.CIELabFromRGB(32f, 28f, 31f, 100f)
},
{
"Queen Blue",
pb_ColorUtil.CIELabFromRGB(26f, 42f, 58f, 100f)
},
{
"Queen Pink",
pb_ColorUtil.CIELabFromRGB(91f, 80f, 84f, 100f)
},
{
"Quinacridone Magenta",
pb_ColorUtil.CIELabFromRGB(56f, 23f, 35f, 100f)
},
{
"Rackley",
pb_ColorUtil.CIELabFromRGB(36f, 54f, 66f, 100f)
},
{
"Radical Red",
pb_ColorUtil.CIELabFromRGB(100f, 21f, 37f, 100f)
},
{
"Rajah",
pb_ColorUtil.CIELabFromRGB(98f, 67f, 38f, 100f)
},
{
"Raspberry",
pb_ColorUtil.CIELabFromRGB(89f, 4f, 36f, 100f)
},
{
"Raspberry Glace",
pb_ColorUtil.CIELabFromRGB(57f, 37f, 43f, 100f)
},
{
"Raspberry Pink",
pb_ColorUtil.CIELabFromRGB(89f, 31f, 60f, 100f)
},
{
"Raspberry Rose",
pb_ColorUtil.CIELabFromRGB(70f, 27f, 42f, 100f)
},
{
"Raw Umber",
pb_ColorUtil.CIELabFromRGB(51f, 40f, 27f, 100f)
},
{
"Razzle Dazzle Rose",
pb_ColorUtil.CIELabFromRGB(100f, 20f, 80f, 100f)
},
{
"Razzmatazz",
pb_ColorUtil.CIELabFromRGB(89f, 15f, 42f, 100f)
},
{
"Razzmic Berry",
pb_ColorUtil.CIELabFromRGB(55f, 31f, 52f, 100f)
},
{
"Rebecca Purple",
pb_ColorUtil.CIELabFromRGB(40f, 20f, 60f, 100f)
},
{
"Red",
pb_ColorUtil.CIELabFromRGB(100f, 0f, 0f, 100f)
},
{
"Red (Crayola)",
pb_ColorUtil.CIELabFromRGB(93f, 13f, 30f, 100f)
},
{
"Red (Munsell)",
pb_ColorUtil.CIELabFromRGB(95f, 0f, 24f, 100f)
},
{
"Red (NCS)",
pb_ColorUtil.CIELabFromRGB(77f, 1f, 20f, 100f)
},
{
"Red (Pantone)",
pb_ColorUtil.CIELabFromRGB(93f, 16f, 22f, 100f)
},
{
"Red (Pigment)",
pb_ColorUtil.CIELabFromRGB(93f, 11f, 14f, 100f)
},
{
"Red (RYB)",
pb_ColorUtil.CIELabFromRGB(100f, 15f, 7f, 100f)
},
{
"Red-Brown",
pb_ColorUtil.CIELabFromRGB(65f, 16f, 16f, 100f)
},
{
"Red Devil",
pb_ColorUtil.CIELabFromRGB(53f, 0f, 7f, 100f)
},
{
"Red-Orange",
pb_ColorUtil.CIELabFromRGB(100f, 33f, 29f, 100f)
},
{
"Red-Purple",
pb_ColorUtil.CIELabFromRGB(89f, 0f, 47f, 100f)
},
{
"Red-Violet",
pb_ColorUtil.CIELabFromRGB(78f, 8f, 52f, 100f)
},
{
"Redwood",
pb_ColorUtil.CIELabFromRGB(64f, 35f, 32f, 100f)
},
{
"Regalia",
pb_ColorUtil.CIELabFromRGB(32f, 18f, 50f, 100f)
},
{
"Registration Black",
pb_ColorUtil.CIELabFromRGB(0f, 0f, 0f, 100f)
},
{
"Resolution Blue",
pb_ColorUtil.CIELabFromRGB(0f, 14f, 53f, 100f)
},
{
"Rhythm",
pb_ColorUtil.CIELabFromRGB(47f, 46f, 59f, 100f)
},
{
"Rich Black",
pb_ColorUtil.CIELabFromRGB(0f, 25f, 25f, 100f)
},
{
"Rich Black (FOGRA29)",
pb_ColorUtil.CIELabFromRGB(0f, 4f, 7f, 100f)
},
{
"Rich Black (FOGRA39)",
pb_ColorUtil.CIELabFromRGB(0f, 1f, 1f, 100f)
},
{
"Rich Brilliant Lavender",
pb_ColorUtil.CIELabFromRGB(95f, 65f, 100f, 100f)
},
{
"Rich Carmine",
pb_ColorUtil.CIELabFromRGB(84f, 0f, 25f, 100f)
},
{
"Rich Electric Blue",
pb_ColorUtil.CIELabFromRGB(3f, 57f, 82f, 100f)
},
{
"Rich Lavender",
pb_ColorUtil.CIELabFromRGB(65f, 42f, 81f, 100f)
},
{
"Rich Lilac",
pb_ColorUtil.CIELabFromRGB(71f, 40f, 82f, 100f)
},
{
"Rich Maroon",
pb_ColorUtil.CIELabFromRGB(69f, 19f, 38f, 100f)
},
{
"Rifle Green",
pb_ColorUtil.CIELabFromRGB(27f, 30f, 22f, 100f)
},
{
"Roast Coffee",
pb_ColorUtil.CIELabFromRGB(44f, 26f, 25f, 100f)
},
{
"Robin Egg Blue",
pb_ColorUtil.CIELabFromRGB(0f, 80f, 80f, 100f)
},
{
"Rocket Metallic",
pb_ColorUtil.CIELabFromRGB(54f, 50f, 50f, 100f)
},
{
"Roman Silver",
pb_ColorUtil.CIELabFromRGB(51f, 54f, 59f, 100f)
},
{
"Rose",
pb_ColorUtil.CIELabFromRGB(100f, 0f, 50f, 100f)
},
{
"Rose Bonbon",
pb_ColorUtil.CIELabFromRGB(98f, 26f, 62f, 100f)
},
{
"Rose Ebony",
pb_ColorUtil.CIELabFromRGB(40f, 28f, 27f, 100f)
},
{
"Rose Gold",
pb_ColorUtil.CIELabFromRGB(72f, 43f, 47f, 100f)
},
{
"Rose Madder",
pb_ColorUtil.CIELabFromRGB(89f, 15f, 21f, 100f)
},
{
"Rose Pink",
pb_ColorUtil.CIELabFromRGB(100f, 40f, 80f, 100f)
},
{
"Rose Quartz",
pb_ColorUtil.CIELabFromRGB(67f, 60f, 66f, 100f)
},
{
"Rose Red",
pb_ColorUtil.CIELabFromRGB(76f, 12f, 34f, 100f)
},
{
"Rose Taupe",
pb_ColorUtil.CIELabFromRGB(56f, 36f, 36f, 100f)
},
{
"Rose Vale",
pb_ColorUtil.CIELabFromRGB(67f, 31f, 32f, 100f)
},
{
"Rosewood",
pb_ColorUtil.CIELabFromRGB(40f, 0f, 4f, 100f)
},
{
"Rosso Corsa",
pb_ColorUtil.CIELabFromRGB(83f, 0f, 0f, 100f)
},
{
"Rosy Brown",
pb_ColorUtil.CIELabFromRGB(74f, 56f, 56f, 100f)
},
{
"Royal Azure",
pb_ColorUtil.CIELabFromRGB(0f, 22f, 66f, 100f)
},
{
"Royal Blue",
pb_ColorUtil.CIELabFromRGB(0f, 14f, 40f, 100f)
},
{
"Royal Blue 2",
pb_ColorUtil.CIELabFromRGB(25f, 41f, 88f, 100f)
},
{
"Royal Fuchsia",
pb_ColorUtil.CIELabFromRGB(79f, 17f, 57f, 100f)
},
{
"Royal Purple",
pb_ColorUtil.CIELabFromRGB(47f, 32f, 66f, 100f)
},
{
"Royal Yellow",
pb_ColorUtil.CIELabFromRGB(98f, 85f, 37f, 100f)
},
{
"Ruber",
pb_ColorUtil.CIELabFromRGB(81f, 27f, 46f, 100f)
},
{
"Rubine Red",
pb_ColorUtil.CIELabFromRGB(82f, 0f, 34f, 100f)
},
{
"Ruby",
pb_ColorUtil.CIELabFromRGB(88f, 7f, 37f, 100f)
},
{
"Ruby Red",
pb_ColorUtil.CIELabFromRGB(61f, 7f, 12f, 100f)
},
{
"Ruddy",
pb_ColorUtil.CIELabFromRGB(100f, 0f, 16f, 100f)
},
{
"Ruddy Brown",
pb_ColorUtil.CIELabFromRGB(73f, 40f, 16f, 100f)
},
{
"Ruddy Pink",
pb_ColorUtil.CIELabFromRGB(88f, 56f, 59f, 100f)
},
{
"Rufous",
pb_ColorUtil.CIELabFromRGB(66f, 11f, 3f, 100f)
},
{
"Russet",
pb_ColorUtil.CIELabFromRGB(50f, 27f, 11f, 100f)
},
{
"Russian Green",
pb_ColorUtil.CIELabFromRGB(40f, 57f, 40f, 100f)
},
{
"Russian Violet",
pb_ColorUtil.CIELabFromRGB(20f, 9f, 30f, 100f)
},
{
"Rust",
pb_ColorUtil.CIELabFromRGB(72f, 25f, 5f, 100f)
},
{
"Rusty Red",
pb_ColorUtil.CIELabFromRGB(85f, 17f, 26f, 100f)
},
{
"Sacramento State Green",
pb_ColorUtil.CIELabFromRGB(0f, 34f, 25f, 100f)
},
{
"Saddle Brown",
pb_ColorUtil.CIELabFromRGB(55f, 27f, 7f, 100f)
},
{
"Safety Orange",
pb_ColorUtil.CIELabFromRGB(100f, 47f, 0f, 100f)
},
{
"Safety Orange (Blaze Orange)",
pb_ColorUtil.CIELabFromRGB(100f, 40f, 0f, 100f)
},
{
"Safety Yellow",
pb_ColorUtil.CIELabFromRGB(93f, 82f, 1f, 100f)
},
{
"Saffron",
pb_ColorUtil.CIELabFromRGB(96f, 77f, 19f, 100f)
},
{
"Sage",
pb_ColorUtil.CIELabFromRGB(74f, 72f, 54f, 100f)
},
{
"St. Patrick's Blue",
pb_ColorUtil.CIELabFromRGB(14f, 16f, 48f, 100f)
},
{
"Salmon",
pb_ColorUtil.CIELabFromRGB(98f, 50f, 45f, 100f)
},
{
"Salmon Pink",
pb_ColorUtil.CIELabFromRGB(100f, 57f, 64f, 100f)
},
{
"Sand",
pb_ColorUtil.CIELabFromRGB(76f, 70f, 50f, 100f)
},
{
"Sand Dune",
pb_ColorUtil.CIELabFromRGB(59f, 44f, 9f, 100f)
},
{
"Sandstorm",
pb_ColorUtil.CIELabFromRGB(93f, 84f, 25f, 100f)
},
{
"Sandy Brown",
pb_ColorUtil.CIELabFromRGB(96f, 64f, 38f, 100f)
},
{
"Sandy Taupe",
pb_ColorUtil.CIELabFromRGB(59f, 44f, 9f, 100f)
},
{
"Sangria",
pb_ColorUtil.CIELabFromRGB(57f, 0f, 4f, 100f)
},
{
"Sap Green",
pb_ColorUtil.CIELabFromRGB(31f, 49f, 16f, 100f)
},
{
"Sapphire",
pb_ColorUtil.CIELabFromRGB(6f, 32f, 73f, 100f)
},
{
"Sapphire Blue",
pb_ColorUtil.CIELabFromRGB(0f, 40f, 65f, 100f)
},
{
"Satin Sheen Gold",
pb_ColorUtil.CIELabFromRGB(80f, 63f, 21f, 100f)
},
{
"Scarlet",
pb_ColorUtil.CIELabFromRGB(100f, 14f, 0f, 100f)
},
{
"Scarlet-ier",
pb_ColorUtil.CIELabFromRGB(99f, 5f, 21f, 100f)
},
{
"Schauss Pink",
pb_ColorUtil.CIELabFromRGB(100f, 57f, 69f, 100f)
},
{
"School Bus Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 85f, 0f, 100f)
},
{
"Screamin' Green",
pb_ColorUtil.CIELabFromRGB(46f, 100f, 48f, 100f)
},
{
"Sea Blue",
pb_ColorUtil.CIELabFromRGB(0f, 41f, 58f, 100f)
},
{
"Sea Green",
pb_ColorUtil.CIELabFromRGB(18f, 55f, 34f, 100f)
},
{
"Seal Brown",
pb_ColorUtil.CIELabFromRGB(20f, 8f, 8f, 100f)
},
{
"Seashell",
pb_ColorUtil.CIELabFromRGB(100f, 96f, 93f, 100f)
},
{
"Selective Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 73f, 0f, 100f)
},
{
"Sepia",
pb_ColorUtil.CIELabFromRGB(44f, 26f, 8f, 100f)
},
{
"Shadow",
pb_ColorUtil.CIELabFromRGB(54f, 47f, 36f, 100f)
},
{
"Shadow Blue",
pb_ColorUtil.CIELabFromRGB(47f, 55f, 65f, 100f)
},
{
"Shampoo",
pb_ColorUtil.CIELabFromRGB(100f, 81f, 95f, 100f)
},
{
"Shamrock Green",
pb_ColorUtil.CIELabFromRGB(0f, 62f, 38f, 100f)
},
{
"Sheen Green",
pb_ColorUtil.CIELabFromRGB(56f, 83f, 0f, 100f)
},
{
"Shimmering Blush",
pb_ColorUtil.CIELabFromRGB(85f, 53f, 58f, 100f)
},
{
"Shocking Pink",
pb_ColorUtil.CIELabFromRGB(99f, 6f, 75f, 100f)
},
{
"Shocking Pink (Crayola)",
pb_ColorUtil.CIELabFromRGB(100f, 44f, 100f, 100f)
},
{
"Sienna",
pb_ColorUtil.CIELabFromRGB(53f, 18f, 9f, 100f)
},
{
"Silver",
pb_ColorUtil.CIELabFromRGB(75f, 75f, 75f, 100f)
},
{
"Silver Chalice",
pb_ColorUtil.CIELabFromRGB(67f, 67f, 67f, 100f)
},
{
"Silver Lake Blue",
pb_ColorUtil.CIELabFromRGB(36f, 54f, 73f, 100f)
},
{
"Silver Pink",
pb_ColorUtil.CIELabFromRGB(77f, 68f, 68f, 100f)
},
{
"Silver Sand",
pb_ColorUtil.CIELabFromRGB(75f, 76f, 76f, 100f)
},
{
"Sinopia",
pb_ColorUtil.CIELabFromRGB(80f, 25f, 4f, 100f)
},
{
"Skobeloff",
pb_ColorUtil.CIELabFromRGB(0f, 45f, 45f, 100f)
},
{
"Sky Blue",
pb_ColorUtil.CIELabFromRGB(53f, 81f, 92f, 100f)
},
{
"Sky Magenta",
pb_ColorUtil.CIELabFromRGB(81f, 44f, 69f, 100f)
},
{
"Slate Blue",
pb_ColorUtil.CIELabFromRGB(42f, 35f, 80f, 100f)
},
{
"Slate Gray",
pb_ColorUtil.CIELabFromRGB(44f, 50f, 56f, 100f)
},
{
"Smalt (Dark Powder Blue)",
pb_ColorUtil.CIELabFromRGB(0f, 20f, 60f, 100f)
},
{
"Smitten",
pb_ColorUtil.CIELabFromRGB(78f, 25f, 53f, 100f)
},
{
"Smoke",
pb_ColorUtil.CIELabFromRGB(45f, 51f, 46f, 100f)
},
{
"Smoky Black",
pb_ColorUtil.CIELabFromRGB(6f, 5f, 3f, 100f)
},
{
"Smoky Topaz",
pb_ColorUtil.CIELabFromRGB(58f, 24f, 25f, 100f)
},
{
"Snow",
pb_ColorUtil.CIELabFromRGB(100f, 98f, 98f, 100f)
},
{
"Soap",
pb_ColorUtil.CIELabFromRGB(81f, 78f, 94f, 100f)
},
{
"Solid Pink",
pb_ColorUtil.CIELabFromRGB(54f, 22f, 26f, 100f)
},
{
"Sonic Silver",
pb_ColorUtil.CIELabFromRGB(46f, 46f, 46f, 100f)
},
{
"Spartan Crimson",
pb_ColorUtil.CIELabFromRGB(62f, 7f, 9f, 100f)
},
{
"Space Cadet",
pb_ColorUtil.CIELabFromRGB(11f, 16f, 32f, 100f)
},
{
"Spanish Bistre",
pb_ColorUtil.CIELabFromRGB(50f, 46f, 20f, 100f)
},
{
"Spanish Blue",
pb_ColorUtil.CIELabFromRGB(0f, 44f, 72f, 100f)
},
{
"Spanish Carmine",
pb_ColorUtil.CIELabFromRGB(82f, 0f, 28f, 100f)
},
{
"Spanish Crimson",
pb_ColorUtil.CIELabFromRGB(90f, 10f, 30f, 100f)
},
{
"Spanish Gray",
pb_ColorUtil.CIELabFromRGB(60f, 60f, 60f, 100f)
},
{
"Spanish Green",
pb_ColorUtil.CIELabFromRGB(0f, 57f, 31f, 100f)
},
{
"Spanish Orange",
pb_ColorUtil.CIELabFromRGB(91f, 38f, 0f, 100f)
},
{
"Spanish Pink",
pb_ColorUtil.CIELabFromRGB(97f, 75f, 75f, 100f)
},
{
"Spanish Red",
pb_ColorUtil.CIELabFromRGB(90f, 0f, 15f, 100f)
},
{
"Spanish Sky Blue",
pb_ColorUtil.CIELabFromRGB(0f, 100f, 100f, 100f)
},
{
"Spanish Violet",
pb_ColorUtil.CIELabFromRGB(30f, 16f, 51f, 100f)
},
{
"Spanish Viridian",
pb_ColorUtil.CIELabFromRGB(0f, 50f, 36f, 100f)
},
{
"Spicy Mix",
pb_ColorUtil.CIELabFromRGB(55f, 37f, 30f, 100f)
},
{
"Spiro Disco Ball",
pb_ColorUtil.CIELabFromRGB(6f, 75f, 99f, 100f)
},
{
"Spring Bud",
pb_ColorUtil.CIELabFromRGB(65f, 99f, 0f, 100f)
},
{
"Spring Green",
pb_ColorUtil.CIELabFromRGB(0f, 100f, 50f, 100f)
},
{
"Star Command Blue",
pb_ColorUtil.CIELabFromRGB(0f, 48f, 72f, 100f)
},
{
"Steel Blue",
pb_ColorUtil.CIELabFromRGB(27f, 51f, 71f, 100f)
},
{
"Steel Pink",
pb_ColorUtil.CIELabFromRGB(80f, 20f, 80f, 100f)
},
{
"Stil De Grain Yellow",
pb_ColorUtil.CIELabFromRGB(98f, 85f, 37f, 100f)
},
{
"Stizza",
pb_ColorUtil.CIELabFromRGB(60f, 0f, 0f, 100f)
},
{
"Stormcloud",
pb_ColorUtil.CIELabFromRGB(31f, 40f, 42f, 100f)
},
{
"Thistle",
pb_ColorUtil.CIELabFromRGB(85f, 75f, 85f, 100f)
},
{
"Straw",
pb_ColorUtil.CIELabFromRGB(89f, 85f, 44f, 100f)
},
{
"Strawberry",
pb_ColorUtil.CIELabFromRGB(99f, 35f, 55f, 100f)
},
{
"Sunglow",
pb_ColorUtil.CIELabFromRGB(100f, 80f, 20f, 100f)
},
{
"Sunray",
pb_ColorUtil.CIELabFromRGB(89f, 67f, 34f, 100f)
},
{
"Sunset",
pb_ColorUtil.CIELabFromRGB(98f, 84f, 65f, 100f)
},
{
"Sunset Orange",
pb_ColorUtil.CIELabFromRGB(99f, 37f, 33f, 100f)
},
{
"Super Pink",
pb_ColorUtil.CIELabFromRGB(81f, 42f, 66f, 100f)
},
{
"Tan",
pb_ColorUtil.CIELabFromRGB(82f, 71f, 55f, 100f)
},
{
"Tangelo",
pb_ColorUtil.CIELabFromRGB(98f, 30f, 0f, 100f)
},
{
"Tangerine",
pb_ColorUtil.CIELabFromRGB(95f, 52f, 0f, 100f)
},
{
"Tangerine Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 80f, 0f, 100f)
},
{
"Tango Pink",
pb_ColorUtil.CIELabFromRGB(89f, 44f, 48f, 100f)
},
{
"Taupe",
pb_ColorUtil.CIELabFromRGB(28f, 24f, 20f, 100f)
},
{
"Taupe Gray",
pb_ColorUtil.CIELabFromRGB(55f, 52f, 54f, 100f)
},
{
"Tea Green",
pb_ColorUtil.CIELabFromRGB(82f, 94f, 75f, 100f)
},
{
"Tea Rose",
pb_ColorUtil.CIELabFromRGB(97f, 51f, 47f, 100f)
},
{
"Tea Rosier",
pb_ColorUtil.CIELabFromRGB(96f, 76f, 76f, 100f)
},
{
"Teal",
pb_ColorUtil.CIELabFromRGB(0f, 50f, 50f, 100f)
},
{
"Teal Blue",
pb_ColorUtil.CIELabFromRGB(21f, 46f, 53f, 100f)
},
{
"Teal Deer",
pb_ColorUtil.CIELabFromRGB(60f, 90f, 70f, 100f)
},
{
"Teal Green",
pb_ColorUtil.CIELabFromRGB(0f, 51f, 50f, 100f)
},
{
"Telemagenta",
pb_ColorUtil.CIELabFromRGB(81f, 20f, 46f, 100f)
},
{
"Tenné",
pb_ColorUtil.CIELabFromRGB(80f, 34f, 0f, 100f)
},
{
"Terra Cotta",
pb_ColorUtil.CIELabFromRGB(89f, 45f, 36f, 100f)
},
{
"Thulian Pink",
pb_ColorUtil.CIELabFromRGB(87f, 44f, 63f, 100f)
},
{
"Tickle Me Pink",
pb_ColorUtil.CIELabFromRGB(99f, 54f, 67f, 100f)
},
{
"Tiffany Blue",
pb_ColorUtil.CIELabFromRGB(4f, 73f, 71f, 100f)
},
{
"Tiger's Eye",
pb_ColorUtil.CIELabFromRGB(88f, 55f, 24f, 100f)
},
{
"Timberwolf",
pb_ColorUtil.CIELabFromRGB(86f, 84f, 82f, 100f)
},
{
"Titanium Yellow",
pb_ColorUtil.CIELabFromRGB(93f, 90f, 0f, 100f)
},
{
"Tomato",
pb_ColorUtil.CIELabFromRGB(100f, 39f, 28f, 100f)
},
{
"Toolbox",
pb_ColorUtil.CIELabFromRGB(45f, 42f, 75f, 100f)
},
{
"Topaz",
pb_ColorUtil.CIELabFromRGB(100f, 78f, 49f, 100f)
},
{
"Tractor Red",
pb_ColorUtil.CIELabFromRGB(99f, 5f, 21f, 100f)
},
{
"Trolley Grey",
pb_ColorUtil.CIELabFromRGB(50f, 50f, 50f, 100f)
},
{
"Tropical Rain Forest",
pb_ColorUtil.CIELabFromRGB(0f, 46f, 37f, 100f)
},
{
"True Blue",
pb_ColorUtil.CIELabFromRGB(0f, 45f, 81f, 100f)
},
{
"Tufts Blue",
pb_ColorUtil.CIELabFromRGB(25f, 49f, 76f, 100f)
},
{
"Tulip",
pb_ColorUtil.CIELabFromRGB(100f, 53f, 55f, 100f)
},
{
"Tumbleweed",
pb_ColorUtil.CIELabFromRGB(87f, 67f, 53f, 100f)
},
{
"Turkish Rose",
pb_ColorUtil.CIELabFromRGB(71f, 45f, 51f, 100f)
},
{
"Turquoise",
pb_ColorUtil.CIELabFromRGB(25f, 88f, 82f, 100f)
},
{
"Turquoise Blue",
pb_ColorUtil.CIELabFromRGB(0f, 100f, 94f, 100f)
},
{
"Turquoise Green",
pb_ColorUtil.CIELabFromRGB(63f, 84f, 71f, 100f)
},
{
"Tuscan",
pb_ColorUtil.CIELabFromRGB(98f, 84f, 65f, 100f)
},
{
"Tuscan Brown",
pb_ColorUtil.CIELabFromRGB(44f, 31f, 22f, 100f)
},
{
"Tuscan Red",
pb_ColorUtil.CIELabFromRGB(49f, 28f, 28f, 100f)
},
{
"Tuscan Tan",
pb_ColorUtil.CIELabFromRGB(65f, 48f, 36f, 100f)
},
{
"Tuscany",
pb_ColorUtil.CIELabFromRGB(75f, 60f, 60f, 100f)
},
{
"Twilight Lavender",
pb_ColorUtil.CIELabFromRGB(54f, 29f, 42f, 100f)
},
{
"Tyrian Purple",
pb_ColorUtil.CIELabFromRGB(40f, 1f, 24f, 100f)
},
{
"UA Blue",
pb_ColorUtil.CIELabFromRGB(0f, 20f, 67f, 100f)
},
{
"UA Red",
pb_ColorUtil.CIELabFromRGB(85f, 0f, 30f, 100f)
},
{
"Ube",
pb_ColorUtil.CIELabFromRGB(53f, 47f, 76f, 100f)
},
{
"UCLA Blue",
pb_ColorUtil.CIELabFromRGB(33f, 41f, 58f, 100f)
},
{
"UCLA Gold",
pb_ColorUtil.CIELabFromRGB(100f, 70f, 0f, 100f)
},
{
"UFO Green",
pb_ColorUtil.CIELabFromRGB(24f, 82f, 44f, 100f)
},
{
"Ultramarine",
pb_ColorUtil.CIELabFromRGB(7f, 4f, 56f, 100f)
},
{
"Ultramarine Blue",
pb_ColorUtil.CIELabFromRGB(25f, 40f, 96f, 100f)
},
{
"Ultra Pink",
pb_ColorUtil.CIELabFromRGB(100f, 44f, 100f, 100f)
},
{
"Ultra Red",
pb_ColorUtil.CIELabFromRGB(99f, 42f, 52f, 100f)
},
{
"Umber",
pb_ColorUtil.CIELabFromRGB(39f, 32f, 28f, 100f)
},
{
"Unbleached Silk",
pb_ColorUtil.CIELabFromRGB(100f, 87f, 79f, 100f)
},
{
"United Nations Blue",
pb_ColorUtil.CIELabFromRGB(36f, 57f, 90f, 100f)
},
{
"University Of California Gold",
pb_ColorUtil.CIELabFromRGB(72f, 53f, 15f, 100f)
},
{
"Unmellow Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 100f, 40f, 100f)
},
{
"UP Forest Green",
pb_ColorUtil.CIELabFromRGB(0f, 27f, 13f, 100f)
},
{
"UP Maroon",
pb_ColorUtil.CIELabFromRGB(48f, 7f, 7f, 100f)
},
{
"Upsdell Red",
pb_ColorUtil.CIELabFromRGB(68f, 13f, 16f, 100f)
},
{
"Urobilin",
pb_ColorUtil.CIELabFromRGB(88f, 68f, 13f, 100f)
},
{
"USAFA Blue",
pb_ColorUtil.CIELabFromRGB(0f, 31f, 60f, 100f)
},
{
"USC Cardinal",
pb_ColorUtil.CIELabFromRGB(60f, 0f, 0f, 100f)
},
{
"USC Gold",
pb_ColorUtil.CIELabFromRGB(100f, 80f, 0f, 100f)
},
{
"University Of Tennessee Orange",
pb_ColorUtil.CIELabFromRGB(97f, 50f, 0f, 100f)
},
{
"Utah Crimson",
pb_ColorUtil.CIELabFromRGB(83f, 0f, 25f, 100f)
},
{
"Vanilla",
pb_ColorUtil.CIELabFromRGB(95f, 90f, 67f, 100f)
},
{
"Vanilla Ice",
pb_ColorUtil.CIELabFromRGB(95f, 56f, 66f, 100f)
},
{
"Vegas Gold",
pb_ColorUtil.CIELabFromRGB(77f, 70f, 35f, 100f)
},
{
"Venetian Red",
pb_ColorUtil.CIELabFromRGB(78f, 3f, 8f, 100f)
},
{
"Verdigris",
pb_ColorUtil.CIELabFromRGB(26f, 70f, 68f, 100f)
},
{
"Vermilion",
pb_ColorUtil.CIELabFromRGB(89f, 26f, 20f, 100f)
},
{
"Vermilion 2",
pb_ColorUtil.CIELabFromRGB(85f, 22f, 12f, 100f)
},
{
"Veronica",
pb_ColorUtil.CIELabFromRGB(63f, 13f, 94f, 100f)
},
{
"Very Light Azure",
pb_ColorUtil.CIELabFromRGB(45f, 73f, 98f, 100f)
},
{
"Very Light Blue",
pb_ColorUtil.CIELabFromRGB(40f, 40f, 100f, 100f)
},
{
"Very Light Malachite Green",
pb_ColorUtil.CIELabFromRGB(39f, 91f, 53f, 100f)
},
{
"Very Light Tangelo",
pb_ColorUtil.CIELabFromRGB(100f, 69f, 47f, 100f)
},
{
"Very Pale Orange",
pb_ColorUtil.CIELabFromRGB(100f, 87f, 75f, 100f)
},
{
"Very Pale Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 100f, 75f, 100f)
},
{
"Violet",
pb_ColorUtil.CIELabFromRGB(56f, 0f, 100f, 100f)
},
{
"Violet (Color Wheel)",
pb_ColorUtil.CIELabFromRGB(50f, 0f, 100f, 100f)
},
{
"Violet (RYB)",
pb_ColorUtil.CIELabFromRGB(53f, 0f, 69f, 100f)
},
{
"Violet (Web)",
pb_ColorUtil.CIELabFromRGB(93f, 51f, 93f, 100f)
},
{
"Violet-Blue",
pb_ColorUtil.CIELabFromRGB(20f, 29f, 70f, 100f)
},
{
"Violet-Red",
pb_ColorUtil.CIELabFromRGB(97f, 33f, 58f, 100f)
},
{
"Viridian",
pb_ColorUtil.CIELabFromRGB(25f, 51f, 43f, 100f)
},
{
"Viridian Green",
pb_ColorUtil.CIELabFromRGB(0f, 59f, 60f, 100f)
},
{
"Vista Blue",
pb_ColorUtil.CIELabFromRGB(49f, 62f, 85f, 100f)
},
{
"Vivid Amber",
pb_ColorUtil.CIELabFromRGB(80f, 60f, 0f, 100f)
},
{
"Vivid Auburn",
pb_ColorUtil.CIELabFromRGB(57f, 15f, 14f, 100f)
},
{
"Vivid Burgundy",
pb_ColorUtil.CIELabFromRGB(62f, 11f, 21f, 100f)
},
{
"Vivid Cerise",
pb_ColorUtil.CIELabFromRGB(85f, 11f, 51f, 100f)
},
{
"Vivid Cerulean",
pb_ColorUtil.CIELabFromRGB(0f, 67f, 93f, 100f)
},
{
"Vivid Crimson",
pb_ColorUtil.CIELabFromRGB(80f, 0f, 20f, 100f)
},
{
"Vivid Gamboge",
pb_ColorUtil.CIELabFromRGB(100f, 60f, 0f, 100f)
},
{
"Vivid Lime Green",
pb_ColorUtil.CIELabFromRGB(65f, 84f, 3f, 100f)
},
{
"Vivid Malachite",
pb_ColorUtil.CIELabFromRGB(0f, 80f, 20f, 100f)
},
{
"Vivid Mulberry",
pb_ColorUtil.CIELabFromRGB(72f, 5f, 89f, 100f)
},
{
"Vivid Orange",
pb_ColorUtil.CIELabFromRGB(100f, 37f, 0f, 100f)
},
{
"Vivid Orange Peel",
pb_ColorUtil.CIELabFromRGB(100f, 63f, 0f, 100f)
},
{
"Vivid Orchid",
pb_ColorUtil.CIELabFromRGB(80f, 0f, 100f, 100f)
},
{
"Vivid Raspberry",
pb_ColorUtil.CIELabFromRGB(100f, 0f, 42f, 100f)
},
{
"Vivid Red",
pb_ColorUtil.CIELabFromRGB(97f, 5f, 10f, 100f)
},
{
"Vivid Red-Tangelo",
pb_ColorUtil.CIELabFromRGB(87f, 38f, 14f, 100f)
},
{
"Vivid Sky Blue",
pb_ColorUtil.CIELabFromRGB(0f, 80f, 100f, 100f)
},
{
"Vivid Tangelo",
pb_ColorUtil.CIELabFromRGB(94f, 45f, 15f, 100f)
},
{
"Vivid Tangerine",
pb_ColorUtil.CIELabFromRGB(100f, 63f, 54f, 100f)
},
{
"Vivid Vermilion",
pb_ColorUtil.CIELabFromRGB(90f, 38f, 14f, 100f)
},
{
"Vivid Violet",
pb_ColorUtil.CIELabFromRGB(62f, 0f, 100f, 100f)
},
{
"Vivid Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 89f, 1f, 100f)
},
{
"Warm Black",
pb_ColorUtil.CIELabFromRGB(0f, 26f, 26f, 100f)
},
{
"Waterspout",
pb_ColorUtil.CIELabFromRGB(64f, 96f, 98f, 100f)
},
{
"Wenge",
pb_ColorUtil.CIELabFromRGB(39f, 33f, 32f, 100f)
},
{
"Wheat",
pb_ColorUtil.CIELabFromRGB(96f, 87f, 70f, 100f)
},
{
"White",
pb_ColorUtil.CIELabFromRGB(100f, 100f, 100f, 100f)
},
{
"White Smoke",
pb_ColorUtil.CIELabFromRGB(96f, 96f, 96f, 100f)
},
{
"Wild Blue Yonder",
pb_ColorUtil.CIELabFromRGB(64f, 68f, 82f, 100f)
},
{
"Wild Orchid",
pb_ColorUtil.CIELabFromRGB(83f, 44f, 64f, 100f)
},
{
"Wild Strawberry",
pb_ColorUtil.CIELabFromRGB(100f, 26f, 64f, 100f)
},
{
"Wild Watermelon",
pb_ColorUtil.CIELabFromRGB(99f, 42f, 52f, 100f)
},
{
"Willpower Orange",
pb_ColorUtil.CIELabFromRGB(99f, 35f, 0f, 100f)
},
{
"Windsor Tan",
pb_ColorUtil.CIELabFromRGB(65f, 33f, 1f, 100f)
},
{
"Wine",
pb_ColorUtil.CIELabFromRGB(45f, 18f, 22f, 100f)
},
{
"Wine Dregs",
pb_ColorUtil.CIELabFromRGB(40f, 19f, 28f, 100f)
},
{
"Wisteria",
pb_ColorUtil.CIELabFromRGB(79f, 63f, 86f, 100f)
},
{
"Wood Brown",
pb_ColorUtil.CIELabFromRGB(76f, 60f, 42f, 100f)
},
{
"Xanadu",
pb_ColorUtil.CIELabFromRGB(45f, 53f, 47f, 100f)
},
{
"Yale Blue",
pb_ColorUtil.CIELabFromRGB(6f, 30f, 57f, 100f)
},
{
"Yankees Blue",
pb_ColorUtil.CIELabFromRGB(11f, 16f, 25f, 100f)
},
{
"Yellow",
pb_ColorUtil.CIELabFromRGB(100f, 100f, 0f, 100f)
},
{
"Yellow (Crayola)",
pb_ColorUtil.CIELabFromRGB(99f, 91f, 51f, 100f)
},
{
"Yellow (Munsell)",
pb_ColorUtil.CIELabFromRGB(94f, 80f, 0f, 100f)
},
{
"Yellow (NCS)",
pb_ColorUtil.CIELabFromRGB(100f, 83f, 0f, 100f)
},
{
"Yellow (Pantone)",
pb_ColorUtil.CIELabFromRGB(100f, 87f, 0f, 100f)
},
{
"Yellow (Process)",
pb_ColorUtil.CIELabFromRGB(100f, 94f, 0f, 100f)
},
{
"Yellow (RYB)",
pb_ColorUtil.CIELabFromRGB(100f, 100f, 20f, 100f)
},
{
"Yellow-Green",
pb_ColorUtil.CIELabFromRGB(60f, 80f, 20f, 100f)
},
{
"Yellow Orange",
pb_ColorUtil.CIELabFromRGB(100f, 68f, 26f, 100f)
},
{
"Yellow Rose",
pb_ColorUtil.CIELabFromRGB(100f, 94f, 0f, 100f)
},
{
"Zaffre",
pb_ColorUtil.CIELabFromRGB(0f, 8f, 66f, 100f)
},
{
"Zinnwaldite Brown",
pb_ColorUtil.CIELabFromRGB(17f, 9f, 3f, 100f)
},
{
"Zomp",
pb_ColorUtil.CIELabFromRGB(22f, 65f, 56f, 100f)
}
};
}
}
+472
View File
@@ -0,0 +1,472 @@
using System;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x0200000C RID: 12
public static class pb_Constant
{
// Token: 0x17000005 RID: 5
// (get) Token: 0x06000053 RID: 83 RVA: 0x0000DA28 File Offset: 0x0000BE28
public static Material DefaultMaterial
{
get
{
if (pb_Constant._defaultMaterial == null)
{
pb_Constant._defaultMaterial = (Material)Resources.Load("Materials/Default_Prototype", typeof(Material));
if (pb_Constant._defaultMaterial == null)
{
pb_Constant._defaultMaterial = pb_Constant.UnityDefaultDiffuse;
}
}
return pb_Constant._defaultMaterial;
}
}
// Token: 0x17000006 RID: 6
// (get) Token: 0x06000054 RID: 84 RVA: 0x0000DA84 File Offset: 0x0000BE84
public static Material FacePickerMaterial
{
get
{
if (pb_Constant._facePickerMaterial == null)
{
pb_Constant._facePickerMaterial = Resources.Load<Material>("Materials/FacePicker");
if (pb_Constant._facePickerMaterial == null)
{
pb_Constant._facePickerMaterial = new Material(Shader.Find("Hidden/ProBuilder/FacePicker"));
}
else
{
pb_Constant._facePickerMaterial.shader = Shader.Find("Hidden/ProBuilder/FacePicker");
}
}
return pb_Constant._facePickerMaterial;
}
}
// Token: 0x17000007 RID: 7
// (get) Token: 0x06000055 RID: 85 RVA: 0x0000DAF4 File Offset: 0x0000BEF4
public static Material VertexPickerMaterial
{
get
{
if (pb_Constant._vertexPickerMaterial == null)
{
pb_Constant._vertexPickerMaterial = Resources.Load<Material>("Materials/VertexPicker");
if (pb_Constant._vertexPickerMaterial == null)
{
pb_Constant._vertexPickerMaterial = new Material(Shader.Find("Hidden/ProBuilder/VertexPicker"));
}
else
{
pb_Constant._vertexPickerMaterial.shader = Shader.Find("Hidden/ProBuilder/VertexPicker");
}
}
return pb_Constant._vertexPickerMaterial;
}
}
// Token: 0x17000008 RID: 8
// (get) Token: 0x06000056 RID: 86 RVA: 0x0000DB62 File Offset: 0x0000BF62
public static Shader SelectionPickerShader
{
get
{
if (pb_Constant._selectionPickerShader == null)
{
pb_Constant._selectionPickerShader = Shader.Find("Hidden/ProBuilder/SelectionPicker");
}
return pb_Constant._selectionPickerShader;
}
}
// Token: 0x17000009 RID: 9
// (get) Token: 0x06000057 RID: 87 RVA: 0x0000DB88 File Offset: 0x0000BF88
public static Material TriggerMaterial
{
get
{
return (Material)Resources.Load("Materials/Trigger", typeof(Material));
}
}
// Token: 0x1700000A RID: 10
// (get) Token: 0x06000058 RID: 88 RVA: 0x0000DBA3 File Offset: 0x0000BFA3
public static Material ColliderMaterial
{
get
{
return (Material)Resources.Load("Materials/Collider", typeof(Material));
}
}
// Token: 0x1700000B RID: 11
// (get) Token: 0x06000059 RID: 89 RVA: 0x0000DBBE File Offset: 0x0000BFBE
public static Material NoDrawMaterial
{
get
{
return (Material)Resources.Load("Materials/NoDraw", typeof(Material));
}
}
// Token: 0x1700000C RID: 12
// (get) Token: 0x0600005A RID: 90 RVA: 0x0000DBDC File Offset: 0x0000BFDC
public static Material UnityDefaultDiffuse
{
get
{
if (pb_Constant._UnityDefaultDiffuse == null)
{
GameObject gameObject = GameObject.CreatePrimitive(PrimitiveType.Cube);
pb_Constant._UnityDefaultDiffuse = gameObject.GetComponent<MeshRenderer>().sharedMaterial;
global::UnityEngine.Object.DestroyImmediate(gameObject);
}
return pb_Constant._UnityDefaultDiffuse;
}
}
// Token: 0x1700000D RID: 13
// (get) Token: 0x0600005B RID: 91 RVA: 0x0000DC1B File Offset: 0x0000C01B
public static Material UnlitVertexColor
{
get
{
if (pb_Constant._UnlitVertexColorMaterial == null)
{
pb_Constant._UnlitVertexColorMaterial = (Material)Resources.Load("Materials/UnlitVertexColor", typeof(Material));
}
return pb_Constant._UnlitVertexColorMaterial;
}
}
// Token: 0x0400001D RID: 29
public const string PRODUCT_NAME = "ProBuilder";
// Token: 0x0400001E RID: 30
public static readonly HideFlags EDITOR_OBJECT_HIDE_FLAGS = HideFlags.HideInHierarchy | HideFlags.HideInInspector | HideFlags.DontSaveInEditor | HideFlags.NotEditable;
// Token: 0x0400001F RID: 31
public const float MAX_POINT_DISTANCE_FROM_CONTROL = 20f;
// Token: 0x04000020 RID: 32
private static Material _defaultMaterial = null;
// Token: 0x04000021 RID: 33
private static Material _facePickerMaterial;
// Token: 0x04000022 RID: 34
private static Material _vertexPickerMaterial;
// Token: 0x04000023 RID: 35
private static Shader _selectionPickerShader = null;
// Token: 0x04000024 RID: 36
private static Material _UnityDefaultDiffuse = null;
// Token: 0x04000025 RID: 37
private static Material _UnlitVertexColorMaterial;
// Token: 0x04000026 RID: 38
public const char DEGREE_SYMBOL = '°';
// Token: 0x04000027 RID: 39
public const char CMD_SUPER = '⌘';
// Token: 0x04000028 RID: 40
public const char CMD_SHIFT = '⇧';
// Token: 0x04000029 RID: 41
public const char CMD_OPTION = '⌥';
// Token: 0x0400002A RID: 42
public const char CMD_ALT = '⎇';
// Token: 0x0400002B RID: 43
public const char CMD_DELETE = '⌫';
// Token: 0x0400002C RID: 44
public const string pbDefaultEditLevel = "pbDefaultEditLevel";
// Token: 0x0400002D RID: 45
public const string pbDefaultSelectionMode = "pbDefaultSelectionMode";
// Token: 0x0400002E RID: 46
public const string pbHandleAlignment = "pbHandleAlignment";
// Token: 0x0400002F RID: 47
public const string pbVertexColorTool = "pbVertexColorTool";
// Token: 0x04000030 RID: 48
public const string pbToolbarLocation = "pbToolbarLocation";
// Token: 0x04000031 RID: 49
public const string pbDefaultEntity = "pbDefaultEntity";
// Token: 0x04000032 RID: 50
public const string pbExtrudeMethod = "pbExtrudeMethod";
// Token: 0x04000033 RID: 51
public const string pbDefaultFaceColor = "pbDefaultFaceColor";
// Token: 0x04000034 RID: 52
public const string pbDefaultEdgeColor = "pbDefaultEdgeColor";
// Token: 0x04000035 RID: 53
public const string pbDefaultSelectedVertexColor = "pbDefaultSelectedVertexColor";
// Token: 0x04000036 RID: 54
public const string pbDefaultVertexColor = "pbDefaultVertexColor";
// Token: 0x04000037 RID: 55
public const string pbDefaultOpenInDockableWindow = "pbDefaultOpenInDockableWindow";
// Token: 0x04000038 RID: 56
public const string pbEditorPrefVersion = "pbEditorPrefVersion";
// Token: 0x04000039 RID: 57
public const string pbEditorShortcutsVersion = "pbEditorShortcutsVersion";
// Token: 0x0400003A RID: 58
public const string pbDefaultCollider = "pbDefaultCollider";
// Token: 0x0400003B RID: 59
public const string pbForceConvex = "pbForceConvex";
// Token: 0x0400003C RID: 60
public const string pbVertexColorPrefs = "pbVertexColorPrefs";
// Token: 0x0400003D RID: 61
public const string pbShowEditorNotifications = "pbShowEditorNotifications";
// Token: 0x0400003E RID: 62
public const string pbDragCheckLimit = "pbDragCheckLimit";
// Token: 0x0400003F RID: 63
public const string pbForceVertexPivot = "pbForceVertexPivot";
// Token: 0x04000040 RID: 64
public const string pbForceGridPivot = "pbForceGridPivot";
// Token: 0x04000041 RID: 65
public const string pbManifoldEdgeExtrusion = "pbManifoldEdgeExtrusion";
// Token: 0x04000042 RID: 66
public const string pbPerimeterEdgeBridgeOnly = "pbPerimeterEdgeBridgeOnly";
// Token: 0x04000043 RID: 67
public const string pbPBOSelectionOnly = "pbPBOSelectionOnly";
// Token: 0x04000044 RID: 68
public const string pbCloseShapeWindow = "pbCloseShapeWindow";
// Token: 0x04000045 RID: 69
public const string pbUVEditorFloating = "pbUVEditorFloating";
// Token: 0x04000046 RID: 70
public const string pbUVMaterialPreview = "pbUVMaterialPreview";
// Token: 0x04000047 RID: 71
public const string pbShowSceneToolbar = "pbShowSceneToolbar";
// Token: 0x04000048 RID: 72
public const string pbNormalizeUVsOnPlanarProjection = "pbNormalizeUVsOnPlanarProjection";
// Token: 0x04000049 RID: 73
public const string pbStripProBuilderOnBuild = "pbStripProBuilderOnBuild";
// Token: 0x0400004A RID: 74
public const string pbDisableAutoUV2Generation = "pbDisableAutoUV2Generation";
// Token: 0x0400004B RID: 75
public const string pbShowSceneInfo = "pbShowSceneInfo";
// Token: 0x0400004C RID: 76
public const string pbEnableBackfaceSelection = "pbEnableBackfaceSelection";
// Token: 0x0400004D RID: 77
public const string pbVertexPaletteDockable = "pbVertexPaletteDockable";
// Token: 0x0400004E RID: 78
public const string pbExtrudeAsGroup = "pbExtrudeAsGroup";
// Token: 0x0400004F RID: 79
public const string pbUniqueModeShortcuts = "pbUniqueModeShortcuts";
// Token: 0x04000050 RID: 80
public const string pbMaterialEditorFloating = "pbMaterialEditorFloating";
// Token: 0x04000051 RID: 81
public const string pbShapeWindowFloating = "pbShapeWindowFloating";
// Token: 0x04000052 RID: 82
public const string pbIconGUI = "pbIconGUI";
// Token: 0x04000053 RID: 83
public const string pbShiftOnlyTooltips = "pbShiftOnlyTooltips";
// Token: 0x04000054 RID: 84
public const string pbDrawAxisLines = "pbDrawAxisLines";
// Token: 0x04000055 RID: 85
public const string pbCollapseVertexToFirst = "pbCollapseVertexToFirst";
// Token: 0x04000056 RID: 86
public const string pbMeshesAreAssets = "pbMeshesAreAssets";
// Token: 0x04000057 RID: 87
public const string pbElementSelectIsHamFisted = "pbElementSelectIsHamFisted";
// Token: 0x04000058 RID: 88
public const string pbFillHoleSelectsEntirePath = "pbFillHoleSelectsEntirePath";
// Token: 0x04000059 RID: 89
public const string pbDetachToNewObject = "pbDetachToNewObject";
// Token: 0x0400005A RID: 90
public const string pbPreserveFaces = "pbPreserveFaces";
// Token: 0x0400005B RID: 91
public const string pbDragSelectWholeElement = "pbDragSelectWholeElement";
// Token: 0x0400005C RID: 92
public const string pbDragSelectMode = "pbDragSelectMode";
// Token: 0x0400005D RID: 93
public const string pbShadowCastingMode = "pbShadowCastingMode";
// Token: 0x0400005E RID: 94
public const string pbEnableExperimental = "pbEnableExperimental";
// Token: 0x0400005F RID: 95
public const string pbCheckForProBuilderUpdates = "pbCheckForProBuilderUpdates";
// Token: 0x04000060 RID: 96
public const string pbManageLightmappingStaticFlag = "pbManageLightmappingStaticFlag";
// Token: 0x04000061 RID: 97
public const string pbVertexHandleSize = "pbVertexHandleSize";
// Token: 0x04000062 RID: 98
public const string pbUVGridSnapValue = "pbUVGridSnapValue";
// Token: 0x04000063 RID: 99
public const string pbUVWeldDistance = "pbUVWeldDistance";
// Token: 0x04000064 RID: 100
public const string pbWeldDistance = "pbWeldDistance";
// Token: 0x04000065 RID: 101
public const string pbExtrudeDistance = "pbExtrudeDistance";
// Token: 0x04000066 RID: 102
public const string pbBevelAmount = "pbBevelAmount";
// Token: 0x04000067 RID: 103
public const string pbEdgeSubdivisions = "pbEdgeSubdivisions";
// Token: 0x04000068 RID: 104
public const string pbDefaultShortcuts = "pbDefaultShortcuts";
// Token: 0x04000069 RID: 105
public const string pbDefaultMaterial = "pbDefaultMaterial";
// Token: 0x0400006A RID: 106
public const string pbCurrentMaterialPalette = "pbCurrentMaterialPalette";
// Token: 0x0400006B RID: 107
public const string pbGrowSelectionUsingAngle = "pbGrowSelectionUsingAngle";
// Token: 0x0400006C RID: 108
public const string pbGrowSelectionAngle = "pbGrowSelectionAngle";
// Token: 0x0400006D RID: 109
public const string pbGrowSelectionAngleIterative = "pbGrowSelectionAngleIterative";
// Token: 0x0400006E RID: 110
public const string pbShowDetail = "pbShowDetail";
// Token: 0x0400006F RID: 111
public const string pbShowOccluder = "pbShowOccluder";
// Token: 0x04000070 RID: 112
public const string pbShowMover = "pbShowMover";
// Token: 0x04000071 RID: 113
public const string pbShowCollider = "pbShowCollider";
// Token: 0x04000072 RID: 114
public const string pbShowTrigger = "pbShowTrigger";
// Token: 0x04000073 RID: 115
public const string pbShowNoDraw = "pbShowNoDraw";
// Token: 0x04000074 RID: 116
public static readonly Rect RectZero = new Rect(0f, 0f, 0f, 0f);
// Token: 0x04000075 RID: 117
public static Color ProBuilderBlue = new Color(0f, 0.682f, 0.937f, 1f);
// Token: 0x04000076 RID: 118
public static Color ProBuilderLightGray = new Color(0.35f, 0.35f, 0.35f, 0.4f);
// Token: 0x04000077 RID: 119
public static Color ProBuilderDarkGray = new Color(0.1f, 0.1f, 0.1f, 0.3f);
// Token: 0x04000078 RID: 120
public const int MENU_ABOUT = 0;
// Token: 0x04000079 RID: 121
public const int MENU_EDITOR = 100;
// Token: 0x0400007A RID: 122
public const int MENU_SELECTION = 200;
// Token: 0x0400007B RID: 123
public const int MENU_GEOMETRY = 200;
// Token: 0x0400007C RID: 124
public const int MENU_ACTIONS = 300;
// Token: 0x0400007D RID: 125
public const int MENU_MATERIAL_COLORS = 400;
// Token: 0x0400007E RID: 126
public const int MENU_VERTEX_COLORS = 400;
// Token: 0x0400007F RID: 127
public const int MENU_REPAIR = 600;
// Token: 0x04000080 RID: 128
public const int MENU_MISC = 600;
// Token: 0x04000081 RID: 129
public const int MENU_EXPORT = 800;
// Token: 0x04000082 RID: 130
public static Vector3[] VERTICES_CUBE = new Vector3[]
{
new Vector3(-0.5f, -0.5f, 0.5f),
new Vector3(0.5f, -0.5f, 0.5f),
new Vector3(0.5f, -0.5f, -0.5f),
new Vector3(-0.5f, -0.5f, -0.5f),
new Vector3(-0.5f, 0.5f, 0.5f),
new Vector3(0.5f, 0.5f, 0.5f),
new Vector3(0.5f, 0.5f, -0.5f),
new Vector3(-0.5f, 0.5f, -0.5f)
};
// Token: 0x04000083 RID: 131
public static int[] TRIANGLES_CUBE = new int[]
{
0, 1, 4, 5, 1, 2, 5, 6, 2, 3,
6, 7, 3, 0, 7, 4, 4, 5, 7, 6,
3, 2, 0, 1
};
// Token: 0x04000084 RID: 132
public const int MAX_VERTEX_COUNT = 65000;
}
}
+8
View File
@@ -0,0 +1,8 @@
using System;
using UnityEngine;
// Token: 0x0200000D RID: 13
[AddComponentMenu("")]
public class pb_DummyScript : MonoBehaviour
{
}
+271
View File
@@ -0,0 +1,271 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x0200000E RID: 14
[Serializable]
public class pb_Edge : IEquatable<pb_Edge>
{
// Token: 0x0600005E RID: 94 RVA: 0x0000DE18 File Offset: 0x0000C218
public pb_Edge()
{
}
// Token: 0x0600005F RID: 95 RVA: 0x0000DE20 File Offset: 0x0000C220
public pb_Edge(int _x, int _y)
{
this.x = _x;
this.y = _y;
}
// Token: 0x06000060 RID: 96 RVA: 0x0000DE36 File Offset: 0x0000C236
public pb_Edge(pb_Edge edge)
{
this.x = edge.x;
this.y = edge.y;
}
// Token: 0x06000061 RID: 97 RVA: 0x0000DE56 File Offset: 0x0000C256
public bool IsValid()
{
return this.x > -1 && this.y > -1 && this.x != this.y;
}
// Token: 0x06000062 RID: 98 RVA: 0x0000DE84 File Offset: 0x0000C284
public override string ToString()
{
return string.Concat(new object[] { "[", this.x, ", ", this.y, "]" });
}
// Token: 0x06000063 RID: 99 RVA: 0x0000DED0 File Offset: 0x0000C2D0
public bool Equals(pb_Edge edge)
{
return edge != null && ((this.x == edge.x && this.y == edge.y) || (this.x == edge.y && this.y == edge.x));
}
// Token: 0x06000064 RID: 100 RVA: 0x0000DF2D File Offset: 0x0000C32D
public override bool Equals(object b)
{
return this.Equals(b as pb_Edge);
}
// Token: 0x06000065 RID: 101 RVA: 0x0000DF3C File Offset: 0x0000C33C
public override int GetHashCode()
{
int num = 27;
num = num * 29 + ((this.x >= this.y) ? this.y : this.x);
return num * 29 + ((this.x >= this.y) ? this.x : this.y);
}
// Token: 0x06000066 RID: 102 RVA: 0x0000DF9D File Offset: 0x0000C39D
public static pb_Edge operator +(pb_Edge a, pb_Edge b)
{
return new pb_Edge(a.x + b.x, a.y + b.y);
}
// Token: 0x06000067 RID: 103 RVA: 0x0000DFBE File Offset: 0x0000C3BE
public static pb_Edge operator -(pb_Edge a, pb_Edge b)
{
return new pb_Edge(a.x - b.x, a.y - b.y);
}
// Token: 0x06000068 RID: 104 RVA: 0x0000DFDF File Offset: 0x0000C3DF
public static pb_Edge operator +(pb_Edge a, int b)
{
return new pb_Edge(a.x + b, a.y + b);
}
// Token: 0x06000069 RID: 105 RVA: 0x0000DFF6 File Offset: 0x0000C3F6
public static pb_Edge operator -(pb_Edge a, int b)
{
return new pb_Edge(a.x - b, a.y - b);
}
// Token: 0x0600006A RID: 106 RVA: 0x0000E00D File Offset: 0x0000C40D
public int[] ToArray()
{
return new int[] { this.x, this.y };
}
// Token: 0x0600006B RID: 107 RVA: 0x0000E028 File Offset: 0x0000C428
public bool Equals(pb_Edge b, Dictionary<int, int> lookup)
{
int num = lookup[this.x];
int num2 = lookup[this.y];
int num3 = lookup[b.x];
int num4 = lookup[b.y];
return (num == num3 && num2 == num4) || (num == num4 && num2 == num3);
}
// Token: 0x0600006C RID: 108 RVA: 0x0000E088 File Offset: 0x0000C488
public bool Contains(int a)
{
return this.x == a || this.y == a;
}
// Token: 0x0600006D RID: 109 RVA: 0x0000E0A4 File Offset: 0x0000C4A4
public bool Contains(pb_Edge b)
{
return this.x == b.x || this.y == b.x || this.x == b.y || this.y == b.x;
}
// Token: 0x0600006E RID: 110 RVA: 0x0000E0F8 File Offset: 0x0000C4F8
public bool Contains(int a, pb_IntArray[] sharedIndices)
{
int num = sharedIndices.IndexOf(a);
return Array.IndexOf<int>(sharedIndices[num], this.x) > -1 || Array.IndexOf<int>(sharedIndices[num], this.y) > -1;
}
// Token: 0x0600006F RID: 111 RVA: 0x0000E140 File Offset: 0x0000C540
public static pb_Edge[] GetUniversalEdges(pb_Edge[] edges, Dictionary<int, int> sharedIndicesLookup)
{
pb_Edge[] array = new pb_Edge[edges.Length];
for (int i = 0; i < edges.Length; i++)
{
array[i] = new pb_Edge(sharedIndicesLookup[edges[i].x], sharedIndicesLookup[edges[i].y]);
}
return array;
}
// Token: 0x06000070 RID: 112 RVA: 0x0000E18F File Offset: 0x0000C58F
public static pb_Edge[] GetUniversalEdges(pb_Edge[] edges, pb_IntArray[] sharedIndices)
{
return pb_Edge.GetUniversalEdges(edges, sharedIndices.ToDictionary());
}
// Token: 0x06000071 RID: 113 RVA: 0x0000E19D File Offset: 0x0000C59D
public static pb_Edge GetLocalEdgeFast(pb_Edge edge, pb_IntArray[] sharedIndices)
{
return new pb_Edge(sharedIndices[edge.x][0], sharedIndices[edge.y][0]);
}
// Token: 0x06000072 RID: 114 RVA: 0x0000E1C0 File Offset: 0x0000C5C0
public static bool ValidateEdge(pb_Object pb, pb_Edge edge, out pb_Tuple<pb_Face, pb_Edge> validEdge)
{
pb_Face[] faces = pb.faces;
pb_IntArray[] sharedIndices = pb.sharedIndices;
pb_Edge pb_Edge = new pb_Edge(sharedIndices.IndexOf(edge.x), sharedIndices.IndexOf(edge.y));
int num = -1;
int num2 = -1;
int num3 = -1;
int num4 = -1;
for (int i = 0; i < faces.Length; i++)
{
if (faces[i].distinctIndices.ContainsMatch(sharedIndices[pb_Edge.x].array, out num, out num3) && faces[i].distinctIndices.ContainsMatch(sharedIndices[pb_Edge.y].array, out num2, out num4))
{
int num5 = faces[i].distinctIndices[num];
int num6 = faces[i].distinctIndices[num2];
validEdge = new pb_Tuple<pb_Face, pb_Edge>(faces[i], new pb_Edge(num5, num6));
return true;
}
}
validEdge = null;
return false;
}
// Token: 0x06000073 RID: 115 RVA: 0x0000E29C File Offset: 0x0000C69C
public static List<pb_Edge> ValidateEdges(pb_Object pb, pb_Edge[] edges)
{
pb_Face[] faces = pb.faces;
Dictionary<int, int> dictionary = pb.sharedIndices.ToDictionary();
HashSet<pb_EdgeLookup> hashSet = new HashSet<pb_EdgeLookup>(pb_EdgeLookup.GetEdgeLookup(edges, dictionary));
List<pb_Edge> list = new List<pb_Edge>();
bool flag = false;
int num = 0;
while (num < faces.Length && !flag)
{
pb_Edge[] edges2 = faces[num].edges;
int num2 = 0;
while (num2 < edges2.Length && !flag)
{
pb_EdgeLookup pb_EdgeLookup = new pb_EdgeLookup(dictionary[edges2[num2].x], dictionary[edges2[num2].y], edges2[num2].x, edges2[num2].y);
if (hashSet.Contains(pb_EdgeLookup))
{
hashSet.Remove(pb_EdgeLookup);
flag = hashSet.Count < 1;
list.Add(pb_EdgeLookup.local);
}
num2++;
}
num++;
}
return list;
}
// Token: 0x06000074 RID: 116 RVA: 0x0000E388 File Offset: 0x0000C788
public static pb_Edge[] GetLocalEdges_Fast(pb_Edge[] edges, pb_IntArray[] sharedIndices)
{
pb_Edge[] array = new pb_Edge[edges.Length];
for (int i = 0; i < array.Length; i++)
{
array[i] = new pb_Edge(sharedIndices[edges[i].x][0], sharedIndices[edges[i].y][0]);
}
return array;
}
// Token: 0x06000075 RID: 117 RVA: 0x0000E3DC File Offset: 0x0000C7DC
public static pb_Edge[] AllEdges(pb_Face[] faces)
{
List<pb_Edge> list = new List<pb_Edge>();
foreach (pb_Face pb_Face in faces)
{
list.AddRange(pb_Face.edges);
}
return list.ToArray();
}
// Token: 0x06000076 RID: 118 RVA: 0x0000E41C File Offset: 0x0000C81C
public static bool ContainsDuplicateFast(pb_Edge[] edges, pb_Edge edge)
{
int num = 0;
for (int i = 0; i < edges.Length; i++)
{
if (edges[i].Equals(edge))
{
num++;
}
}
return num > 1;
}
// Token: 0x06000077 RID: 119 RVA: 0x0000E458 File Offset: 0x0000C858
public static Vector3[] VerticesWithEdges(pb_Edge[] edges, Vector3[] vertices)
{
Vector3[] array = new Vector3[edges.Length * 2];
int num = 0;
for (int i = 0; i < edges.Length; i++)
{
array[num++] = vertices[edges[i].x];
array[num++] = vertices[edges[i].y];
}
return array;
}
// Token: 0x06000078 RID: 120 RVA: 0x0000E4D0 File Offset: 0x0000C8D0
public static pb_Edge[] GetPerimeterEdges(pb_Edge[] edges)
{
int[] count = pbUtil.FilledArray<int>(0, edges.Length);
for (int i = 0; i < edges.Length - 1; i++)
{
for (int j = i + 1; j < edges.Length; j++)
{
if (edges[i].Equals(edges[j]))
{
count[i]++;
count[j]++;
}
}
}
return edges.Where((pb_Edge val, int index) => count[index] < 1).ToArray<pb_Edge>();
}
// Token: 0x04000085 RID: 133
public int x;
// Token: 0x04000086 RID: 134
public int y;
}
}
@@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
namespace ProBuilder2.Common
{
// Token: 0x0200004C RID: 76
[Obsolete("Use pb_ConnectEdges class directly.")]
public class pb_EdgeConnection : IEquatable<pb_EdgeConnection>
{
// Token: 0x0600024D RID: 589 RVA: 0x0001EE45 File Offset: 0x0001D245
public pb_EdgeConnection(pb_Face face, List<pb_Edge> edges)
{
this.face = face;
this.edges = edges;
}
// Token: 0x17000039 RID: 57
// (get) Token: 0x0600024E RID: 590 RVA: 0x0001EE5B File Offset: 0x0001D25B
public bool isValid
{
get
{
return this.edges != null && this.edges.Count > 1;
}
}
// Token: 0x0600024F RID: 591 RVA: 0x0001EE79 File Offset: 0x0001D279
public override bool Equals(object b)
{
return b is pb_EdgeConnection && this.face == ((pb_EdgeConnection)b).face;
}
// Token: 0x06000250 RID: 592 RVA: 0x0001EE9F File Offset: 0x0001D29F
public bool Equals(pb_EdgeConnection fc)
{
return this.face == fc.face;
}
// Token: 0x06000251 RID: 593 RVA: 0x0001EEAF File Offset: 0x0001D2AF
public static explicit operator pb_Face(pb_EdgeConnection fc)
{
return fc.face;
}
// Token: 0x06000252 RID: 594 RVA: 0x0001EEB7 File Offset: 0x0001D2B7
public override int GetHashCode()
{
return base.GetHashCode();
}
// Token: 0x06000253 RID: 595 RVA: 0x0001EEBF File Offset: 0x0001D2BF
public override string ToString()
{
return this.face.ToString() + " : " + this.edges.ToString(", ");
}
// Token: 0x06000254 RID: 596 RVA: 0x0001EEE8 File Offset: 0x0001D2E8
public static List<int> AllTriangles(List<pb_EdgeConnection> ec)
{
List<pb_Edge> list = new List<pb_Edge>();
foreach (pb_EdgeConnection pb_EdgeConnection in ec)
{
list.AddRange(pb_EdgeConnection.edges);
}
return list.AllTriangles();
}
// Token: 0x040001B1 RID: 433
public pb_Face face;
// Token: 0x040001B2 RID: 434
public List<pb_Edge> edges;
}
}
+80
View File
@@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace ProBuilder2.Common
{
// Token: 0x0200004D RID: 77
public class pb_EdgeLookup : IEquatable<pb_EdgeLookup>
{
// Token: 0x06000255 RID: 597 RVA: 0x0001EF50 File Offset: 0x0001D350
public pb_EdgeLookup(pb_Edge common, pb_Edge local)
{
this.common = common;
this.local = local;
}
// Token: 0x06000256 RID: 598 RVA: 0x0001EF66 File Offset: 0x0001D366
public pb_EdgeLookup(int cx, int cy, int x, int y)
{
this.common = new pb_Edge(cx, cy);
this.local = new pb_Edge(x, y);
}
// Token: 0x06000257 RID: 599 RVA: 0x0001EF89 File Offset: 0x0001D389
public bool Equals(pb_EdgeLookup b)
{
return this.common.Equals(b.common);
}
// Token: 0x06000258 RID: 600 RVA: 0x0001EF9C File Offset: 0x0001D39C
public override bool Equals(object b)
{
pb_EdgeLookup pb_EdgeLookup = b as pb_EdgeLookup;
return pb_EdgeLookup != null && this.common.Equals(pb_EdgeLookup.common);
}
// Token: 0x06000259 RID: 601 RVA: 0x0001EFD0 File Offset: 0x0001D3D0
public static bool operator ==(pb_EdgeLookup a, pb_EdgeLookup b)
{
return a.Equals(b);
}
// Token: 0x0600025A RID: 602 RVA: 0x0001EFD9 File Offset: 0x0001D3D9
public static bool operator !=(pb_EdgeLookup a, pb_EdgeLookup b)
{
return !a.Equals(b);
}
// Token: 0x0600025B RID: 603 RVA: 0x0001EFE5 File Offset: 0x0001D3E5
public override int GetHashCode()
{
return this.common.GetHashCode();
}
// Token: 0x0600025C RID: 604 RVA: 0x0001EFF4 File Offset: 0x0001D3F4
public override string ToString()
{
return string.Format("c({0}, {1}) l({2}, {3}) > {4}", new object[]
{
this.common.x,
this.common.y,
this.local.x,
this.local.y,
this.GetHashCode()
});
}
// Token: 0x0600025D RID: 605 RVA: 0x0001F06C File Offset: 0x0001D46C
public static IEnumerable<pb_EdgeLookup> GetEdgeLookup(IEnumerable<pb_Edge> edges, Dictionary<int, int> lookup)
{
return edges.Select((pb_Edge x) => new pb_EdgeLookup(new pb_Edge(lookup[x.x], lookup[x.y]), x));
}
// Token: 0x040001B3 RID: 435
public pb_Edge local;
// Token: 0x040001B4 RID: 436
public pb_Edge common;
}
}
+306
View File
@@ -0,0 +1,306 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000010 RID: 16
[ExecuteInEditMode]
[AddComponentMenu("")]
[Serializable]
public class pb_ElementGraphics : pb_MonoBehaviourSingleton<pb_ElementGraphics>
{
// Token: 0x06000083 RID: 131 RVA: 0x0000EA04 File Offset: 0x0000CE04
public override void Awake()
{
base.Awake();
base.gameObject.hideFlags = HideFlags.HideAndDontSave;
if (pb_MonoBehaviourSingleton<pb_MeshRenderer>.nullableInstance == null)
{
base.gameObject.AddComponent<pb_MeshRenderer>();
}
this.wireframeMaterial = this.CreateMaterial(Shader.Find("Hidden/ProBuilder/FaceHighlight"), "WIREFRAME_MATERIAL");
this.wireframeMaterial.SetColor("_Color", this.wireframeColor);
this.faceMaterial = this.CreateMaterial(Shader.Find("Hidden/ProBuilder/FaceHighlight"), "FACE_SELECTION_MATERIAL");
this.faceMaterial.SetColor("_Color", this.faceSelectionColor);
this.vertexMaterial = this.CreateMaterial(Shader.Find("Hidden/ProBuilder/pb_VertexShader"), "VERTEX_BILLBOARD_MATERIAL");
this.vertexMaterial.SetColor("_Color", this.vertexDotColor);
this.vertexMaterial.SetFloat("_Scale", pb_ElementGraphics.vertexHandleSize * 4f);
}
// Token: 0x06000084 RID: 132 RVA: 0x0000EAEE File Offset: 0x0000CEEE
private void OnDestroy()
{
global::UnityEngine.Object.DestroyImmediate(this.faceMaterial);
global::UnityEngine.Object.DestroyImmediate(this.vertexMaterial);
global::UnityEngine.Object.DestroyImmediate(this.wireframeMaterial);
}
// Token: 0x06000085 RID: 133 RVA: 0x0000EB14 File Offset: 0x0000CF14
public override void OnEnable()
{
base.OnEnable();
this.pool = new pb_ObjectPool<pb_Renderable>(0, 8, new Func<pb_Renderable>(pb_Renderable.CreateInstance), new Action<pb_Renderable>(pb_Renderable.DestroyInstance));
}
// Token: 0x06000086 RID: 134 RVA: 0x0000EB6E File Offset: 0x0000CF6E
private void OnDisable()
{
this.pool.Empty();
}
// Token: 0x06000087 RID: 135 RVA: 0x0000EB7C File Offset: 0x0000CF7C
private Material CreateMaterial(Shader shader, string materialName)
{
return new Material(shader)
{
name = materialName,
hideFlags = pb_ElementGraphics.PB_EDITOR_GRAPHIC_HIDE_FLAGS
};
}
// Token: 0x06000088 RID: 136 RVA: 0x0000EBA4 File Offset: 0x0000CFA4
public void LoadPrefs(Color in_faceSelectionColor, Color in_edgeSelectionColor, Color in_vertSelectionColor, Color in_vertexDotColor, float in_vertexHandleSize)
{
this.faceSelectionColor = in_faceSelectionColor;
this.edgeSelectionColor = in_edgeSelectionColor;
this.vertSelectionColor = in_vertSelectionColor;
this.vertexDotColor = in_vertexDotColor;
pb_ElementGraphics.vertexHandleSize = in_vertexHandleSize;
this.wireframeMaterial.SetColor("_Color", this.wireframeColor);
this.faceMaterial.SetColor("_Color", this.faceSelectionColor);
this.vertexMaterial.SetColor("_Color", this.vertexDotColor);
this.vertexMaterial.SetFloat("_Scale", pb_ElementGraphics.vertexHandleSize * 4f);
}
// Token: 0x06000089 RID: 137 RVA: 0x0000EC32 File Offset: 0x0000D032
private void AddRenderable(pb_Renderable ren)
{
this.activeRenderables.Add(ren);
pb_MeshRenderer.Add(ren);
}
// Token: 0x0600008A RID: 138 RVA: 0x0000EC48 File Offset: 0x0000D048
public void RebuildGraphics(pb_Object[] selection, pb_Edge[][] universalEdgesDistinct, EditLevel editLevel, SelectMode selectionMode)
{
if (this.pool == null)
{
return;
}
foreach (pb_Renderable pb_Renderable in this.activeRenderables)
{
this.pool.Put(pb_Renderable);
pb_MeshRenderer.Remove(pb_Renderable);
}
this.wireframeMaterial.SetColor("_Color", (selectionMode != SelectMode.Edge || editLevel != EditLevel.Geometry) ? this.wireframeColor : this.edgeSelectionColor);
for (int i = 0; i < selection.Length; i++)
{
this.AddRenderable(this.BuildEdgeMesh(selection[i], universalEdgesDistinct[i]));
}
if (editLevel == EditLevel.Geometry)
{
if (selectionMode != SelectMode.Face)
{
if (selectionMode == SelectMode.Vertex)
{
foreach (pb_Object pb_Object in selection)
{
this.AddRenderable(this.BuildVertexMesh(pb_Object));
}
}
}
else
{
foreach (pb_Object pb_Object2 in selection)
{
this.AddRenderable(this.BuildFaceMesh(pb_Object2));
}
}
}
}
// Token: 0x0600008B RID: 139 RVA: 0x0000ED9C File Offset: 0x0000D19C
private pb_Renderable BuildFaceMesh(pb_Object pb)
{
pb_Renderable pb_Renderable = this.pool.Get();
pb_Renderable.name = "Faces Renderable";
pb_Renderable.transform = pb.transform;
pb_Renderable.materials = new Material[] { this.faceMaterial };
pb_Renderable.mesh.Clear();
pb_Renderable.mesh.vertices = pb.vertices;
pb_Renderable.mesh.triangles = pb_Face.AllTriangles(pb.SelectedFaces);
return pb_Renderable;
}
// Token: 0x0600008C RID: 140 RVA: 0x0000EE14 File Offset: 0x0000D214
private pb_Renderable BuildVertexMesh(pb_Object pb)
{
ushort num = 16383;
int num2 = pb.sharedIndices.Length;
if (num2 > (int)num)
{
num2 = (int)num;
}
Vector3[] array = new Vector3[pb.sharedIndices.Length];
HashSet<int> hashSet = new HashSet<int>(pb.sharedIndices.GetCommonIndices(pb.SelectedTriangles));
for (int i = 0; i < num2; i++)
{
array[i] = pb.vertices[pb.sharedIndices[i][0]];
}
Vector3[] array2 = new Vector3[num2 * 4];
Vector3[] array3 = new Vector3[num2 * 4];
Vector2[] array4 = new Vector2[num2 * 4];
Vector2[] array5 = new Vector2[num2 * 4];
Color[] array6 = new Color[num2 * 4];
int[] array7 = new int[num2 * 6];
int num3 = 0;
int num4 = 0;
Vector3 up = Vector3.up;
Vector3 right = Vector3.right;
for (int j = 0; j < num2; j++)
{
array2[num4] = array[j];
array2[num4 + 1] = array[j];
array2[num4 + 2] = array[j];
array2[num4 + 3] = array[j];
array4[num4] = Vector3.zero;
array4[num4 + 1] = Vector3.right;
array4[num4 + 2] = Vector3.up;
array4[num4 + 3] = Vector3.one;
array5[num4] = -up - right;
array5[num4 + 1] = -up + right;
array5[num4 + 2] = up - right;
array5[num4 + 3] = up + right;
array3[num4] = Vector3.forward;
array3[num4 + 1] = Vector3.forward;
array3[num4 + 2] = Vector3.forward;
array3[num4 + 3] = Vector3.forward;
array7[num3] = num4;
array7[num3 + 1] = num4 + 1;
array7[num3 + 2] = num4 + 2;
array7[num3 + 3] = num4 + 1;
array7[num3 + 4] = num4 + 3;
array7[num3 + 5] = num4 + 2;
if (hashSet.Contains(j))
{
array6[num4] = this.vertSelectionColor;
array6[num4 + 1] = this.vertSelectionColor;
array6[num4 + 2] = this.vertSelectionColor;
array6[num4 + 3] = this.vertSelectionColor;
}
else
{
array6[num4] = this.vertexDotColor;
array6[num4 + 1] = this.vertexDotColor;
array6[num4 + 2] = this.vertexDotColor;
array6[num4 + 3] = this.vertexDotColor;
}
num4 += 4;
num3 += 6;
}
pb_Renderable pb_Renderable = this.pool.Get();
pb_Renderable.name = "Vertex Renderable";
pb_Renderable.transform = pb.transform;
pb_Renderable.materials = new Material[] { this.vertexMaterial };
pb_Renderable.mesh.Clear();
pb_Renderable.mesh.vertices = array2;
pb_Renderable.mesh.normals = array3;
pb_Renderable.mesh.uv = array4;
pb_Renderable.mesh.uv2 = array5;
pb_Renderable.mesh.colors = array6;
pb_Renderable.mesh.triangles = array7;
return pb_Renderable;
}
// Token: 0x0600008D RID: 141 RVA: 0x0000F258 File Offset: 0x0000D658
private pb_Renderable BuildEdgeMesh(pb_Object pb, pb_Edge[] universalEdgesDistinct)
{
pb_IntArray[] sharedIndices = pb.sharedIndices;
int num = universalEdgesDistinct.Length;
int[] array = new int[num * 2];
int num2 = 0;
for (int i = 0; i < num; i++)
{
array[num2++] = sharedIndices[universalEdgesDistinct[i].x][0];
array[num2++] = sharedIndices[universalEdgesDistinct[i].y][0];
}
pb_Renderable pb_Renderable = this.pool.Get();
pb_Renderable.name = "Wireframe Renderable";
pb_Renderable.materials = new Material[] { this.wireframeMaterial };
pb_Renderable.transform = pb.transform;
pb_Renderable.mesh.name = "Wireframe Mesh";
pb_Renderable.mesh.Clear();
pb_Renderable.mesh.vertices = pb.vertices;
pb_Renderable.mesh.normals = pb.vertices;
pb_Renderable.mesh.uv = new Vector2[pb.vertexCount];
pb_Renderable.mesh.subMeshCount = 1;
pb_Renderable.mesh.SetIndices(array, MeshTopology.Lines, 0);
return pb_Renderable;
}
// Token: 0x04000088 RID: 136
private const string FACE_SHADER = "Hidden/ProBuilder/FaceHighlight";
// Token: 0x04000089 RID: 137
private const string EDGE_SHADER = "Hidden/ProBuilder/FaceHighlight";
// Token: 0x0400008A RID: 138
private const string VERT_SHADER = "Hidden/ProBuilder/pb_VertexShader";
// Token: 0x0400008B RID: 139
private const string PREVIEW_OBJECT_NAME = "ProBuilderSelectionGameObject";
// Token: 0x0400008C RID: 140
private const string WIREFRAME_OBJECT_NAME = "ProBuilderWireframeGameObject";
// Token: 0x0400008D RID: 141
private const string SELECTION_MESH_NAME = "ProBuilderEditorSelectionMesh";
// Token: 0x0400008E RID: 142
private const string WIREFRAME_MESH_NAME = "ProBuilderEditorWireframeMesh";
// Token: 0x0400008F RID: 143
private static float vertexHandleSize = 0.03f;
// Token: 0x04000090 RID: 144
[SerializeField]
private Material faceMaterial;
// Token: 0x04000091 RID: 145
[SerializeField]
private Material vertexMaterial;
// Token: 0x04000092 RID: 146
[SerializeField]
private Material wireframeMaterial;
// Token: 0x04000093 RID: 147
[SerializeField]
private Color faceSelectionColor = new Color(0f, 1f, 1f, 0.275f);
// Token: 0x04000094 RID: 148
[SerializeField]
private Color edgeSelectionColor = new Color(0f, 0.6f, 0.7f, 1f);
// Token: 0x04000095 RID: 149
[SerializeField]
private Color vertSelectionColor = new Color(1f, 0.2f, 0.2f, 1f);
// Token: 0x04000096 RID: 150
[SerializeField]
private Color wireframeColor = new Color(0.53f, 0.65f, 0.84f, 1f);
// Token: 0x04000097 RID: 151
[SerializeField]
private Color vertexDotColor = new Color(0.8f, 0.8f, 0.8f, 1f);
// Token: 0x04000098 RID: 152
private static readonly HideFlags PB_EDITOR_GRAPHIC_HIDE_FLAGS = HideFlags.HideInHierarchy | HideFlags.HideInInspector | HideFlags.DontSaveInEditor | HideFlags.NotEditable;
// Token: 0x04000099 RID: 153
private pb_ObjectPool<pb_Renderable> pool;
// Token: 0x0400009A RID: 154
private List<pb_Renderable> activeRenderables = new List<pb_Renderable>();
}
}
+49
View File
@@ -0,0 +1,49 @@
using System;
using ProBuilder2.Common;
using UnityEngine;
// Token: 0x02000011 RID: 17
[DisallowMultipleComponent]
[AddComponentMenu("")]
public class pb_Entity : MonoBehaviour
{
// Token: 0x1700000E RID: 14
// (get) Token: 0x06000090 RID: 144 RVA: 0x0000F38E File Offset: 0x0000D78E
public EntityType entityType
{
get
{
return this._entityType;
}
}
// Token: 0x06000091 RID: 145 RVA: 0x0000F398 File Offset: 0x0000D798
public void Awake()
{
MeshRenderer component = base.GetComponent<MeshRenderer>();
if (!component)
{
return;
}
switch (this.entityType)
{
case EntityType.Trigger:
component.enabled = false;
break;
case EntityType.Collider:
component.enabled = false;
break;
}
}
// Token: 0x06000092 RID: 146 RVA: 0x0000F3FC File Offset: 0x0000D7FC
public void SetEntity(EntityType t)
{
this._entityType = t;
}
// Token: 0x0400009D RID: 157
[SerializeField]
[HideInInspector]
private EntityType _entityType;
}
+572
View File
@@ -0,0 +1,572 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000025 RID: 37
[Serializable]
public class pb_Face
{
// Token: 0x06000093 RID: 147 RVA: 0x0000F405 File Offset: 0x0000D805
public pb_Face()
{
}
// Token: 0x06000094 RID: 148 RVA: 0x0000F414 File Offset: 0x0000D814
public pb_Face(int[] i)
{
this.SetIndices(i);
this._uv = new pb_UV();
this._mat = pb_Constant.DefaultMaterial;
this._smoothingGroup = 0;
this.elementGroup = 0;
}
// Token: 0x06000095 RID: 149 RVA: 0x0000F450 File Offset: 0x0000D850
public pb_Face(int[] i, Material m, pb_UV u, int smoothingGroup, int textureGroup, int elementGroup, bool manualUV)
{
this.SetIndices(i);
this._uv = new pb_UV(u);
this._mat = m;
this._smoothingGroup = smoothingGroup;
this.textureGroup = textureGroup;
this.elementGroup = elementGroup;
this.manualUV = manualUV;
}
// Token: 0x06000096 RID: 150 RVA: 0x0000F4A4 File Offset: 0x0000D8A4
public pb_Face(pb_Face face)
{
this._indices = new int[face.indices.Length];
Array.Copy(face.indices, this._indices, face.indices.Length);
this._uv = new pb_UV(face.uv);
this._mat = face.material;
this._smoothingGroup = face.smoothingGroup;
this.textureGroup = face.textureGroup;
this.elementGroup = face.elementGroup;
this.manualUV = face.manualUV;
this.RebuildCaches();
}
// Token: 0x06000097 RID: 151 RVA: 0x0000F540 File Offset: 0x0000D940
public void CopyFrom(pb_Face other)
{
int num = ((other.indices != null) ? other.indices.Length : 0);
this._indices = new int[num];
Array.Copy(other.indices, this._indices, num);
this._smoothingGroup = other.smoothingGroup;
this._uv = new pb_UV(other.uv);
this._mat = other.material;
this.manualUV = other.manualUV;
this.elementGroup = other.elementGroup;
this.RebuildCaches();
}
// Token: 0x1700000F RID: 15
// (get) Token: 0x06000098 RID: 152 RVA: 0x0000F5CC File Offset: 0x0000D9CC
public int[] indices
{
get
{
return this._indices;
}
}
// Token: 0x17000010 RID: 16
// (get) Token: 0x06000099 RID: 153 RVA: 0x0000F5D4 File Offset: 0x0000D9D4
public int[] distinctIndices
{
get
{
return (this._distinctIndices != null) ? this._distinctIndices : this.CacheDistinctIndices();
}
}
// Token: 0x17000011 RID: 17
// (get) Token: 0x0600009A RID: 154 RVA: 0x0000F5F2 File Offset: 0x0000D9F2
public pb_Edge[] edges
{
get
{
return (this._edges != null) ? this._edges : this.CacheEdges();
}
}
// Token: 0x17000012 RID: 18
// (get) Token: 0x0600009B RID: 155 RVA: 0x0000F610 File Offset: 0x0000DA10
// (set) Token: 0x0600009C RID: 156 RVA: 0x0000F618 File Offset: 0x0000DA18
public int smoothingGroup
{
get
{
return this._smoothingGroup;
}
set
{
this._smoothingGroup = value;
}
}
// Token: 0x17000013 RID: 19
// (get) Token: 0x0600009D RID: 157 RVA: 0x0000F621 File Offset: 0x0000DA21
// (set) Token: 0x0600009E RID: 158 RVA: 0x0000F629 File Offset: 0x0000DA29
public Material material
{
get
{
return this._mat;
}
set
{
this._mat = value;
}
}
// Token: 0x17000014 RID: 20
// (get) Token: 0x0600009F RID: 159 RVA: 0x0000F632 File Offset: 0x0000DA32
// (set) Token: 0x060000A0 RID: 160 RVA: 0x0000F63A File Offset: 0x0000DA3A
public pb_UV uv
{
get
{
return this._uv;
}
set
{
this._uv = value;
}
}
// Token: 0x060000A1 RID: 161 RVA: 0x0000F643 File Offset: 0x0000DA43
[Obsolete("Use face.material property.")]
public void SetMaterial(Material material)
{
this._mat = material;
}
// Token: 0x060000A2 RID: 162 RVA: 0x0000F64C File Offset: 0x0000DA4C
[Obsolete("Use face.uv property.")]
public void SetUV(pb_UV uvs)
{
this._uv = uvs;
}
// Token: 0x060000A3 RID: 163 RVA: 0x0000F655 File Offset: 0x0000DA55
[Obsolete("Use face.smoothingGroup property.")]
public void SetSmoothingGroup(int smoothing)
{
this._smoothingGroup = smoothing;
}
// Token: 0x060000A4 RID: 164 RVA: 0x0000F65E File Offset: 0x0000DA5E
public bool IsValid()
{
return this.indices.Length > 2;
}
// Token: 0x060000A5 RID: 165 RVA: 0x0000F66C File Offset: 0x0000DA6C
public Vector3[] GetDistinctVertices(Vector3[] verts)
{
int[] distinctIndices = this.distinctIndices;
Vector3[] array = new Vector3[distinctIndices.Length];
for (int i = 0; i < distinctIndices.Length; i++)
{
array[i] = verts[distinctIndices[i]];
}
return array;
}
// Token: 0x060000A6 RID: 166 RVA: 0x0000F6B8 File Offset: 0x0000DAB8
public int[] GetTriangle(int index)
{
if (index * 3 + 3 > this.indices.Length)
{
return null;
}
return new int[]
{
this.indices[index * 3],
this.indices[index * 3 + 1],
this.indices[index * 3 + 2]
};
}
// Token: 0x060000A7 RID: 167 RVA: 0x0000F70C File Offset: 0x0000DB0C
public pb_Edge[] GetAllEdges()
{
pb_Edge[] array = new pb_Edge[this.indices.Length];
for (int i = 0; i < this.indices.Length; i += 3)
{
array[i] = new pb_Edge(this.indices[i], this.indices[i + 1]);
array[i + 1] = new pb_Edge(this.indices[i + 1], this.indices[i + 2]);
array[i + 2] = new pb_Edge(this.indices[i + 2], this.indices[i]);
}
return array;
}
// Token: 0x060000A8 RID: 168 RVA: 0x0000F795 File Offset: 0x0000DB95
public void SetIndices(int[] i)
{
this._indices = i;
this.RebuildCaches();
}
// Token: 0x060000A9 RID: 169 RVA: 0x0000F7A4 File Offset: 0x0000DBA4
public void ShiftIndices(int offset)
{
for (int i = 0; i < this._indices.Length; i++)
{
this._indices[i] += offset;
}
}
// Token: 0x060000AA RID: 170 RVA: 0x0000F7DC File Offset: 0x0000DBDC
public int SmallestIndexValue()
{
int num = this._indices[0];
for (int i = 0; i < this._indices.Length; i++)
{
if (this._indices[i] < num)
{
num = this._indices[i];
}
}
return num;
}
// Token: 0x060000AB RID: 171 RVA: 0x0000F824 File Offset: 0x0000DC24
public void ShiftIndicesToZero()
{
int num = this.SmallestIndexValue();
for (int i = 0; i < this.indices.Length; i++)
{
this._indices[i] -= num;
}
for (int j = 0; j < this._distinctIndices.Length; j++)
{
this._distinctIndices[j] -= num;
}
for (int k = 0; k < this._edges.Length; k++)
{
this._edges[k].x -= num;
this._edges[k].y -= num;
}
}
// Token: 0x060000AC RID: 172 RVA: 0x0000F8CF File Offset: 0x0000DCCF
public void ReverseIndices()
{
Array.Reverse(this._indices);
this.RebuildCaches();
}
// Token: 0x060000AD RID: 173 RVA: 0x0000F8E2 File Offset: 0x0000DCE2
public void RebuildCaches()
{
this.CacheDistinctIndices();
this.CacheEdges();
}
// Token: 0x060000AE RID: 174 RVA: 0x0000F8F4 File Offset: 0x0000DCF4
private pb_Edge[] CacheEdges()
{
if (this._indices == null)
{
return null;
}
HashSet<pb_Edge> hashSet = new HashSet<pb_Edge>();
List<pb_Edge> list = new List<pb_Edge>();
for (int i = 0; i < this.indices.Length; i += 3)
{
pb_Edge pb_Edge = new pb_Edge(this.indices[i], this.indices[i + 1]);
pb_Edge pb_Edge2 = new pb_Edge(this.indices[i + 1], this.indices[i + 2]);
pb_Edge pb_Edge3 = new pb_Edge(this.indices[i + 2], this.indices[i]);
if (!hashSet.Add(pb_Edge))
{
list.Add(pb_Edge);
}
if (!hashSet.Add(pb_Edge2))
{
list.Add(pb_Edge2);
}
if (!hashSet.Add(pb_Edge3))
{
list.Add(pb_Edge3);
}
}
hashSet.ExceptWith(list);
this._edges = hashSet.ToArray<pb_Edge>();
return this._edges;
}
// Token: 0x060000AF RID: 175 RVA: 0x0000F9D5 File Offset: 0x0000DDD5
private int[] CacheDistinctIndices()
{
if (this._indices == null)
{
return null;
}
this._distinctIndices = new HashSet<int>(this._indices).ToArray<int>();
return this.distinctIndices;
}
// Token: 0x060000B0 RID: 176 RVA: 0x0000FA00 File Offset: 0x0000DE00
public bool Contains(int[] triangle)
{
for (int i = 0; i < this.indices.Length; i += 3)
{
if (triangle.Contains(this.indices[i]) && triangle.Contains(this.indices[i + 1]) && triangle.Contains(this.indices[i + 2]))
{
return true;
}
}
return false;
}
// Token: 0x060000B1 RID: 177 RVA: 0x0000FA68 File Offset: 0x0000DE68
public static int[] AllTriangles(pb_Face[] q)
{
List<int> list = new List<int>(q.Length * 6);
foreach (pb_Face pb_Face in q)
{
list.AddRange(pb_Face.indices);
}
return list.ToArray();
}
// Token: 0x060000B2 RID: 178 RVA: 0x0000FAAC File Offset: 0x0000DEAC
public static int[] AllTriangles(List<pb_Face> q)
{
List<int> list = new List<int>(q.Count * 6);
foreach (pb_Face pb_Face in q)
{
list.AddRange(pb_Face.indices);
}
return list.ToArray();
}
// Token: 0x060000B3 RID: 179 RVA: 0x0000FB1C File Offset: 0x0000DF1C
public static int[] AllTrianglesDistinct(pb_Face[] q)
{
List<int> list = new List<int>();
foreach (pb_Face pb_Face in q)
{
list.AddRange(pb_Face.distinctIndices);
}
return list.ToArray();
}
// Token: 0x060000B4 RID: 180 RVA: 0x0000FB5C File Offset: 0x0000DF5C
public static List<int> AllTrianglesDistinct(List<pb_Face> f)
{
List<int> list = new List<int>();
foreach (pb_Face pb_Face in f)
{
list.AddRange(pb_Face.distinctIndices);
}
return list;
}
// Token: 0x060000B5 RID: 181 RVA: 0x0000FBC0 File Offset: 0x0000DFC0
public void ToQuadOrTriangles(out int[] quadOrTris)
{
if (this.ToQuad(out quadOrTris))
{
return;
}
int num = ((this.indices != null) ? Math.Max(0, this.indices.Length) : 0);
quadOrTris = new int[num];
Array.Copy(this.indices, quadOrTris, num);
}
// Token: 0x060000B6 RID: 182 RVA: 0x0000FC10 File Offset: 0x0000E010
public int[] ToQuad()
{
int[] array;
this.ToQuad(out array);
return array;
}
// Token: 0x060000B7 RID: 183 RVA: 0x0000FC28 File Offset: 0x0000E028
public bool ToQuad(out int[] quad)
{
if (this.indices == null || this.indices.Length != 6)
{
quad = null;
return false;
}
quad = new int[]
{
this.edges[0].x,
this.edges[0].y,
-1,
-1
};
if (this.edges[1].x == quad[1])
{
quad[2] = this.edges[1].y;
}
else if (this.edges[2].x == quad[1])
{
quad[2] = this.edges[2].y;
}
else if (this.edges[3].x == quad[1])
{
quad[2] = this.edges[3].y;
}
if (this.edges[1].x == quad[2])
{
quad[3] = this.edges[1].y;
}
else if (this.edges[2].x == quad[2])
{
quad[3] = this.edges[2].y;
}
else if (this.edges[3].x == quad[2])
{
quad[3] = this.edges[3].y;
}
return true;
}
// Token: 0x060000B8 RID: 184 RVA: 0x0000FD84 File Offset: 0x0000E184
public static int MeshTriangles(pb_Face[] faces, out int[][] submeshes, out Material[] materials)
{
Dictionary<Material, List<pb_Face>> dictionary = new Dictionary<Material, List<pb_Face>>();
int i;
for (i = 0; i < faces.Length; i++)
{
if (faces[i] == null)
{
Debug.LogWarning("Null face found! Skipping these triangles.");
}
else
{
Material material = faces[i].material ?? pb_Constant.UnityDefaultDiffuse;
if (dictionary.ContainsKey(material))
{
dictionary[material].Add(faces[i]);
}
else
{
dictionary.Add(material, new List<pb_Face>(1) { faces[i] });
}
}
}
materials = new Material[dictionary.Count];
submeshes = new int[materials.Length][];
i = 0;
foreach (KeyValuePair<Material, List<pb_Face>> keyValuePair in dictionary)
{
submeshes[i] = pb_Face.AllTriangles(keyValuePair.Value);
materials[i] = keyValuePair.Key;
i++;
}
return submeshes.Length;
}
// Token: 0x060000B9 RID: 185 RVA: 0x0000FE94 File Offset: 0x0000E294
public override string ToString()
{
if (this.indices.Length % 3 != 0)
{
return "Index count is not a multiple of 3.";
}
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < this.indices.Length; i += 3)
{
stringBuilder.Append("[");
stringBuilder.Append(this.indices[i]);
stringBuilder.Append(", ");
stringBuilder.Append(this.indices[i + 1]);
stringBuilder.Append(", ");
stringBuilder.Append(this.indices[i + 2]);
stringBuilder.Append("]");
if (i < this.indices.Length - 3)
{
stringBuilder.Append(", ");
}
}
return stringBuilder.ToString();
}
// Token: 0x060000BA RID: 186 RVA: 0x0000FF58 File Offset: 0x0000E358
public string ToStringDetailed()
{
string text = string.Concat(new object[]
{
"index count: ",
this._indices.Length,
"\nmat name : ",
this.material.name,
"\nisManual : ",
this.manualUV,
"\nsmoothing group: ",
this.smoothingGroup,
"\n"
});
for (int i = 0; i < this.indices.Length; i += 3)
{
string text2 = text;
text = string.Concat(new object[]
{
text2,
"Tri ",
i,
": ",
this._indices[i],
", ",
this._indices[i + 1],
", ",
this._indices[i + 2],
"\n"
});
}
text += "Distinct Indices:\n";
for (int j = 0; j < this.distinctIndices.Length; j++)
{
text = text + this.distinctIndices[j] + ", ";
}
return text;
}
// Token: 0x04000104 RID: 260
public const int MAX_SMOOTH_GROUPS = 24;
// Token: 0x04000105 RID: 261
[SerializeField]
private int[] _indices;
// Token: 0x04000106 RID: 262
[SerializeField]
private int[] _distinctIndices;
// Token: 0x04000107 RID: 263
[SerializeField]
private pb_Edge[] _edges;
// Token: 0x04000108 RID: 264
[SerializeField]
private int _smoothingGroup;
// Token: 0x04000109 RID: 265
[SerializeField]
private pb_UV _uv;
// Token: 0x0400010A RID: 266
[SerializeField]
private Material _mat;
// Token: 0x0400010B RID: 267
public bool manualUV;
// Token: 0x0400010C RID: 268
public int elementGroup;
// Token: 0x0400010D RID: 269
public int textureGroup = -1;
}
}
@@ -0,0 +1,93 @@
using System;
using System.Collections.Generic;
namespace ProBuilder2.Common
{
// Token: 0x0200004E RID: 78
public class pb_FaceRebuildData
{
// Token: 0x0600025F RID: 607 RVA: 0x0001F0D7 File Offset: 0x0001D4D7
public int Offset()
{
return this._appliedOffset;
}
// Token: 0x06000260 RID: 608 RVA: 0x0001F0DF File Offset: 0x0001D4DF
public override string ToString()
{
return string.Format("{0}\n{1}", this.vertices.ToString(", "), this.sharedIndices.ToString(", "));
}
// Token: 0x06000261 RID: 609 RVA: 0x0001F10C File Offset: 0x0001D50C
public static void Apply(IEnumerable<pb_FaceRebuildData> newFaces, pb_Object pb, List<pb_Vertex> vertices = null, List<pb_Face> faces = null, Dictionary<int, int> lookup = null, Dictionary<int, int> lookupUV = null)
{
List<pb_Face> list = ((faces != null) ? faces : new List<pb_Face>(pb.faces));
if (vertices == null)
{
vertices = new List<pb_Vertex>(pb_Vertex.GetVertices(pb, null));
}
if (lookup == null)
{
lookup = pb.sharedIndices.ToDictionary();
}
if (lookupUV == null)
{
lookupUV = ((pb.sharedIndicesUV == null) ? null : pb.sharedIndicesUV.ToDictionary());
}
pb_FaceRebuildData.Apply(newFaces, vertices, list, lookup, lookupUV);
pb.SetVertices(vertices, false);
pb.SetFaces(list.ToArray());
pb.SetSharedIndices(lookup);
pb.SetSharedIndicesUV(lookupUV);
}
// Token: 0x06000262 RID: 610 RVA: 0x0001F1B0 File Offset: 0x0001D5B0
public static void Apply(IEnumerable<pb_FaceRebuildData> newFaces, List<pb_Vertex> vertices, List<pb_Face> faces, Dictionary<int, int> sharedIndices, Dictionary<int, int> sharedIndicesUV = null)
{
int num = vertices.Count;
foreach (pb_FaceRebuildData pb_FaceRebuildData in newFaces)
{
pb_Face pb_Face = pb_FaceRebuildData.face;
int count = pb_FaceRebuildData.vertices.Count;
bool flag = sharedIndices != null && pb_FaceRebuildData.sharedIndices != null && pb_FaceRebuildData.sharedIndices.Count == count;
bool flag2 = sharedIndicesUV != null && pb_FaceRebuildData.sharedIndicesUV != null && pb_FaceRebuildData.sharedIndicesUV.Count == count;
for (int i = 0; i < count; i++)
{
int num2 = i;
if (sharedIndices != null)
{
sharedIndices.Add(num2 + num, (!flag) ? (-1) : pb_FaceRebuildData.sharedIndices[num2]);
}
if (sharedIndicesUV != null)
{
sharedIndicesUV.Add(num2 + num, (!flag2) ? (-1) : pb_FaceRebuildData.sharedIndicesUV[num2]);
}
}
pb_FaceRebuildData._appliedOffset = num;
for (int j = 0; j < pb_Face.indices.Length; j++)
{
pb_Face.indices[j] += num;
}
pb_Face.RebuildCaches();
num += pb_FaceRebuildData.vertices.Count;
faces.Add(pb_Face);
vertices.AddRange(pb_FaceRebuildData.vertices);
}
}
// Token: 0x040001B5 RID: 437
public pb_Face face;
// Token: 0x040001B6 RID: 438
public List<pb_Vertex> vertices;
// Token: 0x040001B7 RID: 439
public List<int> sharedIndices;
// Token: 0x040001B8 RID: 440
public List<int> sharedIndicesUV;
// Token: 0x040001B9 RID: 441
private int _appliedOffset;
}
}
@@ -0,0 +1,77 @@
using System;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x0200004F RID: 79
public class pb_HandleConstraint2D
{
// Token: 0x06000263 RID: 611 RVA: 0x0001F340 File Offset: 0x0001D740
public pb_HandleConstraint2D(int x, int y)
{
this.x = x;
this.y = y;
}
// Token: 0x06000264 RID: 612 RVA: 0x0001F356 File Offset: 0x0001D756
public pb_HandleConstraint2D Inverse()
{
return new pb_HandleConstraint2D((this.x != 1) ? 1 : 0, (this.y != 1) ? 1 : 0);
}
// Token: 0x06000265 RID: 613 RVA: 0x0001F383 File Offset: 0x0001D783
public Vector2 Mask(Vector2 v)
{
v.x *= (float)this.x;
v.y *= (float)this.y;
return v;
}
// Token: 0x06000266 RID: 614 RVA: 0x0001F3B0 File Offset: 0x0001D7B0
public Vector2 InverseMask(Vector2 v)
{
v.x *= ((this.x != 1) ? 1f : 0f);
v.y *= ((this.y != 1) ? 1f : 0f);
return v;
}
// Token: 0x06000267 RID: 615 RVA: 0x0001F410 File Offset: 0x0001D810
public static bool operator ==(pb_HandleConstraint2D a, pb_HandleConstraint2D b)
{
return a.x == b.x && a.y == b.y;
}
// Token: 0x06000268 RID: 616 RVA: 0x0001F434 File Offset: 0x0001D834
public static bool operator !=(pb_HandleConstraint2D a, pb_HandleConstraint2D b)
{
return a.x != b.x || a.y != b.y;
}
// Token: 0x06000269 RID: 617 RVA: 0x0001F45B File Offset: 0x0001D85B
public override int GetHashCode()
{
return base.GetHashCode();
}
// Token: 0x0600026A RID: 618 RVA: 0x0001F463 File Offset: 0x0001D863
public override bool Equals(object o)
{
return o is pb_HandleConstraint2D && ((pb_HandleConstraint2D)o).x == this.x && ((pb_HandleConstraint2D)o).y == this.y;
}
// Token: 0x0600026B RID: 619 RVA: 0x0001F49C File Offset: 0x0001D89C
public override string ToString()
{
return string.Concat(new object[] { "(", this.x, ", ", this.y, ")" });
}
// Token: 0x040001BA RID: 442
public int x;
// Token: 0x040001BB RID: 443
public int y;
// Token: 0x040001BC RID: 444
public static readonly pb_HandleConstraint2D None = new pb_HandleConstraint2D(1, 1);
}
}
+277
View File
@@ -0,0 +1,277 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000026 RID: 38
public static class pb_HandleUtility
{
// Token: 0x060000BB RID: 187 RVA: 0x000100A5 File Offset: 0x0000E4A5
public static bool FaceRaycast(Ray InWorldRay, pb_Object mesh, out pb_RaycastHit hit, HashSet<pb_Face> ignore = null)
{
return pb_HandleUtility.FaceRaycast(InWorldRay, mesh, out hit, float.PositiveInfinity, Culling.Front, ignore);
}
// Token: 0x060000BC RID: 188 RVA: 0x000100B8 File Offset: 0x0000E4B8
public static bool FaceRaycast(Ray InWorldRay, pb_Object mesh, out pb_RaycastHit hit, float distance, Culling cullingMode, HashSet<pb_Face> ignore = null)
{
InWorldRay.origin -= mesh.transform.position;
InWorldRay.origin = mesh.transform.worldToLocalMatrix * InWorldRay.origin;
InWorldRay.direction = mesh.transform.worldToLocalMatrix * InWorldRay.direction;
Vector3[] vertices = mesh.vertices;
float num = 0f;
Vector3 zero = Vector3.zero;
float num2 = float.PositiveInfinity;
int num3 = -1;
Vector3 vector = Vector3.zero;
for (int i = 0; i < mesh.faces.Length; i++)
{
if (ignore == null || !ignore.Contains(mesh.faces[i]))
{
int[] indices = mesh.faces[i].indices;
for (int j = 0; j < indices.Length; j += 3)
{
Vector3 vector2 = vertices[indices[j]];
Vector3 vector3 = vertices[indices[j + 1]];
Vector3 vector4 = vertices[indices[j + 2]];
Vector3 vector5 = Vector3.Cross(vector3 - vector2, vector4 - vector2);
float num4 = Vector3.Dot(InWorldRay.direction, vector5);
bool flag = false;
if (cullingMode != Culling.Front)
{
if (cullingMode == Culling.Back)
{
if (num4 < 0f)
{
flag = true;
}
}
}
else if (num4 > 0f)
{
flag = true;
}
if (!flag && pb_Math.RayIntersectsTriangle(InWorldRay, vector2, vector3, vector4, out num, out zero))
{
if (num <= num2 && num <= distance)
{
vector = vector5;
num3 = i;
num2 = num;
}
}
}
}
}
hit = new pb_RaycastHit(num2, InWorldRay.GetPoint(num2), vector, num3);
return num3 > -1;
}
// Token: 0x060000BD RID: 189 RVA: 0x000102B8 File Offset: 0x0000E6B8
public static bool FaceRaycast(Ray InWorldRay, pb_Object mesh, out List<pb_RaycastHit> hits, float distance, Culling cullingMode, HashSet<pb_Face> ignore = null)
{
InWorldRay.origin -= mesh.transform.position;
InWorldRay.origin = mesh.transform.worldToLocalMatrix * InWorldRay.origin;
InWorldRay.direction = mesh.transform.worldToLocalMatrix * InWorldRay.direction;
Vector3[] vertices = mesh.vertices;
float num = 0f;
Vector3 zero = Vector3.zero;
hits = new List<pb_RaycastHit>();
for (int i = 0; i < mesh.faces.Length; i++)
{
if (ignore == null || !ignore.Contains(mesh.faces[i]))
{
int[] indices = mesh.faces[i].indices;
for (int j = 0; j < indices.Length; j += 3)
{
Vector3 vector = vertices[indices[j]];
Vector3 vector2 = vertices[indices[j + 1]];
Vector3 vector3 = vertices[indices[j + 2]];
if (pb_Math.RayIntersectsTriangle(InWorldRay, vector, vector2, vector3, out num, out zero))
{
Vector3 vector4 = Vector3.Cross(vector2 - vector, vector3 - vector);
if (cullingMode != Culling.Front)
{
if (cullingMode != Culling.Back)
{
if (cullingMode == Culling.FrontBack)
{
goto IL_199;
}
}
else
{
float num2 = Vector3.Dot(InWorldRay.direction, vector4);
if (num2 > 0f)
{
goto IL_199;
}
}
}
else
{
float num2 = Vector3.Dot(InWorldRay.direction, -vector4);
if (num2 > 0f)
{
goto IL_199;
}
}
goto IL_1BC;
IL_199:
hits.Add(new pb_RaycastHit(num, InWorldRay.GetPoint(num), vector4, i));
}
IL_1BC:;
}
}
}
return hits.Count > 0;
}
// Token: 0x060000BE RID: 190 RVA: 0x000104B4 File Offset: 0x0000E8B4
public static Ray InverseTransformRay(this Transform transform, Ray InWorldRay)
{
Vector3 vector = InWorldRay.origin;
vector -= transform.position;
vector = transform.worldToLocalMatrix * vector;
Vector3 vector2 = transform.worldToLocalMatrix.MultiplyVector(InWorldRay.direction);
return new Ray(vector, vector2);
}
// Token: 0x060000BF RID: 191 RVA: 0x0001050C File Offset: 0x0000E90C
public static bool WorldRaycast(Ray InWorldRay, Transform transform, Vector3[] vertices, int[] triangles, out pb_RaycastHit hit, float distance = float.PositiveInfinity, Culling cullingMode = Culling.Front)
{
Ray ray = transform.InverseTransformRay(InWorldRay);
return pb_HandleUtility.MeshRaycast(ray, vertices, triangles, out hit, distance, cullingMode);
}
// Token: 0x060000C0 RID: 192 RVA: 0x00010530 File Offset: 0x0000E930
public static bool MeshRaycast(Ray InRay, Vector3[] vertices, int[] triangles, out pb_RaycastHit hit, float distance = float.PositiveInfinity, Culling cullingMode = Culling.Front)
{
float num = float.PositiveInfinity;
Vector3 vector = new Vector3(0f, 0f, 0f);
int num2 = -1;
Vector3 origin = InRay.origin;
Vector3 direction = InRay.direction;
for (int i = 0; i < triangles.Length; i += 3)
{
Vector3 vector2 = vertices[triangles[i]];
Vector3 vector3 = vertices[triangles[i + 1]];
Vector3 vector4 = vertices[triangles[i + 2]];
if (pb_Math.RayIntersectsTriangle2(origin, direction, vector2, vector3, vector4, ref distance, ref vector))
{
num2 = i / 3;
num = distance;
break;
}
}
hit = new pb_RaycastHit(num, InRay.GetPoint(num), vector, num2);
return num2 > -1;
}
// Token: 0x060000C1 RID: 193 RVA: 0x000105F8 File Offset: 0x0000E9F8
public static bool EdgeRaycast(Camera cam, Vector2 mousePosition, pb_Object mesh, pb_Edge[] edges, Vector3[] verticesInWorldSpace, out pb_Edge edge)
{
float num = float.PositiveInfinity;
edge = null;
GameObject gameObject = pb_HandleUtility.ObjectRaycast(cam, mousePosition, (GameObject[])Resources.FindObjectsOfTypeAll(typeof(GameObject)));
if (gameObject == null || gameObject != mesh.gameObject)
{
int width = Screen.width;
int height = Screen.height;
for (int i = 0; i < edges.Length; i++)
{
Vector3 vector = verticesInWorldSpace[edges[i].x];
Vector3 vector2 = verticesInWorldSpace[edges[i].y];
float num2 = pb_HandleUtility.DistancePoint2DToLine(cam, mousePosition, vector, vector2);
if (num2 < num && num2 < 20f)
{
Vector3 vector3 = cam.WorldToScreenPoint(vector);
if (vector3.z > 0f && vector3.x >= 0f && vector3.y >= 0f && vector3.x <= (float)width && vector3.y <= (float)height)
{
Vector3 vector4 = cam.WorldToScreenPoint(vector2);
if (vector4.z > 0f && vector4.x >= 0f && vector4.y >= 0f && vector4.x <= (float)width && vector4.y <= (float)height)
{
num = num2;
edge = edges[i];
}
}
}
}
}
else
{
Ray ray = cam.ScreenPointToRay(mousePosition);
List<pb_RaycastHit> list;
if (pb_HandleUtility.FaceRaycast(ray, mesh, out list, float.PositiveInfinity, Culling.FrontBack, null))
{
list.Sort((pb_RaycastHit x, pb_RaycastHit y) => x.distance.CompareTo(y.distance));
Vector3[] vertices = mesh.vertices;
for (int j = 0; j < list.Count; j++)
{
if (!pb_HandleUtility.PointIsOccluded(cam, mesh, mesh.transform.TransformPoint(list[j].point)))
{
foreach (pb_Edge pb_Edge in mesh.faces[list[j].face].GetAllEdges())
{
float num3 = pb_Math.DistancePointLineSegment(list[j].point, vertices[pb_Edge.x], vertices[pb_Edge.y]);
if (num3 < num)
{
num = num3;
edge = pb_Edge;
}
}
if (Vector3.Dot(ray.direction, mesh.transform.TransformDirection(list[j].normal)) < 0f)
{
break;
}
}
}
if (edge != null && pb_HandleUtility.DistancePoint2DToLine(cam, mousePosition, mesh.transform.TransformPoint(vertices[edge.x]), mesh.transform.TransformPoint(vertices[edge.y])) > 20f)
{
edge = null;
}
}
}
return edge != null;
}
// Token: 0x060000C2 RID: 194 RVA: 0x00010940 File Offset: 0x0000ED40
public static GameObject ObjectRaycast(Camera cam, Vector2 mousePosition, GameObject[] objects)
{
return null;
}
// Token: 0x060000C3 RID: 195 RVA: 0x00010944 File Offset: 0x0000ED44
public static float DistancePoint2DToLine(Camera cam, Vector2 mousePosition, Vector3 worldPosition1, Vector3 worldPosition2)
{
Vector2 vector = cam.WorldToScreenPoint(worldPosition1);
Vector2 vector2 = cam.WorldToScreenPoint(worldPosition2);
return pb_Math.DistancePointLineSegment(mousePosition, vector, vector2);
}
// Token: 0x060000C4 RID: 196 RVA: 0x00010974 File Offset: 0x0000ED74
public static bool PointIsOccluded(Camera cam, pb_Object pb, Vector3 worldPoint)
{
Vector3 normalized = (cam.transform.position - worldPoint).normalized;
Ray ray = new Ray(worldPoint + normalized * 0.0001f, normalized);
pb_RaycastHit pb_RaycastHit;
return pb_HandleUtility.FaceRaycast(ray, pb, out pb_RaycastHit, Vector3.Distance(cam.transform.position, worldPoint), Culling.Back, null);
}
// Token: 0x060000C5 RID: 197 RVA: 0x000109D0 File Offset: 0x0000EDD0
public static bool IsOccluded(Camera cam, pb_Object pb, pb_Face face)
{
Vector3 vector = Vector3.zero;
int num = face.distinctIndices.Length;
for (int i = 0; i < num; i++)
{
vector += pb.vertices[face.distinctIndices[i]];
}
vector *= 1f / (float)num;
return pb_HandleUtility.PointIsOccluded(cam, pb, pb.transform.TransformPoint(vector));
}
// Token: 0x0400010E RID: 270
private const float MAX_EDGE_SELECT_DISTANCE = 20f;
}
}
+52
View File
@@ -0,0 +1,52 @@
using System;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000008 RID: 8
public class pb_HsvColor
{
// Token: 0x0600003B RID: 59 RVA: 0x00002F6F File Offset: 0x0000136F
public pb_HsvColor(float h, float s, float v)
{
this.h = h;
this.s = s;
this.v = v;
}
// Token: 0x0600003C RID: 60 RVA: 0x00002F8C File Offset: 0x0000138C
public pb_HsvColor(float h, float s, float v, float sv_modifier)
{
this.h = h;
this.s = s * sv_modifier;
this.v = v * sv_modifier;
}
// Token: 0x0600003D RID: 61 RVA: 0x00002FAF File Offset: 0x000013AF
public static pb_HsvColor FromRGB(Color col)
{
return pb_ColorUtil.RGBtoHSV(col);
}
// Token: 0x0600003E RID: 62 RVA: 0x00002FB7 File Offset: 0x000013B7
public override string ToString()
{
return string.Format("( {0}, {1}, {2} )", this.h, this.s, this.v);
}
// Token: 0x0600003F RID: 63 RVA: 0x00002FE4 File Offset: 0x000013E4
public float SqrDistance(pb_HsvColor InColor)
{
return InColor.h / 360f - this.h / 360f + (InColor.s - this.s) + (InColor.v - this.v);
}
// Token: 0x04000013 RID: 19
public float h;
// Token: 0x04000014 RID: 20
public float s;
// Token: 0x04000015 RID: 21
public float v;
}
}
+11
View File
@@ -0,0 +1,11 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000027 RID: 39
public interface pb_IHasDefault
{
// Token: 0x060000C7 RID: 199
void SetDefaultValues();
}
}
+92
View File
@@ -0,0 +1,92 @@
using System;
using System.Collections.Generic;
namespace ProBuilder2.Common
{
// Token: 0x0200002A RID: 42
[Serializable]
public class pb_IntArray
{
// Token: 0x060000CA RID: 202 RVA: 0x00010A62 File Offset: 0x0000EE62
public pb_IntArray(int[] intArray)
{
this.array = intArray;
}
// Token: 0x060000CB RID: 203 RVA: 0x00010A71 File Offset: 0x0000EE71
public pb_IntArray(pb_IntArray intArray)
{
this.array = intArray.array;
}
// Token: 0x060000CC RID: 204 RVA: 0x00010A85 File Offset: 0x0000EE85
public List<int> ToList()
{
return new List<int>(this.array);
}
// Token: 0x17000015 RID: 21
public int this[int i]
{
get
{
return this.array[i];
}
set
{
this.array[i] = value;
}
}
// Token: 0x17000016 RID: 22
// (get) Token: 0x060000CF RID: 207 RVA: 0x00010AA7 File Offset: 0x0000EEA7
public int Length
{
get
{
return this.array.Length;
}
}
// Token: 0x060000D0 RID: 208 RVA: 0x00010AB1 File Offset: 0x0000EEB1
public static implicit operator int[](pb_IntArray intArr)
{
return intArr.array;
}
// Token: 0x060000D1 RID: 209 RVA: 0x00010AB9 File Offset: 0x0000EEB9
public static explicit operator pb_IntArray(int[] arr)
{
return new pb_IntArray(arr);
}
// Token: 0x060000D2 RID: 210 RVA: 0x00010AC1 File Offset: 0x0000EEC1
public override string ToString()
{
return this.array.ToString(",");
}
// Token: 0x060000D3 RID: 211 RVA: 0x00010AD3 File Offset: 0x0000EED3
public bool IsEmpty()
{
return this.array == null || this.array.Length < 1;
}
// Token: 0x060000D4 RID: 212 RVA: 0x00010AF0 File Offset: 0x0000EEF0
public static void RemoveEmptyOrNull(ref pb_IntArray[] val)
{
List<pb_IntArray> list = new List<pb_IntArray>();
foreach (pb_IntArray pb_IntArray in val)
{
if (pb_IntArray != null && !pb_IntArray.IsEmpty())
{
list.Add(pb_IntArray);
}
}
val = list.ToArray();
}
// Token: 0x04000110 RID: 272
public int[] array;
}
}
+382
View File
@@ -0,0 +1,382 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x0200002B RID: 43
public static class pb_IntArrayUtility
{
// Token: 0x060000D5 RID: 213 RVA: 0x00010B40 File Offset: 0x0000EF40
public static int[][] ToArray(this pb_IntArray[] val)
{
int[][] array = new int[val.Length][];
for (int i = 0; i < array.Length; i++)
{
array[i] = val[i].array;
}
return array;
}
// Token: 0x060000D6 RID: 214 RVA: 0x00010B78 File Offset: 0x0000EF78
public static Dictionary<int, int> ToDictionary(this pb_IntArray[] array)
{
Dictionary<int, int> dictionary = new Dictionary<int, int>();
for (int i = 0; i < array.Length; i++)
{
for (int j = 0; j < array[i].array.Length; j++)
{
if (!dictionary.ContainsKey(array[i][j]))
{
dictionary.Add(array[i][j], i);
}
}
}
return dictionary;
}
// Token: 0x060000D7 RID: 215 RVA: 0x00010BE0 File Offset: 0x0000EFE0
public static pb_IntArray[] ToSharedIndices(this IEnumerable<KeyValuePair<int, int>> lookup)
{
Dictionary<int, int> dictionary = new Dictionary<int, int>();
List<List<int>> list = new List<List<int>>();
foreach (KeyValuePair<int, int> keyValuePair in lookup)
{
if (keyValuePair.Value < 0)
{
list.Add(new List<int> { keyValuePair.Key });
}
else
{
int num = -1;
if (dictionary.TryGetValue(keyValuePair.Value, out num))
{
list[num].Add(keyValuePair.Key);
}
else
{
dictionary.Add(keyValuePair.Value, list.Count);
list.Add(new List<int> { keyValuePair.Key });
}
}
}
return list.ToPbIntArray();
}
// Token: 0x060000D8 RID: 216 RVA: 0x00010CD0 File Offset: 0x0000F0D0
public static pb_IntArray[] ToPbIntArray(this int[][] val)
{
pb_IntArray[] array = new pb_IntArray[val.Length];
for (int i = 0; i < array.Length; i++)
{
array[i] = (pb_IntArray)val[i];
}
return array;
}
// Token: 0x060000D9 RID: 217 RVA: 0x00010D08 File Offset: 0x0000F108
public static pb_IntArray[] ToPbIntArray(this List<List<int>> val)
{
pb_IntArray[] array = new pb_IntArray[val.Count];
for (int i = 0; i < array.Length; i++)
{
array[i] = (pb_IntArray)val[i].ToArray();
}
return array;
}
// Token: 0x060000DA RID: 218 RVA: 0x00010D4C File Offset: 0x0000F14C
public static List<List<int>> ToList(this pb_IntArray[] val)
{
List<List<int>> list = new List<List<int>>();
for (int i = 0; i < val.Length; i++)
{
list.Add(val[i].ToList());
}
return list;
}
// Token: 0x060000DB RID: 219 RVA: 0x00010D84 File Offset: 0x0000F184
public static string ToFormattedString(this pb_IntArray[] arr)
{
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < arr.Length; i++)
{
stringBuilder.Append("[" + arr[i].array.ToString(", ") + "] ");
}
return stringBuilder.ToString();
}
// Token: 0x060000DC RID: 220 RVA: 0x00010DDC File Offset: 0x0000F1DC
public static int IndexOf(this int[] array, int val, pb_IntArray[] sharedIndices)
{
int num = sharedIndices.IndexOf(val);
if (num < 0)
{
return -1;
}
int[] array2 = sharedIndices[num];
for (int i = 0; i < array.Length; i++)
{
if (Array.IndexOf<int>(array2, array[i]) > -1)
{
return i;
}
}
return -1;
}
// Token: 0x060000DD RID: 221 RVA: 0x00010E2C File Offset: 0x0000F22C
public static int IndexOf(this IList<int> indices, int triangle, ref Dictionary<int, int> lookup)
{
int num = lookup[triangle];
if (num < 0)
{
return -1;
}
int num2 = indices.Count<int>();
for (int i = 0; i < num2; i++)
{
if (lookup[indices[i]] == num)
{
return i;
}
}
return -1;
}
// Token: 0x060000DE RID: 222 RVA: 0x00010E7C File Offset: 0x0000F27C
public static int IndexOf(this pb_IntArray[] intArray, int index)
{
if (intArray == null)
{
return -1;
}
for (int i = 0; i < intArray.Length; i++)
{
for (int j = 0; j < intArray[i].Length; j++)
{
if (intArray[i][j] == index)
{
return i;
}
}
}
return -1;
}
// Token: 0x060000DF RID: 223 RVA: 0x00010ED0 File Offset: 0x0000F2D0
public static IList<int> AllIndicesWithValues(this pb_IntArray[] pbIntArr, IList<int> indices)
{
int[] array = pbIntArr.GetCommonIndices(indices).ToArray<int>();
List<int> list = new List<int>();
for (int i = 0; i < array.Length; i++)
{
list.AddRange(pbIntArr[array[i]].array);
}
return list;
}
// Token: 0x060000E0 RID: 224 RVA: 0x00010F18 File Offset: 0x0000F318
public static IList<int> AllIndicesWithValues(this pb_IntArray[] pbIntArr, Dictionary<int, int> lookup, IList<int> indices)
{
int[] array = pb_IntArrayUtility.GetCommonIndices(lookup, indices).ToArray<int>();
List<int> list = new List<int>();
for (int i = 0; i < array.Length; i++)
{
list.AddRange(pbIntArr[array[i]].array);
}
return list;
}
// Token: 0x060000E1 RID: 225 RVA: 0x00010F60 File Offset: 0x0000F360
public static IList<int> UniqueIndicesWithValues(this pb_IntArray[] pbIntArr, IList<int> indices)
{
Dictionary<int, int> dictionary = pbIntArr.ToDictionary();
HashSet<int> hashSet = new HashSet<int>();
foreach (int num in indices)
{
hashSet.Add(dictionary[num]);
}
List<int> list = new List<int>();
foreach (int num2 in hashSet)
{
list.Add(pbIntArr[num2][0]);
}
return list;
}
// Token: 0x060000E2 RID: 226 RVA: 0x00011024 File Offset: 0x0000F424
public static HashSet<int> GetCommonIndices(this pb_IntArray[] pbIntArr, IList<int> indices)
{
return pb_IntArrayUtility.GetCommonIndices(pbIntArr.ToDictionary(), indices);
}
// Token: 0x060000E3 RID: 227 RVA: 0x00011034 File Offset: 0x0000F434
public static HashSet<int> GetCommonIndices(Dictionary<int, int> lookup, IList<int> indices)
{
HashSet<int> hashSet = new HashSet<int>();
foreach (int num in indices)
{
hashSet.Add(lookup[num]);
}
return hashSet;
}
// Token: 0x060000E4 RID: 228 RVA: 0x00011098 File Offset: 0x0000F498
public static IEnumerable<int> GetIndicesWithCommon(this pb_IntArray[] pbIntArr, IEnumerable<int> common)
{
return common.Select((int x) => pbIntArr[x][0]);
}
// Token: 0x060000E5 RID: 229 RVA: 0x000110C4 File Offset: 0x0000F4C4
public static pb_IntArray[] ExtractSharedIndices(Vector3[] v)
{
Dictionary<pb_IntVec3, List<int>> dictionary = new Dictionary<pb_IntVec3, List<int>>();
for (int i = 0; i < v.Length; i++)
{
List<int> list;
if (dictionary.TryGetValue(v[i], out list))
{
list.Add(i);
}
else
{
dictionary.Add(new pb_IntVec3(v[i]), new List<int> { i });
}
}
pb_IntArray[] array = new pb_IntArray[dictionary.Count];
int num = 0;
foreach (KeyValuePair<pb_IntVec3, List<int>> keyValuePair in dictionary)
{
array[num++] = new pb_IntArray(keyValuePair.Value.ToArray());
}
return array;
}
// Token: 0x060000E6 RID: 230 RVA: 0x000111AC File Offset: 0x0000F5AC
public static int MergeSharedIndices(ref pb_IntArray[] sharedIndices, int[] indices)
{
if (indices.Length < 2)
{
return -1;
}
if (sharedIndices == null)
{
sharedIndices = new pb_IntArray[] { (pb_IntArray)indices };
return 0;
}
List<int> list = new List<int>();
List<int> list2 = new List<int>();
for (int i = 0; i < indices.Length; i++)
{
int num = sharedIndices.IndexOf(indices[i]);
if (!list.Contains(num))
{
if (num > -1)
{
list2.AddRange(sharedIndices[num].array);
list.Add(num);
}
else
{
list2.Add(indices[i]);
}
}
}
int num2 = sharedIndices.Length - list.Count;
pb_IntArray[] array = new pb_IntArray[num2];
int num3 = 0;
for (int j = 0; j < sharedIndices.Length; j++)
{
if (!list.Contains(j))
{
array[num3++] = sharedIndices[j];
}
}
sharedIndices = array.Add(new pb_IntArray(list2.ToArray()));
return sharedIndices.Length - 1;
}
// Token: 0x060000E7 RID: 231 RVA: 0x000112A8 File Offset: 0x0000F6A8
public static void MergeSharedIndices(ref pb_IntArray[] sharedIndices, int a, int b)
{
int num = sharedIndices.IndexOf(a);
int num2 = sharedIndices.IndexOf(b);
pb_IntArrayUtility.AddValueAtIndex(ref sharedIndices, num, b);
int[] array = sharedIndices[num2].array;
sharedIndices[num2].array = array.RemoveAt(Array.IndexOf<int>(array, b));
pb_IntArray.RemoveEmptyOrNull(ref sharedIndices);
}
// Token: 0x060000E8 RID: 232 RVA: 0x000112F8 File Offset: 0x0000F6F8
public static int AddValueAtIndex(ref pb_IntArray[] sharedIndices, int sharedIndex, int value)
{
if (sharedIndex > -1)
{
sharedIndices[sharedIndex].array = sharedIndices[sharedIndex].array.Add(value);
}
else
{
sharedIndices = sharedIndices.Add(new pb_IntArray(new int[] { value }));
}
return (sharedIndex <= -1) ? (sharedIndices.Length - 1) : sharedIndex;
}
// Token: 0x060000E9 RID: 233 RVA: 0x00011354 File Offset: 0x0000F754
public static int AddRangeAtIndex(ref pb_IntArray[] sharedIndices, int sharedIndex, int[] indices)
{
if (sharedIndex > -1)
{
sharedIndices[sharedIndex].array = sharedIndices[sharedIndex].array.AddRange(indices);
}
else
{
sharedIndices = sharedIndices.Add(new pb_IntArray(indices));
}
return (sharedIndex <= -1) ? (sharedIndices.Length - 1) : sharedIndex;
}
// Token: 0x060000EA RID: 234 RVA: 0x000113A8 File Offset: 0x0000F7A8
public static void RemoveValues(ref pb_IntArray[] sharedIndices, int[] remove)
{
for (int i = 0; i < sharedIndices.Length; i++)
{
for (int j = 0; j < remove.Length; j++)
{
int num = Array.IndexOf<int>(sharedIndices[i], remove[j]);
if (num > -1)
{
sharedIndices[i].array = sharedIndices[i].array.RemoveAt(num);
}
}
}
pb_IntArray.RemoveEmptyOrNull(ref sharedIndices);
}
// Token: 0x060000EB RID: 235 RVA: 0x00011418 File Offset: 0x0000F818
public static void RemoveValuesAndShift(ref pb_IntArray[] sharedIndices, IEnumerable<int> remove)
{
Dictionary<int, int> dictionary = sharedIndices.ToDictionary();
foreach (int num in remove)
{
dictionary[num] = -1;
}
sharedIndices = dictionary.Where((KeyValuePair<int, int> x) => x.Value > -1).ToSharedIndices();
List<int> list = new List<int>(remove);
list.Sort();
for (int i = 0; i < sharedIndices.Length; i++)
{
for (int j = 0; j < sharedIndices[i].Length; j++)
{
int num2 = pbUtil.NearestIndexPriorToValue<int>(list, sharedIndices[i][j]);
pb_IntArray pb_IntArray;
int num3;
(pb_IntArray = sharedIndices[i])[num3 = j] = pb_IntArray[num3] - (num2 + 1);
}
}
}
}
}
+111
View File
@@ -0,0 +1,111 @@
using System;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000050 RID: 80
public struct pb_IntVec3 : IEquatable<pb_IntVec3>
{
// Token: 0x0600026D RID: 621 RVA: 0x0001F4F6 File Offset: 0x0001D8F6
public pb_IntVec3(Vector3 vector)
{
this.vec = vector;
}
// Token: 0x1700003A RID: 58
// (get) Token: 0x0600026E RID: 622 RVA: 0x0001F4FF File Offset: 0x0001D8FF
public float x
{
get
{
return this.vec.x;
}
}
// Token: 0x1700003B RID: 59
// (get) Token: 0x0600026F RID: 623 RVA: 0x0001F50C File Offset: 0x0001D90C
public float y
{
get
{
return this.vec.y;
}
}
// Token: 0x1700003C RID: 60
// (get) Token: 0x06000270 RID: 624 RVA: 0x0001F519 File Offset: 0x0001D919
public float z
{
get
{
return this.vec.z;
}
}
// Token: 0x06000271 RID: 625 RVA: 0x0001F526 File Offset: 0x0001D926
public override string ToString()
{
return string.Format("({0:F2}, {1:F2}, {2:F2})", this.x, this.y, this.z);
}
// Token: 0x06000272 RID: 626 RVA: 0x0001F553 File Offset: 0x0001D953
public static bool operator ==(pb_IntVec3 a, pb_IntVec3 b)
{
return a.Equals(b);
}
// Token: 0x06000273 RID: 627 RVA: 0x0001F55D File Offset: 0x0001D95D
public static bool operator !=(pb_IntVec3 a, pb_IntVec3 b)
{
return !(a == b);
}
// Token: 0x06000274 RID: 628 RVA: 0x0001F56C File Offset: 0x0001D96C
public bool Equals(pb_IntVec3 p)
{
return pb_IntVec3.round(this.x) == pb_IntVec3.round(p.x) && pb_IntVec3.round(this.y) == pb_IntVec3.round(p.y) && pb_IntVec3.round(this.z) == pb_IntVec3.round(p.z);
}
// Token: 0x06000275 RID: 629 RVA: 0x0001F5D0 File Offset: 0x0001D9D0
public bool Equals(Vector3 p)
{
return pb_IntVec3.round(this.x) == pb_IntVec3.round(p.x) && pb_IntVec3.round(this.y) == pb_IntVec3.round(p.y) && pb_IntVec3.round(this.z) == pb_IntVec3.round(p.z);
}
// Token: 0x06000276 RID: 630 RVA: 0x0001F631 File Offset: 0x0001DA31
public override bool Equals(object b)
{
return (b is pb_IntVec3 && this.Equals((pb_IntVec3)b)) || (b is Vector3 && this.Equals((Vector3)b));
}
// Token: 0x06000277 RID: 631 RVA: 0x0001F66C File Offset: 0x0001DA6C
public override int GetHashCode()
{
return pb_Vector.GetHashCode(this.vec);
}
// Token: 0x06000278 RID: 632 RVA: 0x0001F679 File Offset: 0x0001DA79
private static int round(float v)
{
return Convert.ToInt32(v * 1000f);
}
// Token: 0x06000279 RID: 633 RVA: 0x0001F687 File Offset: 0x0001DA87
public static implicit operator Vector3(pb_IntVec3 p)
{
return p.vec;
}
// Token: 0x0600027A RID: 634 RVA: 0x0001F690 File Offset: 0x0001DA90
public static implicit operator pb_IntVec3(Vector3 p)
{
return new pb_IntVec3(p);
}
// Token: 0x040001BD RID: 445
public Vector3 vec;
// Token: 0x040001BE RID: 446
public const float RESOLUTION = 1000f;
}
}
+133
View File
@@ -0,0 +1,133 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x0200002C RID: 44
[ExecuteInEditMode]
[AddComponentMenu("")]
public class pb_LineRenderer : pb_MonoBehaviourSingleton<pb_LineRenderer>
{
// Token: 0x060000EE RID: 238 RVA: 0x00011558 File Offset: 0x0000F958
private static Mesh MeshConstructor()
{
return new Mesh
{
hideFlags = pb_Constant.EDITOR_OBJECT_HIDE_FLAGS,
name = "pb_LineRenderer::Mesh"
};
}
// Token: 0x060000EF RID: 239 RVA: 0x00011582 File Offset: 0x0000F982
public override void OnEnable()
{
base.OnEnable();
this.pool = new pb_ObjectPool<Mesh>(1, 8, new Func<Mesh>(pb_LineRenderer.MeshConstructor), null);
}
// Token: 0x060000F0 RID: 240 RVA: 0x000115B5 File Offset: 0x0000F9B5
private void OnDisable()
{
this.pool.Empty();
}
// Token: 0x060000F1 RID: 241 RVA: 0x000115C4 File Offset: 0x0000F9C4
public override void Awake()
{
base.Awake();
base.gameObject.hideFlags = HideFlags.HideAndDontSave;
this.mat = new Material(Shader.Find("ProBuilder/UnlitVertexColor"));
this.mat.name = "pb_LineRenderer_Material";
this.mat.SetColor("_Color", Color.white);
this.mat.hideFlags = pb_Constant.EDITOR_OBJECT_HIDE_FLAGS;
}
// Token: 0x060000F2 RID: 242 RVA: 0x00011630 File Offset: 0x0000FA30
private void OnDestroy()
{
foreach (Mesh mesh in this.gizmos)
{
if (mesh != null)
{
global::UnityEngine.Object.DestroyImmediate(mesh);
}
}
global::UnityEngine.Object.DestroyImmediate(this.mat);
}
// Token: 0x060000F3 RID: 243 RVA: 0x000116A4 File Offset: 0x0000FAA4
public void AddLineSegments(Vector3[] segments, Color[] colors)
{
if (this.pool == null)
{
this.pool = new pb_ObjectPool<Mesh>(1, 4, new Func<Mesh>(pb_LineRenderer.MeshConstructor), null);
}
Mesh mesh = this.pool.Get();
mesh.Clear();
mesh.name = "pb_LineRenderer::Mesh_" + mesh.GetInstanceID();
mesh.MarkDynamic();
int num = segments.Length;
int num2 = colors.Length;
mesh.vertices = segments;
int[] array = new int[num];
Color[] array2 = new Color[num];
int num3 = 0;
for (int i = 0; i < num; i++)
{
array[i] = i;
array2[i] = colors[num3 % num2];
if (i % 2 == 1)
{
num3++;
}
}
mesh.subMeshCount = 1;
mesh.SetIndices(array, MeshTopology.Lines, 0);
mesh.uv = new Vector2[mesh.vertexCount];
mesh.colors = array2;
mesh.hideFlags = pb_Constant.EDITOR_OBJECT_HIDE_FLAGS;
this.gizmos.Add(mesh);
}
// Token: 0x060000F4 RID: 244 RVA: 0x000117C4 File Offset: 0x0000FBC4
public void Clear()
{
for (int i = 0; i < this.gizmos.Count; i++)
{
this.pool.Put(this.gizmos[i]);
}
this.gizmos.Clear();
}
// Token: 0x060000F5 RID: 245 RVA: 0x00011810 File Offset: 0x0000FC10
private void OnRenderObject()
{
if (this.mat == null || (Camera.current.gameObject.hideFlags & this.SceneCameraHideFlags) != this.SceneCameraHideFlags || Camera.current.name != "SceneCamera")
{
return;
}
this.mat.SetPass(0);
int num = 0;
while (num < this.gizmos.Count && this.gizmos[num] != null)
{
Graphics.DrawMeshNow(this.gizmos[num], Vector3.zero, Quaternion.identity, 0);
num++;
}
}
// Token: 0x04000112 RID: 274
private HideFlags SceneCameraHideFlags = HideFlags.HideInHierarchy | HideFlags.DontSaveInEditor | HideFlags.NotEditable;
// Token: 0x04000113 RID: 275
private pb_ObjectPool<Mesh> pool;
// Token: 0x04000114 RID: 276
[HideInInspector]
public List<Mesh> gizmos = new List<Mesh>();
// Token: 0x04000115 RID: 277
[HideInInspector]
public Material mat;
}
}
+188
View File
@@ -0,0 +1,188 @@
using System;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x0200002F RID: 47
public static class pb_Log
{
// Token: 0x060000F6 RID: 246 RVA: 0x000118C5 File Offset: 0x0000FCC5
public static void PushLogLevel(pb_LogLevel level)
{
pb_Log.m_logStack.Push(pb_Log.m_LogLevel);
pb_Log.m_LogLevel = level;
}
// Token: 0x060000F7 RID: 247 RVA: 0x000118DC File Offset: 0x0000FCDC
public static void PopLogLevel()
{
pb_Log.m_LogLevel = pb_Log.m_logStack.Pop();
}
// Token: 0x060000F8 RID: 248 RVA: 0x000118ED File Offset: 0x0000FCED
public static void SetOutput(pb_LogOutput output)
{
pb_Log.m_Output = output;
}
// Token: 0x060000F9 RID: 249 RVA: 0x000118F5 File Offset: 0x0000FCF5
public static void SetLogFile(string path)
{
pb_Log.m_LogFilePath = path;
}
// Token: 0x060000FA RID: 250 RVA: 0x000118FD File Offset: 0x0000FCFD
public static void Debug<T>(T value)
{
pb_Log.Debug(value.ToString());
}
// Token: 0x060000FB RID: 251 RVA: 0x00011911 File Offset: 0x0000FD11
public static void Debug(string message)
{
pb_Log.DoPrint(message, LogType.Log);
}
// Token: 0x060000FC RID: 252 RVA: 0x0001191A File Offset: 0x0000FD1A
public static void Debug(string format, params object[] values)
{
pb_Log.Debug(string.Format(format, values));
}
// Token: 0x060000FD RID: 253 RVA: 0x00011928 File Offset: 0x0000FD28
public static void Info(string format, params object[] values)
{
pb_Log.Info(string.Format(format, values));
}
// Token: 0x060000FE RID: 254 RVA: 0x00011936 File Offset: 0x0000FD36
public static void Info(string message)
{
if ((pb_Log.m_LogLevel & pb_LogLevel.Info) > pb_LogLevel.None)
{
pb_Log.DoPrint(message, LogType.Log);
}
}
// Token: 0x060000FF RID: 255 RVA: 0x0001194C File Offset: 0x0000FD4C
public static void Warning(string format, params object[] values)
{
pb_Log.Warning(string.Format(format, values));
}
// Token: 0x06000100 RID: 256 RVA: 0x0001195A File Offset: 0x0000FD5A
public static void Warning(string message)
{
if ((pb_Log.m_LogLevel & pb_LogLevel.Warning) > pb_LogLevel.None)
{
pb_Log.DoPrint(message, LogType.Warning);
}
}
// Token: 0x06000101 RID: 257 RVA: 0x00011970 File Offset: 0x0000FD70
public static void Error(string format, params object[] values)
{
pb_Log.Error(string.Format(format, values));
}
// Token: 0x06000102 RID: 258 RVA: 0x0001197E File Offset: 0x0000FD7E
public static void Error(string message)
{
if ((pb_Log.m_LogLevel & pb_LogLevel.Error) > pb_LogLevel.None)
{
pb_Log.DoPrint(message, LogType.Error);
}
}
// Token: 0x06000103 RID: 259 RVA: 0x00011994 File Offset: 0x0000FD94
public static void Watch<T, K>(T key, K value)
{
global::UnityEngine.Debug.Log(string.Format("{0} : {1}\nCPAPI:{{\"cmd\":\"Watch\" \"name\":\"{0}\"}}", key.ToString(), value.ToString()));
}
// Token: 0x06000104 RID: 260 RVA: 0x000119BF File Offset: 0x0000FDBF
private static void DoPrint(string message, LogType type)
{
if ((pb_Log.m_Output & pb_LogOutput.Console) > pb_LogOutput.None)
{
pb_Log.PrintToConsole(message, type);
}
if ((pb_Log.m_Output & pb_LogOutput.File) > pb_LogOutput.None)
{
pb_Log.PrintToFile(message, pb_Log.m_LogFilePath);
}
}
// Token: 0x06000105 RID: 261 RVA: 0x000119F0 File Offset: 0x0000FDF0
public static void PrintToFile(string message, string path)
{
if (string.IsNullOrEmpty(path))
{
return;
}
string fullPath = Path.GetFullPath(path);
if (string.IsNullOrEmpty(fullPath))
{
pb_Log.PrintToConsole("m_LogFilePath bad: " + fullPath, LogType.Log);
return;
}
if (!File.Exists(fullPath))
{
string directoryName = Path.GetDirectoryName(fullPath);
if (string.IsNullOrEmpty(directoryName))
{
pb_Log.PrintToConsole("m_LogFilePath bad: " + fullPath, LogType.Log);
return;
}
Directory.CreateDirectory(directoryName);
using (StreamWriter streamWriter = File.CreateText(fullPath))
{
streamWriter.WriteLine(message);
}
}
else
{
using (StreamWriter streamWriter2 = File.AppendText(fullPath))
{
streamWriter2.WriteLine();
streamWriter2.WriteLine(message);
}
}
}
// Token: 0x06000106 RID: 262 RVA: 0x00011ACC File Offset: 0x0000FECC
public static void PrintToConsole(string message, LogType type = LogType.Log)
{
if (type == LogType.Log)
{
global::UnityEngine.Debug.Log(message);
}
else if (type == LogType.Warning)
{
global::UnityEngine.Debug.LogWarning(message);
}
else if (type == LogType.Error)
{
global::UnityEngine.Debug.LogError(message);
}
else if (type != LogType.Assert)
{
global::UnityEngine.Debug.Log(message);
}
}
// Token: 0x04000122 RID: 290
private static Stack<pb_LogLevel> m_logStack = new Stack<pb_LogLevel>();
// Token: 0x04000123 RID: 291
private static pb_LogLevel m_LogLevel = pb_LogLevel.All;
// Token: 0x04000124 RID: 292
private static pb_LogOutput m_Output = pb_LogOutput.Console;
// Token: 0x04000125 RID: 293
private static string m_LogFilePath = "ProBuilderLog.txt";
}
}
+19
View File
@@ -0,0 +1,19 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x0200002D RID: 45
public enum pb_LogLevel
{
// Token: 0x04000119 RID: 281
None,
// Token: 0x0400011A RID: 282
Error,
// Token: 0x0400011B RID: 283
Warning,
// Token: 0x0400011C RID: 284
Info = 4,
// Token: 0x0400011D RID: 285
All = 255
}
}
+16
View File
@@ -0,0 +1,16 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x0200002E RID: 46
[Flags]
public enum pb_LogOutput
{
// Token: 0x0400011F RID: 287
None = 0,
// Token: 0x04000120 RID: 288
Console = 1,
// Token: 0x04000121 RID: 289
File = 2
}
}
+924
View File
@@ -0,0 +1,924 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000030 RID: 48
public static class pb_Math
{
// Token: 0x06000108 RID: 264 RVA: 0x00011B48 File Offset: 0x0000FF48
public static Vector2 PointInCircumference(float radius, float angleInDegrees, Vector2 origin)
{
float num = radius * Mathf.Cos(0.017453292f * angleInDegrees) + origin.x;
float num2 = radius * Mathf.Sin(0.017453292f * angleInDegrees) + origin.y;
return new Vector2(num, num2);
}
// Token: 0x06000109 RID: 265 RVA: 0x00011B8C File Offset: 0x0000FF8C
public static Vector3 PointInSphere(float radius, float latitudeAngle, float longitudeAngle)
{
float num = radius * Mathf.Cos(0.017453292f * latitudeAngle) * Mathf.Sin(0.017453292f * longitudeAngle);
float num2 = radius * Mathf.Sin(0.017453292f * latitudeAngle) * Mathf.Sin(0.017453292f * longitudeAngle);
float num3 = radius * Mathf.Cos(0.017453292f * longitudeAngle);
return new Vector3(num, num2, num3);
}
// Token: 0x0600010A RID: 266 RVA: 0x00011BEC File Offset: 0x0000FFEC
public static float SignedAngle(Vector2 a, Vector2 b)
{
float num = Vector2.Angle(a, b);
if (b.x - a.x < 0f)
{
num = 360f - num;
}
return num;
}
// Token: 0x0600010B RID: 267 RVA: 0x00011C24 File Offset: 0x00010024
private static float SqrDistance(Vector3 a, Vector3 b)
{
float num = b.x - a.x;
float num2 = b.y - a.y;
float num3 = b.z - a.z;
return num * num + num2 * num2 + num3 * num3;
}
// Token: 0x0600010C RID: 268 RVA: 0x00011C6C File Offset: 0x0001006C
public static float TriangleArea(Vector3 x, Vector3 y, Vector3 z)
{
float num = pb_Math.SqrDistance(x, y);
float num2 = pb_Math.SqrDistance(y, z);
float num3 = pb_Math.SqrDistance(z, x);
return Mathf.Sqrt((2f * num * num2 + 2f * num2 * num3 + 2f * num3 * num - num * num - num2 * num2 - num3 * num3) / 16f);
}
// Token: 0x0600010D RID: 269 RVA: 0x00011CC8 File Offset: 0x000100C8
public static float PolygonArea(Vector3[] vertices, int[] indices)
{
float num = 0f;
for (int i = 0; i < indices.Length; i += 3)
{
num += pb_Math.TriangleArea(vertices[indices[i]], vertices[indices[i + 1]], vertices[indices[i + 2]]);
}
return num;
}
// Token: 0x0600010E RID: 270 RVA: 0x00011D28 File Offset: 0x00010128
public static Vector2 RotateAroundPoint(this Vector2 v, Vector2 origin, float theta)
{
float x = origin.x;
float y = origin.y;
float num = v.x;
float num2 = v.y;
float num3 = Mathf.Sin(theta * 0.017453292f);
float num4 = Mathf.Cos(theta * 0.017453292f);
num -= x;
num2 -= y;
float num5 = num * num4 + num2 * num3;
float num6 = -num * num3 + num2 * num4;
num = num5 + x;
num2 = num6 + y;
return new Vector2(num, num2);
}
// Token: 0x0600010F RID: 271 RVA: 0x00011DA4 File Offset: 0x000101A4
public static Vector2 ScaleAroundPoint(this Vector2 v, Vector2 origin, Vector2 scale)
{
Vector2 vector = v - origin;
vector = Vector2.Scale(vector, scale);
return vector + origin;
}
// Token: 0x06000110 RID: 272 RVA: 0x00011DCC File Offset: 0x000101CC
public static Vector2 Perpendicular(Vector2 a, Vector2 b)
{
float x = a.x;
float y = a.y;
float x2 = b.x;
float y2 = b.y;
Vector2 vector = new Vector2(-(y2 - y), x2 - x);
return vector.normalized;
}
// Token: 0x06000111 RID: 273 RVA: 0x00011E10 File Offset: 0x00010210
public static Vector2 Perpendicular(Vector2 a)
{
Vector2 vector = new Vector2(-a.y, a.x);
return vector.normalized;
}
// Token: 0x06000112 RID: 274 RVA: 0x00011E3C File Offset: 0x0001023C
public static Vector2 ReflectPoint(Vector2 point, Vector2 a, Vector2 b)
{
Vector2 vector = b - a;
Vector2 vector2 = new Vector2(-vector.y, vector.x);
float num = Mathf.Sin(Vector2.Angle(vector, point - a) * 0.017453292f) * Vector2.Distance(point, a);
return point + vector2 * (num * 2f) * ((Vector2.Dot(point - a, vector2) <= 0f) ? 1f : (-1f));
}
// Token: 0x06000113 RID: 275 RVA: 0x00011EC8 File Offset: 0x000102C8
public static float DistancePointLineSegment(Vector2 p, Vector2 v, Vector2 w)
{
float num = (v.x - w.x) * (v.x - w.x) + (v.y - w.y) * (v.y - w.y);
if (num == 0f)
{
return Vector2.Distance(p, v);
}
float num2 = Vector2.Dot(p - v, w - v) / num;
if ((double)num2 < 0.0)
{
return Vector2.Distance(p, v);
}
if ((double)num2 > 1.0)
{
return Vector2.Distance(p, w);
}
Vector2 vector = v + num2 * (w - v);
return Vector2.Distance(p, vector);
}
// Token: 0x06000114 RID: 276 RVA: 0x00011F8C File Offset: 0x0001038C
public static float DistancePointLineSegment(Vector3 p, Vector3 v, Vector3 w)
{
float num = (v.x - w.x) * (v.x - w.x) + (v.y - w.y) * (v.y - w.y) + (v.z - w.z) * (v.z - w.z);
if (num == 0f)
{
return Vector3.Distance(p, v);
}
float num2 = Vector3.Dot(p - v, w - v) / num;
if ((double)num2 < 0.0)
{
return Vector3.Distance(p, v);
}
if ((double)num2 > 1.0)
{
return Vector3.Distance(p, w);
}
Vector3 vector = v + num2 * (w - v);
return Vector3.Distance(p, vector);
}
// Token: 0x06000115 RID: 277 RVA: 0x00012070 File Offset: 0x00010470
public static Vector3 GetNearestPointRayRay(Vector3 ao, Vector3 ad, Vector3 bo, Vector3 bd)
{
if (ad == bd)
{
return ao;
}
Vector3 vector = bo - ao;
float num = -Vector3.Dot(ad, bd) * Vector3.Dot(bd, vector) + Vector3.Dot(ad, vector) * Vector3.Dot(bd, bd);
float num2 = Vector3.Dot(ad, ad) * Vector3.Dot(bd, bd) - Vector3.Dot(ad, bd) * Vector3.Dot(ad, bd);
return ao + ad * (num / num2);
}
// Token: 0x06000116 RID: 278 RVA: 0x000120E4 File Offset: 0x000104E4
public static bool GetLineSegmentIntersect(Vector2 p0, Vector2 p1, Vector2 p2, Vector2 p3, ref Vector2 intersect)
{
intersect = Vector2.zero;
Vector2 vector;
vector.x = p1.x - p0.x;
vector.y = p1.y - p0.y;
Vector2 vector2;
vector2.x = p3.x - p2.x;
vector2.y = p3.y - p2.y;
float num = (-vector.y * (p0.x - p2.x) + vector.x * (p0.y - p2.y)) / (-vector2.x * vector.y + vector.x * vector2.y);
float num2 = (vector2.x * (p0.y - p2.y) - vector2.y * (p0.x - p2.x)) / (-vector2.x * vector.y + vector.x * vector2.y);
if (num >= 0f && num <= 1f && num2 >= 0f && num2 <= 1f)
{
intersect.x = p0.x + num2 * vector.x;
intersect.y = p0.y + num2 * vector.y;
return true;
}
return false;
}
// Token: 0x06000117 RID: 279 RVA: 0x00012258 File Offset: 0x00010658
public static bool GetLineSegmentIntersect(Vector2 p0, Vector2 p1, Vector2 p2, Vector2 p3)
{
Vector2 vector;
vector.x = p1.x - p0.x;
vector.y = p1.y - p0.y;
Vector2 vector2;
vector2.x = p3.x - p2.x;
vector2.y = p3.y - p2.y;
float num = (-vector.y * (p0.x - p2.x) + vector.x * (p0.y - p2.y)) / (-vector2.x * vector.y + vector.x * vector2.y);
float num2 = (vector2.x * (p0.y - p2.y) - vector2.y * (p0.x - p2.x)) / (-vector2.x * vector.y + vector.x * vector2.y);
return num >= 0f && num <= 1f && num2 >= 0f && num2 <= 1f;
}
// Token: 0x06000118 RID: 280 RVA: 0x00012390 File Offset: 0x00010790
public static bool PointInPolygon(Vector2[] polygon, Vector2 point, int[] indices = null)
{
int num = ((indices == null) ? polygon.Length : indices.Length);
if (num % 2 != 0)
{
Debug.LogError("PointInPolygon requires polygon indices be divisible by 2!");
return false;
}
pb_Bounds2D pb_Bounds2D = new pb_Bounds2D(polygon, indices);
if (pb_Bounds2D.ContainsPoint(point))
{
Vector2 vector = pb_Bounds2D.center + Vector2.up * (pb_Bounds2D.size.y + 2f);
int num2 = 0;
for (int i = 0; i < num; i += 2)
{
int num3 = ((indices == null) ? i : indices[i]);
int num4 = ((indices == null) ? (i + 1) : indices[i + 1]);
if (pb_Math.GetLineSegmentIntersect(vector, point, polygon[num3], polygon[num4]))
{
num2++;
}
}
return num2 % 2 != 0;
}
return false;
}
// Token: 0x06000119 RID: 281 RVA: 0x0001247C File Offset: 0x0001087C
public static bool PointInPolygon(Vector2[] polygon, pb_Bounds2D polyBounds, pb_Edge[] edges, Vector2 point)
{
int num = edges.Length * 2;
Vector2 vector = polyBounds.center + Vector2.up * (polyBounds.size.y + 2f);
int num2 = 0;
for (int i = 0; i < num; i += 2)
{
if (pb_Math.GetLineSegmentIntersect(vector, point, polygon[i], polygon[i + 1]))
{
num2++;
}
}
return num2 % 2 != 0;
}
// Token: 0x0600011A RID: 282 RVA: 0x00012508 File Offset: 0x00010908
public static bool RectIntersectsLineSegment(Rect rect, Vector2 a, Vector2 b)
{
Vector2 vector = new Vector2(rect.xMin, rect.yMax);
Vector2 vector2 = new Vector2(rect.xMax, rect.yMax);
Vector2 vector3 = new Vector2(rect.xMin, rect.yMin);
Vector2 vector4 = new Vector2(rect.xMax, rect.yMin);
return pb_Math.GetLineSegmentIntersect(vector2, vector, a, b) || pb_Math.GetLineSegmentIntersect(vector, vector3, a, b) || pb_Math.GetLineSegmentIntersect(vector3, vector4, a, b) || pb_Math.GetLineSegmentIntersect(vector4, vector, a, b);
}
// Token: 0x0600011B RID: 283 RVA: 0x000125A0 File Offset: 0x000109A0
public static bool RayIntersectsTriangle(Ray InRay, Vector3 InTriangleA, Vector3 InTriangleB, Vector3 InTriangleC, out float OutDistance, out Vector3 OutPoint)
{
OutDistance = 0f;
OutPoint = Vector3.zero;
Vector3 vector = InTriangleB - InTriangleA;
Vector3 vector2 = InTriangleC - InTriangleA;
Vector3 vector3 = Vector3.Cross(InRay.direction, vector2);
float num = Vector3.Dot(vector, vector3);
if (num > -Mathf.Epsilon && num < Mathf.Epsilon)
{
return false;
}
float num2 = 1f / num;
Vector3 vector4 = InRay.origin - InTriangleA;
float num3 = Vector3.Dot(vector4, vector3) * num2;
if (num3 < 0f || num3 > 1f)
{
return false;
}
Vector3 vector5 = Vector3.Cross(vector4, vector);
float num4 = Vector3.Dot(InRay.direction, vector5) * num2;
if (num4 < 0f || num3 + num4 > 1f)
{
return false;
}
float num5 = Vector3.Dot(vector2, vector5) * num2;
if (num5 > Mathf.Epsilon)
{
OutDistance = num5;
OutPoint.x = num3 * InTriangleB.x + num4 * InTriangleC.x + (1f - (num3 + num4)) * InTriangleA.x;
OutPoint.y = num3 * InTriangleB.y + num4 * InTriangleC.y + (1f - (num3 + num4)) * InTriangleA.y;
OutPoint.z = num3 * InTriangleB.z + num4 * InTriangleC.z + (1f - (num3 + num4)) * InTriangleA.z;
return true;
}
return false;
}
// Token: 0x0600011C RID: 284 RVA: 0x0001272C File Offset: 0x00010B2C
public static bool RayIntersectsTriangle2(Vector3 origin, Vector3 dir, Vector3 vert0, Vector3 vert1, Vector3 vert2, ref float distance, ref Vector3 normal)
{
pb_Math.Subtract(vert0, vert1, ref pb_Math.tv1);
pb_Math.Subtract(vert0, vert2, ref pb_Math.tv2);
pb_Math.Cross(dir, pb_Math.tv2, ref pb_Math.tv4);
float num = Vector3.Dot(pb_Math.tv1, pb_Math.tv4);
if (num < Mathf.Epsilon)
{
return false;
}
pb_Math.Subtract(vert0, origin, ref pb_Math.tv3);
float num2 = Vector3.Dot(pb_Math.tv3, pb_Math.tv4);
if (num2 < 0f || num2 > num)
{
return false;
}
pb_Math.Cross(pb_Math.tv3, pb_Math.tv1, ref pb_Math.tv4);
float num3 = Vector3.Dot(dir, pb_Math.tv4);
if (num3 < 0f || num2 + num3 > num)
{
return false;
}
distance = Vector3.Dot(pb_Math.tv2, pb_Math.tv4) * (1f / num);
pb_Math.Cross(pb_Math.tv1, pb_Math.tv2, ref normal);
return true;
}
// Token: 0x0600011D RID: 285 RVA: 0x00012811 File Offset: 0x00010C11
public static float Secant(float x)
{
return 1f / Mathf.Cos(x);
}
// Token: 0x0600011E RID: 286 RVA: 0x00012820 File Offset: 0x00010C20
public static Vector3 Normal(Vector3 p0, Vector3 p1, Vector3 p2)
{
float num = p1.x - p0.x;
float num2 = p1.y - p0.y;
float num3 = p1.z - p0.z;
float num4 = p2.x - p0.x;
float num5 = p2.y - p0.y;
float num6 = p2.z - p0.z;
Vector3 zero = Vector3.zero;
pb_Math.Cross(num, num2, num3, num4, num5, num6, ref zero.x, ref zero.y, ref zero.z);
if (zero.magnitude < Mathf.Epsilon)
{
return new Vector3(0f, 0f, 0f);
}
zero.Normalize();
return zero;
}
// Token: 0x0600011F RID: 287 RVA: 0x000128E8 File Offset: 0x00010CE8
public static Vector3 Normal(IList<pb_Vertex> vertices, IList<int> indices = null)
{
if (indices == null || indices.Count % 3 != 0)
{
Vector3 vector = Vector3.Cross(vertices[1].position - vertices[0].position, vertices[2].position - vertices[0].position);
vector.Normalize();
return vector;
}
int count = indices.Count;
Vector3 vector2 = Vector3.zero;
for (int i = 0; i < count; i += 3)
{
vector2 += pb_Math.Normal(vertices[indices[i]].position, vertices[indices[i + 1]].position, vertices[indices[i + 2]].position);
}
vector2 /= (float)count / 3f;
vector2.Normalize();
return vector2;
}
// Token: 0x06000120 RID: 288 RVA: 0x000129D0 File Offset: 0x00010DD0
public static Vector3 Normal(pb_Object pb, pb_Face face)
{
Vector3[] vertices = pb.vertices;
Vector3 vector = pb_Math.Normal(vertices[face.indices[0]], vertices[face.indices[1]], vertices[face.indices[2]]);
if (face.indices.Length > 7)
{
Vector3 normal = pb_Projection.FindBestPlane(vertices, face.distinctIndices).normal;
if (Vector3.Dot(vector, normal) < 0f)
{
vector.x = -normal.x;
vector.y = -normal.y;
vector.z = -normal.z;
}
else
{
vector.x = normal.x;
vector.y = normal.y;
vector.z = normal.z;
}
}
return vector;
}
// Token: 0x06000121 RID: 289 RVA: 0x00012AB4 File Offset: 0x00010EB4
public static Vector3 Normal(IList<Vector3> p)
{
if (p == null || p.Count < 3)
{
return Vector3.zero;
}
int count = p.Count;
if (count % 3 == 0)
{
Vector3 vector = Vector3.zero;
for (int i = 0; i < count; i += 3)
{
vector += pb_Math.Normal(p[i], p[i + 1], p[i + 2]);
}
vector /= (float)count / 3f;
vector.Normalize();
return vector;
}
Vector3 vector2 = Vector3.Cross(p[1] - p[0], p[2] - p[0]);
if (vector2.magnitude < Mathf.Epsilon)
{
return new Vector3(0f, 0f, 0f);
}
return vector2.normalized;
}
// Token: 0x06000122 RID: 290 RVA: 0x00012B98 File Offset: 0x00010F98
public static void NormalTangentBitangent(pb_Object pb, pb_Face face, out Vector3 normal, out Vector3 tangent, out Vector3 bitangent)
{
if (face.indices.Length < 3)
{
Debug.LogWarning("Cannot find normal / tangent / bitangent for face with < 3 indices.");
normal = Vector3.zero;
tangent = Vector3.zero;
bitangent = Vector3.zero;
return;
}
normal = pb_Math.Normal(pb, face);
Vector3 vector = Vector3.zero;
Vector3 vector2 = Vector3.zero;
Vector4 vector3 = new Vector4(0f, 0f, 0f, 1f);
long num = (long)face.indices[0];
long num2 = (long)face.indices[1];
long num3 = (long)face.indices[2];
Vector3 vector4;
Vector3 vector5;
Vector3 vector6;
Vector2 vector7;
Vector2 vector8;
Vector2 vector9;
checked
{
vector4 = pb.vertices[(int)((IntPtr)num)];
vector5 = pb.vertices[(int)((IntPtr)num2)];
vector6 = pb.vertices[(int)((IntPtr)num3)];
vector7 = pb.uv[(int)((IntPtr)num)];
vector8 = pb.uv[(int)((IntPtr)num2)];
vector9 = pb.uv[(int)((IntPtr)num3)];
}
float num4 = vector5.x - vector4.x;
float num5 = vector6.x - vector4.x;
float num6 = vector5.y - vector4.y;
float num7 = vector6.y - vector4.y;
float num8 = vector5.z - vector4.z;
float num9 = vector6.z - vector4.z;
float num10 = vector8.x - vector7.x;
float num11 = vector9.x - vector7.x;
float num12 = vector8.y - vector7.y;
float num13 = vector9.y - vector7.y;
float num14 = 1f / (num10 * num13 - num11 * num12);
Vector3 vector10 = new Vector3((num13 * num4 - num12 * num5) * num14, (num13 * num6 - num12 * num7) * num14, (num13 * num8 - num12 * num9) * num14);
Vector3 vector11 = new Vector3((num10 * num5 - num11 * num4) * num14, (num10 * num7 - num11 * num6) * num14, (num10 * num9 - num11 * num8) * num14);
vector += vector10;
vector2 += vector11;
Vector3 vector12 = normal;
Vector3.OrthoNormalize(ref vector12, ref vector);
vector3.x = vector.x;
vector3.y = vector.y;
vector3.z = vector.z;
vector3.w = ((Vector3.Dot(Vector3.Cross(vector12, vector), vector2) >= 0f) ? 1f : (-1f));
tangent = vector3 * vector3.w;
bitangent = Vector3.Cross(normal, tangent);
}
// Token: 0x06000123 RID: 291 RVA: 0x00012E7C File Offset: 0x0001127C
public static bool IsCardinalAxis(Vector3 v, float epsilon = 1E-05f)
{
v.Normalize();
return 1f - Mathf.Abs(Vector3.Dot(Vector3.up, v)) < epsilon || 1f - Mathf.Abs(Vector3.Dot(Vector3.forward, v)) < epsilon || 1f - Mathf.Abs(Vector3.Dot(Vector3.right, v)) < epsilon;
}
// Token: 0x06000124 RID: 292 RVA: 0x00012EE4 File Offset: 0x000112E4
public static T Max<T>(T[] array) where T : IComparable<T>
{
if (array == null || array.Length < 1)
{
return default(T);
}
T t = array[0];
for (int i = 1; i < array.Length; i++)
{
if (array[i].CompareTo(t) >= 0)
{
t = array[i];
}
}
return t;
}
// Token: 0x06000125 RID: 293 RVA: 0x00012F4C File Offset: 0x0001134C
public static T Min<T>(T[] array) where T : IComparable<T>
{
if (array == null || array.Length < 1)
{
return default(T);
}
T t = array[0];
for (int i = 1; i < array.Length; i++)
{
if (array[i].CompareTo(t) < 0)
{
t = array[i];
}
}
return t;
}
// Token: 0x06000126 RID: 294 RVA: 0x00012FB4 File Offset: 0x000113B4
public static float LargestValue(Vector3 v)
{
if (v.x > v.y && v.x > v.z)
{
return v.x;
}
if (v.y > v.x && v.y > v.z)
{
return v.y;
}
return v.z;
}
// Token: 0x06000127 RID: 295 RVA: 0x00013024 File Offset: 0x00011424
public static float LargestValue(Vector2 v)
{
return (v.x <= v.y) ? v.y : v.x;
}
// Token: 0x06000128 RID: 296 RVA: 0x0001304C File Offset: 0x0001144C
public static Vector2 SmallestVector2(Vector2[] v)
{
int num = v.Length;
Vector2 vector = v[0];
for (int i = 0; i < num; i++)
{
if (v[i].x < vector.x)
{
vector.x = v[i].x;
}
if (v[i].y < vector.y)
{
vector.y = v[i].y;
}
}
return vector;
}
// Token: 0x06000129 RID: 297 RVA: 0x000130D4 File Offset: 0x000114D4
public static Vector2 SmallestVector2(Vector2[] v, int[] indices)
{
int num = indices.Length;
Vector2 vector = v[indices[0]];
for (int i = 0; i < num; i++)
{
if (v[indices[i]].x < vector.x)
{
vector.x = v[indices[i]].x;
}
if (v[indices[i]].y < vector.y)
{
vector.y = v[indices[i]].y;
}
}
return vector;
}
// Token: 0x0600012A RID: 298 RVA: 0x00013168 File Offset: 0x00011568
public static Vector2 LargestVector2(Vector2[] v)
{
int num = v.Length;
Vector2 vector = v[0];
for (int i = 0; i < num; i++)
{
if (v[i].x > vector.x)
{
vector.x = v[i].x;
}
if (v[i].y > vector.y)
{
vector.y = v[i].y;
}
}
return vector;
}
// Token: 0x0600012B RID: 299 RVA: 0x000131F0 File Offset: 0x000115F0
public static Vector2 LargestVector2(Vector2[] v, int[] indices)
{
int num = indices.Length;
Vector2 vector = v[indices[0]];
for (int i = 0; i < num; i++)
{
if (v[indices[i]].x > vector.x)
{
vector.x = v[indices[i]].x;
}
if (v[indices[i]].y > vector.y)
{
vector.y = v[indices[i]].y;
}
}
return vector;
}
// Token: 0x0600012C RID: 300 RVA: 0x00013284 File Offset: 0x00011684
public static Vector3 BoundsCenter(Vector3[] verts)
{
if (verts.Length < 1)
{
return Vector3.zero;
}
Vector3 vector = verts[0];
Vector3 vector2 = vector;
for (int i = 1; i < verts.Length; i++)
{
vector.x = Mathf.Min(verts[i].x, vector.x);
vector2.x = Mathf.Max(verts[i].x, vector2.x);
vector.y = Mathf.Min(verts[i].y, vector.y);
vector2.y = Mathf.Max(verts[i].y, vector2.y);
vector.z = Mathf.Min(verts[i].z, vector.z);
vector2.z = Mathf.Max(verts[i].z, vector2.z);
}
return (vector + vector2) * 0.5f;
}
// Token: 0x0600012D RID: 301 RVA: 0x00013390 File Offset: 0x00011790
public static Vector2 Average(IList<Vector2> v, IList<int> indices = null)
{
Vector2 vector = Vector2.zero;
float num = (float)((indices != null) ? indices.Count : v.Count);
if (indices == null)
{
int num2 = 0;
while ((float)num2 < num)
{
vector += v[num2];
num2++;
}
}
else
{
int num3 = 0;
while ((float)num3 < num)
{
vector += v[indices[num3]];
num3++;
}
}
return vector / num;
}
// Token: 0x0600012E RID: 302 RVA: 0x00013418 File Offset: 0x00011818
public static Vector3 Average(IList<Vector3> v, IList<int> indices = null)
{
Vector3 zero = Vector3.zero;
float num = (float)((indices != null) ? indices.Count : v.Count);
if (indices == null)
{
int num2 = 0;
while ((float)num2 < num)
{
zero.x += v[num2].x;
zero.y += v[num2].y;
zero.z += v[num2].z;
num2++;
}
}
else
{
int num3 = 0;
while ((float)num3 < num)
{
zero.x += v[indices[num3]].x;
zero.y += v[indices[num3]].y;
zero.z += v[indices[num3]].z;
num3++;
}
}
return zero / num;
}
// Token: 0x0600012F RID: 303 RVA: 0x00013548 File Offset: 0x00011948
public static Vector3 Average<T>(this IList<T> v, Func<T, Vector3> selector, IList<int> indices = null)
{
Vector3 vector = Vector3.zero;
float num = (float)((indices != null) ? indices.Count : v.Count);
if (indices == null)
{
int num2 = 0;
while ((float)num2 < num)
{
vector += selector(v[num2]);
num2++;
}
}
else
{
int num3 = 0;
while ((float)num3 < num)
{
vector += selector(v[indices[num3]]);
num3++;
}
}
return vector / num;
}
// Token: 0x06000130 RID: 304 RVA: 0x000135DC File Offset: 0x000119DC
public static Vector4 Average(IList<Vector4> v, IList<int> indices = null)
{
Vector4 vector = Vector4.zero;
float num = (float)((indices != null) ? indices.Count : v.Count);
if (indices == null)
{
int num2 = 0;
while ((float)num2 < num)
{
vector += v[num2];
num2++;
}
}
else
{
int num3 = 0;
while ((float)num3 < num)
{
vector += v[indices[num3]];
num3++;
}
}
return vector / num;
}
// Token: 0x06000131 RID: 305 RVA: 0x00013664 File Offset: 0x00011A64
public static Color Average(IList<Color> c, IList<int> indices = null)
{
Color color = c[0];
float num = (float)((indices != null) ? indices.Count : c.Count);
if (indices == null)
{
int num2 = 1;
while ((float)num2 < num)
{
color += c[num2];
num2++;
}
}
else
{
int num3 = 1;
while ((float)num3 < num)
{
color += c[indices[num3]];
num3++;
}
}
return color / num;
}
// Token: 0x06000132 RID: 306 RVA: 0x000136EC File Offset: 0x00011AEC
public static bool Approx2(this Vector2 v, Vector2 b, float delta = 0.0001f)
{
return Mathf.Abs(v.x - b.x) < delta && Mathf.Abs(v.y - b.y) < delta;
}
// Token: 0x06000133 RID: 307 RVA: 0x00013724 File Offset: 0x00011B24
public static bool Approx3(this Vector3 v, Vector3 b, float delta = 0.0001f)
{
return Mathf.Abs(v.x - b.x) < delta && Mathf.Abs(v.y - b.y) < delta && Mathf.Abs(v.z - b.z) < delta;
}
// Token: 0x06000134 RID: 308 RVA: 0x00013780 File Offset: 0x00011B80
public static bool Approx4(this Vector4 v, Vector4 b, float delta = 0.0001f)
{
return Mathf.Abs(v.x - b.x) < delta && Mathf.Abs(v.y - b.y) < delta && Mathf.Abs(v.z - b.z) < delta && Mathf.Abs(v.w - b.w) < delta;
}
// Token: 0x06000135 RID: 309 RVA: 0x000137F8 File Offset: 0x00011BF8
public static bool ApproxC(this Color a, Color b, float delta = 0.0001f)
{
return Mathf.Abs(a.r - b.r) < delta && Mathf.Abs(a.g - b.g) < delta && Mathf.Abs(a.b - b.b) < delta && Mathf.Abs(a.a - b.a) < delta;
}
// Token: 0x06000136 RID: 310 RVA: 0x0001386D File Offset: 0x00011C6D
public static bool Approx(this float a, float b, float delta = 0.0001f)
{
return Mathf.Abs(b - a) < Mathf.Abs(delta);
}
// Token: 0x06000137 RID: 311 RVA: 0x00013880 File Offset: 0x00011C80
public static bool ContainsApprox(Vector3[] v, Vector3 p, float eps)
{
for (int i = 0; i < v.Length; i++)
{
if (v[i].Approx3(p, eps))
{
return true;
}
}
return false;
}
// Token: 0x06000138 RID: 312 RVA: 0x000138BC File Offset: 0x00011CBC
public static int Wrap(int value, int lowerBound, int upperBound)
{
int num = upperBound - lowerBound + 1;
if (value < lowerBound)
{
value += num * ((lowerBound - value) / num + 1);
}
return lowerBound + (value - lowerBound) % num;
}
// Token: 0x06000139 RID: 313 RVA: 0x000138EA File Offset: 0x00011CEA
public static int Clamp(int value, int lowerBound, int upperBound)
{
return (value >= lowerBound) ? ((value <= upperBound) ? value : upperBound) : lowerBound;
}
// Token: 0x0600013A RID: 314 RVA: 0x00013908 File Offset: 0x00011D08
public static Vector2 ToMask(this Vector2 vec, float delta = 1E-45f)
{
return new Vector2((Mathf.Abs(vec.x) <= delta) ? 0f : 1f, (Mathf.Abs(vec.y) <= delta) ? 0f : 1f);
}
// Token: 0x0600013B RID: 315 RVA: 0x0001395C File Offset: 0x00011D5C
public static Vector3 ToMask(this Vector3 vec, float delta = 1E-45f)
{
return new Vector3((Mathf.Abs(vec.x) <= delta) ? 0f : 1f, (Mathf.Abs(vec.y) <= delta) ? 0f : 1f, (Mathf.Abs(vec.z) <= delta) ? 0f : 1f);
}
// Token: 0x0600013C RID: 316 RVA: 0x000139D4 File Offset: 0x00011DD4
public static Vector3 ToSignedMask(this Vector3 vec, float delta = 1E-45f)
{
return new Vector3((Mathf.Abs(vec.x) <= delta) ? 0f : (vec.x / Mathf.Abs(vec.x)), (Mathf.Abs(vec.y) <= delta) ? 0f : (vec.y / Mathf.Abs(vec.y)), (Mathf.Abs(vec.z) <= delta) ? 0f : (vec.z / Mathf.Abs(vec.z)));
}
// Token: 0x0600013D RID: 317 RVA: 0x00013A76 File Offset: 0x00011E76
public static Vector3 Abs(this Vector3 v)
{
return new Vector3(Mathf.Abs(v.x), Mathf.Abs(v.y), Mathf.Abs(v.z));
}
// Token: 0x0600013E RID: 318 RVA: 0x00013AA1 File Offset: 0x00011EA1
public static int IntSum(this Vector3 mask)
{
return (int)Mathf.Abs(mask.x) + (int)Mathf.Abs(mask.y) + (int)Mathf.Abs(mask.z);
}
// Token: 0x0600013F RID: 319 RVA: 0x00013ACC File Offset: 0x00011ECC
public static void Cross(Vector3 a, Vector3 b, ref float x, ref float y, ref float z)
{
x = a.y * b.z - a.z * b.y;
y = a.z * b.x - a.x * b.z;
z = a.x * b.y - a.y * b.x;
}
// Token: 0x06000140 RID: 320 RVA: 0x00013B40 File Offset: 0x00011F40
public static void Cross(Vector3 a, Vector3 b, ref Vector3 res)
{
res.x = a.y * b.z - a.z * b.y;
res.y = a.z * b.x - a.x * b.z;
res.z = a.x * b.y - a.y * b.x;
}
// Token: 0x06000141 RID: 321 RVA: 0x00013BBC File Offset: 0x00011FBC
public static void Cross(float ax, float ay, float az, float bx, float by, float bz, ref float x, ref float y, ref float z)
{
x = ay * bz - az * by;
y = az * bx - ax * bz;
z = ax * by - ay * bx;
}
// Token: 0x06000142 RID: 322 RVA: 0x00013BE0 File Offset: 0x00011FE0
public static void Subtract(Vector3 a, Vector3 b, ref Vector3 res)
{
res.x = b.x - a.x;
res.y = b.y - a.y;
res.z = b.z - a.z;
}
// Token: 0x04000126 RID: 294
public const float PHI = 1.618034f;
// Token: 0x04000127 RID: 295
public const float FLT_EPSILON = 1E-45f;
// Token: 0x04000128 RID: 296
public const float FLT_COMPARE_EPSILON = 0.0001f;
// Token: 0x04000129 RID: 297
public const float HANDLE_EPSILON = 0.0001f;
// Token: 0x0400012A RID: 298
private static Vector3 tv1;
// Token: 0x0400012B RID: 299
private static Vector3 tv2;
// Token: 0x0400012C RID: 300
private static Vector3 tv3;
// Token: 0x0400012D RID: 301
private static Vector3 tv4;
}
}
+85
View File
@@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000031 RID: 49
[ExecuteInEditMode]
[AddComponentMenu("")]
public class pb_MeshRenderer : pb_MonoBehaviourSingleton<pb_MeshRenderer>
{
// Token: 0x06000144 RID: 324 RVA: 0x00013C47 File Offset: 0x00012047
private int clamp(int val, int min, int max)
{
return (val >= min) ? ((val <= max) ? val : max) : min;
}
// Token: 0x06000145 RID: 325 RVA: 0x00013C64 File Offset: 0x00012064
public static void Add(pb_Renderable renderable)
{
pb_MonoBehaviourSingleton<pb_MeshRenderer>.instance.m_Renderables.Add(renderable);
}
// Token: 0x06000146 RID: 326 RVA: 0x00013C77 File Offset: 0x00012077
public static void Remove(pb_Renderable renderable)
{
if (pb_MonoBehaviourSingleton<pb_MeshRenderer>.instance.m_Renderables.Contains(renderable))
{
pb_MonoBehaviourSingleton<pb_MeshRenderer>.instance.m_Renderables.Remove(renderable);
}
}
// Token: 0x06000147 RID: 327 RVA: 0x00013CA0 File Offset: 0x000120A0
private void OnRenderObject()
{
if ((Camera.current.gameObject.hideFlags & this.SceneCameraHideFlags) != this.SceneCameraHideFlags || Camera.current.name != "SceneCamera")
{
return;
}
foreach (pb_Renderable pb_Renderable in this.m_Renderables)
{
if (pb_Renderable.materials == null)
{
Debug.Log("renderable.materials == null -> " + base.name);
}
Material[] materials = pb_Renderable.materials;
if (pb_Renderable.mesh == null)
{
Debug.Log("renderable mesh is null");
}
else
{
for (int i = 0; i < pb_Renderable.mesh.subMeshCount; i++)
{
int num = this.clamp(i, 0, materials.Length - 1);
if (materials[num] == null || !materials[num].SetPass(0))
{
Debug.Log("material is null");
}
else
{
Graphics.DrawMeshNow(pb_Renderable.mesh, (!(pb_Renderable.transform != null)) ? Matrix4x4.identity : pb_Renderable.transform.localToWorldMatrix, i);
}
}
}
}
}
// Token: 0x06000148 RID: 328 RVA: 0x00013E08 File Offset: 0x00012208
private void OnDestroy()
{
foreach (pb_Renderable pb_Renderable in this.m_Renderables)
{
global::UnityEngine.Object.DestroyImmediate(pb_Renderable);
}
}
// Token: 0x0400012E RID: 302
[SerializeField]
private HashSet<pb_Renderable> m_Renderables = new HashSet<pb_Renderable>();
// Token: 0x0400012F RID: 303
private readonly HideFlags SceneCameraHideFlags = HideFlags.HideInHierarchy | HideFlags.DontSaveInEditor | HideFlags.NotEditable;
}
}
+430
View File
@@ -0,0 +1,430 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000032 RID: 50
public class pb_MeshUtility
{
// Token: 0x0600014A RID: 330 RVA: 0x00013E6C File Offset: 0x0001226C
public static string Print(Mesh m)
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.AppendLine(string.Format("vertices: {0}\ntriangles: {1}\nsubmeshes: {2}", m.vertexCount, m.triangles.Length, m.subMeshCount));
stringBuilder.AppendLine(string.Format(" {0,-28}{7,-16}{1,-28}{2,-28}{3,-28}{4,-28}{5,-28}{6,-28}", new object[] { "Positions", "Colors", "Tangents", "UV0", "UV2", "UV3", "UV4", "Position Hash" }));
Vector3[] array = m.vertices;
Color[] array2 = m.colors;
Vector4[] array3 = m.tangents;
List<Vector4> list = new List<Vector4>();
Vector2[] array4 = m.uv2;
List<Vector4> list2 = new List<Vector4>();
List<Vector4> list3 = new List<Vector4>();
m.GetUVs(0, list);
m.GetUVs(2, list2);
m.GetUVs(3, list3);
if (array != null && array.Count<Vector3>() != m.vertexCount)
{
array = null;
}
if (array2 != null && array2.Count<Color>() != m.vertexCount)
{
array2 = null;
}
if (array3 != null && array3.Count<Vector4>() != m.vertexCount)
{
array3 = null;
}
if (list != null && list.Count<Vector4>() != m.vertexCount)
{
list = null;
}
if (array4 != null && array4.Count<Vector2>() != m.vertexCount)
{
array4 = null;
}
if (list2 != null && list2.Count<Vector4>() != m.vertexCount)
{
list2 = null;
}
if (list3 != null && list3.Count<Vector4>() != m.vertexCount)
{
list3 = null;
}
for (int i = 0; i < m.vertexCount; i++)
{
stringBuilder.AppendLine(string.Format("{7,-5}{0,-28}{8,-16}{1,-28}{2,-28}{3,-28}{4,-28}{5,-28}{6,-28}", new object[]
{
(array != null) ? string.Format("{0:F3}, {1:F3}, {2:F3}", array[i].x, array[i].y, array[i].z) : "null",
(array2 != null) ? string.Format("{0:F2}, {1:F2}, {2:F2}, {3:F2}", new object[]
{
array2[i].r,
array2[i].g,
array2[i].b,
array2[i].a
}) : "null",
(array3 != null) ? string.Format("{0:F2}, {1:F2}, {2:F2}, {3:F2}", new object[]
{
array3[i].x,
array3[i].y,
array3[i].z,
array3[i].w
}) : "null",
(list != null) ? string.Format("{0:F2}, {1:F2}, {2:F2}, {3:F2}", new object[]
{
list[i].x,
list[i].y,
list[i].z,
list[i].w
}) : "null",
(array4 != null) ? string.Format("{0:F2}, {1:F2}", array4[i].x, array4[i].y) : "null",
(list2 != null) ? string.Format("{0:F2}, {1:F2}, {2:F2}, {3:F2}", new object[]
{
list2[i].x,
list2[i].y,
list2[i].z,
list2[i].w
}) : "null",
(list3 != null) ? string.Format("{0:F2}, {1:F2}, {2:F2}, {3:F2}", new object[]
{
list3[i].x,
list3[i].y,
list3[i].z,
list3[i].w
}) : "null",
i,
pb_Vector.GetHashCode(array[i])
}));
}
for (int j = 0; j < m.triangles.Length; j += 3)
{
stringBuilder.AppendLine(string.Format("{0}, {1}, {2}", m.triangles[j], m.triangles[j + 1], m.triangles[j + 2]));
}
return stringBuilder.ToString();
}
// Token: 0x0600014B RID: 331 RVA: 0x000143F4 File Offset: 0x000127F4
public static pb_Vertex[] GeneratePerTriangleMesh(Mesh m)
{
pb_Vertex[] vertices = pb_Vertex.GetVertices(m);
int subMeshCount = m.subMeshCount;
pb_Vertex[] array = new pb_Vertex[m.triangles.Length];
int[][] array2 = new int[subMeshCount][];
int num = 0;
for (int i = 0; i < subMeshCount; i++)
{
array2[i] = m.GetTriangles(i);
int num2 = array2[i].Length;
for (int j = 0; j < num2; j++)
{
array[num++] = new pb_Vertex(vertices[array2[i][j]]);
array2[i][j] = num - 1;
}
}
pb_Vertex.SetMesh(m, array);
m.subMeshCount = subMeshCount;
for (int k = 0; k < subMeshCount; k++)
{
m.SetTriangles(array2[k], k);
}
return array;
}
// Token: 0x0600014C RID: 332 RVA: 0x000144BC File Offset: 0x000128BC
public static void CollapseSharedVertices(Mesh m, pb_Vertex[] vertices = null)
{
if (vertices == null)
{
vertices = pb_Vertex.GetVertices(m);
}
int subMeshCount = m.subMeshCount;
List<Dictionary<pb_Vertex, int>> list = new List<Dictionary<pb_Vertex, int>>();
int[][] array = new int[subMeshCount][];
int num = 0;
for (int i = 0; i < subMeshCount; i++)
{
array[i] = m.GetTriangles(i);
Dictionary<pb_Vertex, int> dictionary = new Dictionary<pb_Vertex, int>();
for (int j = 0; j < array[i].Length; j++)
{
pb_Vertex pb_Vertex = vertices[array[i][j]];
int num2;
if (dictionary.TryGetValue(pb_Vertex, out num2))
{
array[i][j] = num2;
}
else
{
array[i][j] = num;
dictionary.Add(pb_Vertex, num);
num++;
}
}
list.Add(dictionary);
}
pb_Vertex[] array2 = list.SelectMany((Dictionary<pb_Vertex, int> x) => x.Keys).ToArray<pb_Vertex>();
pb_Vertex.SetMesh(m, array2);
m.subMeshCount = subMeshCount;
for (int k = 0; k < subMeshCount; k++)
{
m.SetTriangles(array[k], k);
}
}
// Token: 0x0600014D RID: 333 RVA: 0x000145D4 File Offset: 0x000129D4
public static void GenerateTangent(ref Mesh InMesh)
{
int[] triangles = InMesh.triangles;
Vector3[] vertices = InMesh.vertices;
Vector2[] uv = InMesh.uv;
Vector3[] normals = InMesh.normals;
int num = triangles.Length;
int num2 = vertices.Length;
Vector3[] array = new Vector3[num2];
Vector3[] array2 = new Vector3[num2];
Vector4[] array3 = new Vector4[num2];
for (long num3 = 0L; num3 < (long)num; num3 += 3L)
{
long num4 = (long)triangles[(int)(checked((IntPtr)num3))];
long num5 = (long)triangles[(int)(checked((IntPtr)(unchecked(num3 + 1L))))];
long num6 = (long)triangles[(int)(checked((IntPtr)(unchecked(num3 + 2L))))];
Vector3 vector;
Vector3 vector2;
Vector3 vector3;
Vector2 vector4;
Vector2 vector5;
Vector2 vector6;
checked
{
vector = vertices[(int)((IntPtr)num4)];
vector2 = vertices[(int)((IntPtr)num5)];
vector3 = vertices[(int)((IntPtr)num6)];
vector4 = uv[(int)((IntPtr)num4)];
vector5 = uv[(int)((IntPtr)num5)];
vector6 = uv[(int)((IntPtr)num6)];
}
float num7 = vector2.x - vector.x;
float num8 = vector3.x - vector.x;
float num9 = vector2.y - vector.y;
float num10 = vector3.y - vector.y;
float num11 = vector2.z - vector.z;
float num12 = vector3.z - vector.z;
float num13 = vector5.x - vector4.x;
float num14 = vector6.x - vector4.x;
float num15 = vector5.y - vector4.y;
float num16 = vector6.y - vector4.y;
float num17 = 1f / (num13 * num16 - num14 * num15);
Vector3 vector7 = new Vector3((num16 * num7 - num15 * num8) * num17, (num16 * num9 - num15 * num10) * num17, (num16 * num11 - num15 * num12) * num17);
Vector3 vector8 = new Vector3((num13 * num8 - num14 * num7) * num17, (num13 * num10 - num14 * num9) * num17, (num13 * num12 - num14 * num11) * num17);
checked
{
array[(int)((IntPtr)num4)] += vector7;
array[(int)((IntPtr)num5)] += vector7;
array[(int)((IntPtr)num6)] += vector7;
array2[(int)((IntPtr)num4)] += vector8;
array2[(int)((IntPtr)num5)] += vector8;
array2[(int)((IntPtr)num6)] += vector8;
}
}
for (long num18 = 0L; num18 < (long)num2; num18 += 1L)
{
checked
{
Vector3 vector9 = normals[(int)((IntPtr)num18)];
Vector3 vector10 = array[(int)((IntPtr)num18)];
Vector3.OrthoNormalize(ref vector9, ref vector10);
array3[(int)((IntPtr)num18)].x = vector10.x;
array3[(int)((IntPtr)num18)].y = vector10.y;
array3[(int)((IntPtr)num18)].z = vector10.z;
array3[(int)((IntPtr)num18)].w = ((Vector3.Dot(Vector3.Cross(vector9, vector10), array2[(int)((IntPtr)num18)]) >= 0f) ? 1f : (-1f));
}
}
InMesh.tangents = array3;
}
// Token: 0x0600014E RID: 334 RVA: 0x0001495C File Offset: 0x00012D5C
public static Mesh DeepCopy(Mesh mesh)
{
Mesh mesh2 = new Mesh();
pb_MeshUtility.CopyTo(mesh, mesh2);
return mesh2;
}
// Token: 0x0600014F RID: 335 RVA: 0x00014978 File Offset: 0x00012D78
public static void CopyTo(Mesh source, Mesh destination)
{
Vector3[] array = new Vector3[source.vertices.Length];
int[][] array2 = new int[source.subMeshCount][];
Vector2[] array3 = new Vector2[source.uv.Length];
Vector2[] array4 = new Vector2[source.uv2.Length];
Vector4[] array5 = new Vector4[source.tangents.Length];
Vector3[] array6 = new Vector3[source.normals.Length];
Color32[] array7 = new Color32[source.colors32.Length];
Array.Copy(source.vertices, array, array.Length);
for (int i = 0; i < array2.Length; i++)
{
array2[i] = source.GetTriangles(i);
}
Array.Copy(source.uv, array3, array3.Length);
Array.Copy(source.uv2, array4, array4.Length);
Array.Copy(source.normals, array6, array6.Length);
Array.Copy(source.tangents, array5, array5.Length);
Array.Copy(source.colors32, array7, array7.Length);
destination.Clear();
destination.name = source.name;
destination.vertices = array;
destination.subMeshCount = array2.Length;
for (int j = 0; j < array2.Length; j++)
{
destination.SetTriangles(array2[j], j);
}
destination.uv = array3;
destination.uv2 = array4;
destination.tangents = array5;
destination.normals = array6;
destination.colors32 = array7;
}
// Token: 0x06000150 RID: 336 RVA: 0x00014AD8 File Offset: 0x00012ED8
public static Vector3[] GenerateNormals(pb_Object pb)
{
int vertexCount = pb.vertexCount;
Vector3[] array = new Vector3[vertexCount];
Vector3[] vertices = pb.vertices;
Vector3[] array2 = new Vector3[vertexCount];
int[] array3 = new int[vertexCount];
pb_Face[] faces = pb.faces;
for (int i = 0; i < faces.Length; i++)
{
int[] indices = faces[i].indices;
for (int j = 0; j < indices.Length; j += 3)
{
int num = indices[j];
int num2 = indices[j + 1];
int num3 = indices[j + 2];
Vector3 vector = pb_Math.Normal(vertices[num], vertices[num2], vertices[num3]);
Vector3[] array4 = array;
int num4 = num;
array4[num4].x = array4[num4].x + vector.x;
Vector3[] array5 = array;
int num5 = num2;
array5[num5].x = array5[num5].x + vector.x;
Vector3[] array6 = array;
int num6 = num3;
array6[num6].x = array6[num6].x + vector.x;
Vector3[] array7 = array;
int num7 = num;
array7[num7].y = array7[num7].y + vector.y;
Vector3[] array8 = array;
int num8 = num2;
array8[num8].y = array8[num8].y + vector.y;
Vector3[] array9 = array;
int num9 = num3;
array9[num9].y = array9[num9].y + vector.y;
Vector3[] array10 = array;
int num10 = num;
array10[num10].z = array10[num10].z + vector.z;
Vector3[] array11 = array;
int num11 = num2;
array11[num11].z = array11[num11].z + vector.z;
Vector3[] array12 = array;
int num12 = num3;
array12[num12].z = array12[num12].z + vector.z;
array3[num]++;
array3[num2]++;
array3[num3]++;
}
}
for (int k = 0; k < vertexCount; k++)
{
array2[k].x = array[k].x * (float)array3[k];
array2[k].y = array[k].y * (float)array3[k];
array2[k].z = array[k].z * (float)array3[k];
}
return array2;
}
// Token: 0x06000151 RID: 337 RVA: 0x00014D30 File Offset: 0x00013130
public static void SmoothNormals(pb_Object pb, ref Vector3[] normals)
{
int vertexCount = pb.vertexCount;
Vector3[] array = new Vector3[24];
float[] array2 = new float[24];
int[] array3 = new int[vertexCount];
pb_IntArray[] sharedIndices = pb.sharedIndices;
pb_Face[] faces = pb.faces;
foreach (pb_Face pb_Face in faces)
{
foreach (int num in pb_Face.distinctIndices)
{
array3[num] = pb_Face.smoothingGroup;
}
}
for (int k = 0; k < sharedIndices.Length; k++)
{
for (int l = 0; l < 24; l++)
{
array[l].x = 0f;
array[l].y = 0f;
array[l].z = 0f;
array2[l] = 0f;
}
for (int m = 0; m < sharedIndices[k].array.Length; m++)
{
int num2 = sharedIndices[k].array[m];
if (array3[num2] >= 1 && array3[num2] <= 24)
{
Vector3[] array5 = array;
int num3 = array3[num2];
array5[num3].x = array5[num3].x + normals[num2].x;
Vector3[] array6 = array;
int num4 = array3[num2];
array6[num4].y = array6[num4].y + normals[num2].y;
Vector3[] array7 = array;
int num5 = array3[num2];
array7[num5].z = array7[num5].z + normals[num2].z;
array2[array3[num2]] += 1f;
}
}
for (int n = 0; n < sharedIndices[k].array.Length; n++)
{
int num6 = sharedIndices[k].array[n];
if (array3[num6] >= 1 && array3[num6] <= 24)
{
normals[num6].x = array[array3[num6]].x / array2[array3[num6]];
normals[num6].y = array[array3[num6]].y / array2[array3[num6]];
normals[num6].z = array[array3[num6]].z / array2[array3[num6]];
}
}
}
}
// Token: 0x06000152 RID: 338 RVA: 0x00014FB4 File Offset: 0x000133B4
public static T GetMeshAttribute<T>(GameObject go, Func<Mesh, T> attributeGetter) where T : IList
{
MeshFilter component = go.GetComponent<MeshFilter>();
Mesh mesh = ((!(component != null)) ? null : component.sharedMesh);
T t = default(T);
if (mesh == null)
{
return t;
}
int vertexCount = mesh.vertexCount;
MeshRenderer component2 = go.GetComponent<MeshRenderer>();
Mesh mesh2 = ((!(component2 != null)) ? null : component2.additionalVertexStreams);
if (mesh2 != null)
{
t = attributeGetter(mesh2);
if (t != null && t.Count == vertexCount)
{
return t;
}
}
t = attributeGetter(mesh);
return (t == null || t.Count != vertexCount) ? default(T) : t;
}
}
}
@@ -0,0 +1,76 @@
using System;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000033 RID: 51
public class pb_MonoBehaviourSingleton<T> : MonoBehaviour where T : MonoBehaviour
{
// Token: 0x17000017 RID: 23
// (get) Token: 0x06000155 RID: 341 RVA: 0x0000E840 File Offset: 0x0000CC40
public static T instance
{
get
{
if (pb_MonoBehaviourSingleton<T>.nullableInstance == null)
{
pb_MonoBehaviourSingleton<T>._instance = new GameObject
{
name = typeof(T).ToString()
}.AddComponent<T>();
}
return (T)((object)pb_MonoBehaviourSingleton<T>._instance);
}
}
// Token: 0x17000018 RID: 24
// (get) Token: 0x06000156 RID: 342 RVA: 0x0000E898 File Offset: 0x0000CC98
public static T nullableInstance
{
get
{
if (pb_MonoBehaviourSingleton<T>._instance == null)
{
T[] array = Resources.FindObjectsOfTypeAll<T>();
if (array != null && array.Length > 0)
{
pb_MonoBehaviourSingleton<T>._instance = array[0];
for (int i = 1; i < array.Length; i++)
{
global::UnityEngine.Object.DestroyImmediate(array[i]);
}
}
}
return (T)((object)pb_MonoBehaviourSingleton<T>._instance);
}
}
// Token: 0x06000157 RID: 343 RVA: 0x0000E90A File Offset: 0x0000CD0A
public static bool Valid()
{
return pb_MonoBehaviourSingleton<T>.nullableInstance != null;
}
// Token: 0x06000158 RID: 344 RVA: 0x0000E91C File Offset: 0x0000CD1C
public virtual void Awake()
{
if (pb_MonoBehaviourSingleton<T>._instance == null)
{
pb_MonoBehaviourSingleton<T>._instance = this;
}
else
{
global::UnityEngine.Object.Destroy(this);
}
}
// Token: 0x06000159 RID: 345 RVA: 0x0000E93F File Offset: 0x0000CD3F
public virtual void OnEnable()
{
pb_MonoBehaviourSingleton<T>._instance = this;
}
// Token: 0x04000131 RID: 305
private static MonoBehaviour _instance;
}
}
+1138
View File
@@ -0,0 +1,1138 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using ProBuilder2.Common;
using UnityEngine;
// Token: 0x02000034 RID: 52
[AddComponentMenu("")]
[DisallowMultipleComponent]
[RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(MeshRenderer))]
[RequireComponent(typeof(pb_Entity))]
[ExecuteInEditMode]
public class pb_Object : MonoBehaviour
{
// Token: 0x0600015B RID: 347 RVA: 0x000150F4 File Offset: 0x000134F4
private void Awake()
{
if (base.GetComponent<MeshRenderer>().isPartOfStaticBatch)
{
return;
}
Vector3[] array = ((!(this.msh != null)) ? null : this.msh.normals);
if (array == null || array.Length != this.msh.vertexCount || (array.Length > 0 && array[0] == Vector3.zero))
{
if (this._vertices == null)
{
return;
}
this.ToMesh();
this.Refresh(RefreshMask.All);
}
}
// Token: 0x0600015C RID: 348 RVA: 0x00015190 File Offset: 0x00013590
public static pb_Object InitWithObject(pb_Object pb)
{
Vector3[] array = new Vector3[pb.vertexCount];
Array.Copy(pb.vertices, array, pb.vertexCount);
Vector2[] array2 = new Vector2[pb.vertexCount];
Array.Copy(pb.uv, array2, pb.vertexCount);
Color[] array3 = new Color[pb.vertexCount];
Array.Copy(pb.colors, array3, pb.vertexCount);
pb_Face[] array4 = new pb_Face[pb.faces.Length];
for (int i = 0; i < array4.Length; i++)
{
array4[i] = new pb_Face(pb.faces[i]);
}
pb_Object pb_Object = pb_Object.CreateInstanceWithElements(array, array2, array3, array4, pb.GetSharedIndices(), pb.GetSharedIndicesUV());
pb_Object.gameObject.name = pb.gameObject.name + "-clone";
return pb_Object;
}
// Token: 0x0600015D RID: 349 RVA: 0x0001526C File Offset: 0x0001366C
public static pb_Object CreateInstanceWithPoints(Vector3[] vertices)
{
if (vertices.Length % 4 != 0)
{
global::UnityEngine.Debug.LogWarning("Invalid Geometry. Make sure vertices in are pairs of 4 (faces).");
return null;
}
GameObject gameObject = new GameObject();
pb_Object pb_Object = gameObject.AddComponent<pb_Object>();
gameObject.name = "ProBuilder Mesh";
pb_Object.GeometryWithPoints(vertices);
pb_Object.GetComponent<pb_Entity>().SetEntity(EntityType.Detail);
return pb_Object;
}
// Token: 0x0600015E RID: 350 RVA: 0x000152BC File Offset: 0x000136BC
public static pb_Object CreateInstanceWithVerticesFaces(Vector3[] v, pb_Face[] f)
{
GameObject gameObject = new GameObject();
pb_Object pb_Object = gameObject.AddComponent<pb_Object>();
gameObject.name = "ProBuilder Mesh";
pb_Object.GeometryWithVerticesFaces(v, f);
return pb_Object;
}
// Token: 0x0600015F RID: 351 RVA: 0x000152EC File Offset: 0x000136EC
public static pb_Object CreateInstanceWithElements(Vector3[] v, Vector2[] u, Color[] c, pb_Face[] f, pb_IntArray[] si, pb_IntArray[] si_uv)
{
GameObject gameObject = new GameObject();
pb_Object pb_Object = gameObject.AddComponent<pb_Object>();
pb_Object.SetVertices(v);
pb_Object.SetUV(u);
pb_Object.SetColors(c);
pb_Object.SetSharedIndices(si ?? pb_IntArrayUtility.ExtractSharedIndices(v));
pb_Object.SetSharedIndicesUV(si_uv ?? new pb_IntArray[0]);
pb_Object.SetFaces(f);
pb_Object.ToMesh();
pb_Object.Refresh(RefreshMask.All);
pb_Object.GetComponent<pb_Entity>().SetEntity(EntityType.Detail);
return pb_Object;
}
// Token: 0x06000160 RID: 352 RVA: 0x0001536C File Offset: 0x0001376C
public static pb_Object CreateInstanceWithElements(pb_Vertex[] vertices, pb_Face[] faces, pb_IntArray[] si, pb_IntArray[] si_uv)
{
GameObject gameObject = new GameObject();
pb_Object pb_Object = gameObject.AddComponent<pb_Object>();
Vector3[] array;
Color[] array2;
Vector2[] array3;
Vector3[] array4;
Vector4[] array5;
Vector2[] array6;
List<Vector4> list;
List<Vector4> list2;
pb_Vertex.GetArrays(vertices, out array, out array2, out array3, out array4, out array5, out array6, out list, out list2);
pb_Object.SetVertices(array);
pb_Object.SetColors(array2);
pb_Object.SetUV(array3);
if (list != null)
{
pb_Object._uv3 = list;
}
if (list2 != null)
{
pb_Object._uv4 = list2;
}
pb_Object.SetSharedIndices(si ?? pb_IntArrayUtility.ExtractSharedIndices(array));
pb_Object.SetSharedIndicesUV(si_uv ?? new pb_IntArray[0]);
pb_Object.SetFaces(faces);
pb_Object.ToMesh();
pb_Object.Refresh(RefreshMask.All);
pb_Object.GetComponent<pb_Entity>().SetEntity(EntityType.Detail);
return pb_Object;
}
// Token: 0x17000019 RID: 25
// (get) Token: 0x06000161 RID: 353 RVA: 0x0001541D File Offset: 0x0001381D
private pb_Face[] _faces
{
get
{
return this._quads;
}
}
// Token: 0x14000001 RID: 1
// (add) Token: 0x06000162 RID: 354 RVA: 0x00015428 File Offset: 0x00013828
// (remove) Token: 0x06000163 RID: 355 RVA: 0x0001545C File Offset: 0x0001385C
[field: DebuggerBrowsable(DebuggerBrowsableState.Never)]
public static event Action<pb_Object> onDestroyObject;
// Token: 0x1700001A RID: 26
// (get) Token: 0x06000164 RID: 356 RVA: 0x00015490 File Offset: 0x00013890
// (set) Token: 0x06000165 RID: 357 RVA: 0x0001549D File Offset: 0x0001389D
public Mesh msh
{
get
{
return base.GetComponent<MeshFilter>().sharedMesh;
}
set
{
base.gameObject.GetComponent<MeshFilter>().sharedMesh = value;
}
}
// Token: 0x1700001B RID: 27
// (get) Token: 0x06000166 RID: 358 RVA: 0x000154B0 File Offset: 0x000138B0
public pb_Face[] faces
{
get
{
return this._quads;
}
}
// Token: 0x1700001C RID: 28
// (get) Token: 0x06000167 RID: 359 RVA: 0x000154B8 File Offset: 0x000138B8
public pb_Face[] quads
{
get
{
global::UnityEngine.Debug.LogWarning("pb_Quad is deprecated. Please use pb_Face instead.");
return this._quads;
}
}
// Token: 0x1700001D RID: 29
// (get) Token: 0x06000168 RID: 360 RVA: 0x000154CA File Offset: 0x000138CA
public pb_IntArray[] sharedIndices
{
get
{
return this._sharedIndices;
}
}
// Token: 0x1700001E RID: 30
// (get) Token: 0x06000169 RID: 361 RVA: 0x000154D2 File Offset: 0x000138D2
public pb_IntArray[] sharedIndicesUV
{
get
{
return this._sharedIndicesUV;
}
}
// Token: 0x1700001F RID: 31
// (get) Token: 0x0600016A RID: 362 RVA: 0x000154DA File Offset: 0x000138DA
public int id
{
get
{
return base.gameObject.GetInstanceID();
}
}
// Token: 0x17000020 RID: 32
// (get) Token: 0x0600016B RID: 363 RVA: 0x000154E7 File Offset: 0x000138E7
public Vector3[] vertices
{
get
{
return this._vertices;
}
}
// Token: 0x17000021 RID: 33
// (get) Token: 0x0600016C RID: 364 RVA: 0x000154EF File Offset: 0x000138EF
public Color[] colors
{
get
{
return this._colors;
}
}
// Token: 0x17000022 RID: 34
// (get) Token: 0x0600016D RID: 365 RVA: 0x000154F7 File Offset: 0x000138F7
public Vector2[] uv
{
get
{
return this._uv;
}
}
// Token: 0x17000023 RID: 35
// (get) Token: 0x0600016E RID: 366 RVA: 0x000154FF File Offset: 0x000138FF
public bool hasUv3
{
get
{
return this._uv3 != null && this._uv3.Count == this.vertexCount;
}
}
// Token: 0x17000024 RID: 36
// (get) Token: 0x0600016F RID: 367 RVA: 0x00015522 File Offset: 0x00013922
public bool hasUv4
{
get
{
return this._uv4 != null && this._uv4.Count == this.vertexCount;
}
}
// Token: 0x17000025 RID: 37
// (get) Token: 0x06000170 RID: 368 RVA: 0x00015545 File Offset: 0x00013945
public List<Vector4> uv3
{
get
{
return this._uv3;
}
}
// Token: 0x17000026 RID: 38
// (get) Token: 0x06000171 RID: 369 RVA: 0x0001554D File Offset: 0x0001394D
public List<Vector4> uv4
{
get
{
return this._uv4;
}
}
// Token: 0x17000027 RID: 39
// (get) Token: 0x06000172 RID: 370 RVA: 0x00015555 File Offset: 0x00013955
public int faceCount
{
get
{
return (this._faces != null) ? this._faces.Length : 0;
}
}
// Token: 0x17000028 RID: 40
// (get) Token: 0x06000173 RID: 371 RVA: 0x00015570 File Offset: 0x00013970
public int vertexCount
{
get
{
return (this._vertices != null) ? this._vertices.Length : 0;
}
}
// Token: 0x17000029 RID: 41
// (get) Token: 0x06000174 RID: 372 RVA: 0x0001558B File Offset: 0x0001398B
public int triangleCount
{
get
{
int num;
if (this._faces == null)
{
num = 0;
}
else
{
num = this._faces.Sum((pb_Face x) => x.indices.Length);
}
return num;
}
}
// Token: 0x06000175 RID: 373 RVA: 0x000155C8 File Offset: 0x000139C8
public pb_IntArray[] GetSharedIndices()
{
int num = this._sharedIndices.Length;
pb_IntArray[] array = new pb_IntArray[num];
for (int i = 0; i < num; i++)
{
int[] array2 = new int[this._sharedIndices[i].Length];
Array.Copy(this._sharedIndices[i].array, array2, array2.Length);
array[i] = new pb_IntArray(array2);
}
return array;
}
// Token: 0x06000176 RID: 374 RVA: 0x0001562C File Offset: 0x00013A2C
public pb_IntArray[] GetSharedIndicesUV()
{
int num = this._sharedIndicesUV.Length;
pb_IntArray[] array = new pb_IntArray[num];
for (int i = 0; i < num; i++)
{
int[] array2 = new int[this._sharedIndicesUV[i].Length];
Array.Copy(this._sharedIndicesUV[i].array, array2, array2.Length);
array[i] = new pb_IntArray(array2);
}
return array;
}
// Token: 0x1700002A RID: 42
// (get) Token: 0x06000177 RID: 375 RVA: 0x0001568E File Offset: 0x00013A8E
public pb_Face[] SelectedFaces
{
get
{
return this.faces.ValuesWithIndices(this.m_selectedFaces);
}
}
// Token: 0x1700002B RID: 43
// (get) Token: 0x06000178 RID: 376 RVA: 0x000156A1 File Offset: 0x00013AA1
public int SelectedFaceCount
{
get
{
return this.m_selectedFaces.Length;
}
}
// Token: 0x1700002C RID: 44
// (get) Token: 0x06000179 RID: 377 RVA: 0x000156AB File Offset: 0x00013AAB
public int[] SelectedTriangles
{
get
{
return this.m_selectedTriangles;
}
}
// Token: 0x1700002D RID: 45
// (get) Token: 0x0600017A RID: 378 RVA: 0x000156B3 File Offset: 0x00013AB3
public int SelectedTriangleCount
{
get
{
return this.m_selectedTriangles.Length;
}
}
// Token: 0x1700002E RID: 46
// (get) Token: 0x0600017B RID: 379 RVA: 0x000156BD File Offset: 0x00013ABD
public pb_Edge[] SelectedEdges
{
get
{
return this.m_SelectedEdges;
}
}
// Token: 0x1700002F RID: 47
// (get) Token: 0x0600017C RID: 380 RVA: 0x000156C5 File Offset: 0x00013AC5
public int SelectedEdgeCount
{
get
{
return this.m_SelectedEdges.Length;
}
}
// Token: 0x0600017D RID: 381 RVA: 0x000156D0 File Offset: 0x00013AD0
public void AddToFaceSelection(pb_Face face)
{
int num = Array.IndexOf<pb_Face>(this.faces, face);
if (num > -1)
{
this.SetSelectedFaces(this.m_selectedFaces.Add(num));
}
}
// Token: 0x0600017E RID: 382 RVA: 0x00015704 File Offset: 0x00013B04
public void SetSelectedFaces(IEnumerable<pb_Face> selected)
{
List<int> list = new List<int>();
foreach (pb_Face pb_Face in selected)
{
int num = Array.IndexOf<pb_Face>(this.faces, pb_Face);
if (num > -1)
{
list.Add(num);
}
}
this.SetSelectedFaces(list);
}
// Token: 0x0600017F RID: 383 RVA: 0x0001577C File Offset: 0x00013B7C
public void SetSelectedFaces(IEnumerable<int> selected)
{
this.m_selectedFaces = selected.ToArray<int>();
this.m_selectedTriangles = pb_Face.AllTriangles(this.SelectedFaces);
pb_Edge[] array = pb_Edge.AllEdges(this.SelectedFaces);
int num = array.Length;
this.m_SelectedEdges = new pb_Edge[num];
for (int i = 0; i < num; i++)
{
this.m_SelectedEdges[i] = new pb_Edge(array[i]);
}
}
// Token: 0x06000180 RID: 384 RVA: 0x000157E4 File Offset: 0x00013BE4
public void SetSelectedEdges(IEnumerable<pb_Edge> edges)
{
this.m_selectedFaces = new int[0];
this.m_SelectedEdges = edges.Select((pb_Edge x) => new pb_Edge(x)).ToArray<pb_Edge>();
this.m_selectedTriangles = this.m_SelectedEdges.AllTriangles();
}
// Token: 0x06000181 RID: 385 RVA: 0x0001583C File Offset: 0x00013C3C
public void SetSelectedTriangles(int[] tris)
{
this.m_selectedFaces = new int[0];
this.m_SelectedEdges = new pb_Edge[0];
this.m_selectedTriangles = tris ?? new int[0];
}
// Token: 0x06000182 RID: 386 RVA: 0x0001586A File Offset: 0x00013C6A
public void RemoveFromFaceSelectionAtIndex(int index)
{
this.SetSelectedFaces(this.m_selectedFaces.RemoveAt(index));
}
// Token: 0x06000183 RID: 387 RVA: 0x00015880 File Offset: 0x00013C80
public void RemoveFromFaceSelection(pb_Face face)
{
int num = Array.IndexOf<pb_Face>(this.faces, face);
if (num > -1)
{
this.SetSelectedFaces(this.m_selectedFaces.Remove(num));
}
}
// Token: 0x06000184 RID: 388 RVA: 0x000158B3 File Offset: 0x00013CB3
public void ClearSelection()
{
this.m_selectedFaces = new int[0];
this.m_SelectedEdges = new pb_Edge[0];
this.m_selectedTriangles = new int[0];
}
// Token: 0x06000185 RID: 389 RVA: 0x000158D9 File Offset: 0x00013CD9
public void SetVertices(Vector3[] v)
{
this._vertices = v;
}
// Token: 0x06000186 RID: 390 RVA: 0x000158E4 File Offset: 0x00013CE4
public void SetVertices(IList<pb_Vertex> vertices, bool applyMesh = false)
{
Vector3[] array;
Color[] array2;
Vector2[] array3;
Vector3[] array4;
Vector4[] array5;
Vector2[] array6;
List<Vector4> list;
List<Vector4> list2;
pb_Vertex.GetArrays(vertices, out array, out array2, out array3, out array4, out array5, out array6, out list, out list2);
this.SetVertices(array);
this.SetColors(array2);
this.SetUV(array3);
if (list != null)
{
this._uv3 = list;
}
if (list2 != null)
{
this._uv4 = list2;
}
if (applyMesh)
{
Mesh msh = this.msh;
pb_Vertex pb_Vertex = vertices[0];
if (pb_Vertex.hasPosition)
{
msh.vertices = array;
}
if (pb_Vertex.hasColor)
{
msh.colors = array2;
}
if (pb_Vertex.hasUv0)
{
msh.uv = array3;
}
if (pb_Vertex.hasNormal)
{
msh.normals = array4;
}
if (pb_Vertex.hasTangent)
{
msh.tangents = array5;
}
if (pb_Vertex.hasUv2)
{
msh.uv2 = array6;
}
if (pb_Vertex.hasUv3 && list != null)
{
msh.SetUVs(2, list);
}
if (pb_Vertex.hasUv4 && list2 != null)
{
msh.SetUVs(3, list2);
}
}
}
// Token: 0x06000187 RID: 391 RVA: 0x00015A05 File Offset: 0x00013E05
public void SetUV(Vector2[] uvs)
{
this._uv = uvs;
}
// Token: 0x06000188 RID: 392 RVA: 0x00015A10 File Offset: 0x00013E10
public void SetFaces(pb_Face[] _qds)
{
this._quads = _qds.Where((pb_Face x) => x != null).ToArray<pb_Face>();
if (this._quads.Length != _qds.Length)
{
global::UnityEngine.Debug.LogWarning("SetFaces() pruned " + (_qds.Length - this._quads.Length) + " null faces from this object.");
}
}
// Token: 0x06000189 RID: 393 RVA: 0x00015A80 File Offset: 0x00013E80
public void SetSharedIndices(pb_IntArray[] si)
{
this._sharedIndices = si;
}
// Token: 0x0600018A RID: 394 RVA: 0x00015A89 File Offset: 0x00013E89
public void SetSharedIndices(IEnumerable<KeyValuePair<int, int>> si)
{
this._sharedIndices = si.ToSharedIndices();
}
// Token: 0x0600018B RID: 395 RVA: 0x00015A97 File Offset: 0x00013E97
public void SetSharedIndicesUV(pb_IntArray[] si)
{
this._sharedIndicesUV = si;
}
// Token: 0x0600018C RID: 396 RVA: 0x00015AA0 File Offset: 0x00013EA0
public void SetSharedIndicesUV(IEnumerable<KeyValuePair<int, int>> si)
{
this._sharedIndicesUV = si.ToSharedIndices();
}
// Token: 0x0600018D RID: 397 RVA: 0x00015AB0 File Offset: 0x00013EB0
private void GeometryWithPoints(Vector3[] v)
{
pb_Face[] array = new pb_Face[v.Length / 4];
for (int i = 0; i < v.Length; i += 4)
{
array[i / 4] = new pb_Face(new int[]
{
i,
i + 1,
i + 2,
i + 1,
i + 3,
i + 2
}, pb_Constant.DefaultMaterial, new pb_UV(), 0, -1, -1, false);
}
this.SetVertices(v);
this.SetUV(new Vector2[v.Length]);
this.SetColors(pbUtil.FilledArray<Color>(Color.white, v.Length));
this.SetFaces(array);
this.SetSharedIndices(pb_IntArrayUtility.ExtractSharedIndices(v));
this.ToMesh();
this.Refresh(RefreshMask.All);
}
// Token: 0x0600018E RID: 398 RVA: 0x00015B68 File Offset: 0x00013F68
public void GeometryWithVerticesFaces(Vector3[] v, pb_Face[] f)
{
this.SetVertices(v);
this.SetUV(new Vector2[v.Length]);
this.SetFaces(f);
this.SetSharedIndices(pb_IntArrayUtility.ExtractSharedIndices(v));
this.ToMesh();
this.Refresh(RefreshMask.All);
}
// Token: 0x0600018F RID: 399 RVA: 0x00015BA4 File Offset: 0x00013FA4
private void GeometryWithVerticesFacesIndices(Vector3[] v, pb_Face[] f, pb_IntArray[] s)
{
this.SetFaces(f);
this.SetVertices(v);
this.SetUV(new Vector2[v.Length]);
this.SetSharedIndices(s);
if (this.msh != null)
{
global::UnityEngine.Object.DestroyImmediate(this.msh);
}
this.ToMesh();
this.Refresh(RefreshMask.All);
}
// Token: 0x06000190 RID: 400 RVA: 0x00015C04 File Offset: 0x00014004
public MeshRebuildReason Verify()
{
if (this.msh == null)
{
try
{
this.ToMesh();
this.Refresh(RefreshMask.All);
}
catch (Exception ex)
{
global::UnityEngine.Debug.LogError("Failed rebuilding null pb_Object. Cached mesh attributes are invalid or missing.\n" + ex.ToString());
}
return MeshRebuildReason.Null;
}
int num;
int.TryParse(this.msh.name.Replace("pb_Mesh", string.Empty), out num);
if (num != this.id)
{
return MeshRebuildReason.InstanceIDMismatch;
}
return (this.msh.uv2 != null) ? MeshRebuildReason.None : MeshRebuildReason.Lightmap;
}
// Token: 0x06000191 RID: 401 RVA: 0x00015CAC File Offset: 0x000140AC
public void ToMesh()
{
Mesh mesh = this.msh;
if (mesh != null && mesh.vertexCount == this._vertices.Length)
{
mesh = this.msh;
mesh.vertices = this._vertices;
if (this._uv != null)
{
mesh.uv = this._uv;
}
}
else
{
if (mesh == null)
{
mesh = new Mesh();
}
else
{
mesh.Clear();
}
mesh.vertices = this._vertices;
}
mesh.uv2 = null;
int[][] array;
Material[] array2;
mesh.subMeshCount = pb_Face.MeshTriangles(this.faces, out array, out array2);
for (int i = 0; i < array.Length; i++)
{
mesh.SetTriangles(array[i], i);
}
mesh.name = "pb_Mesh" + this.id;
base.GetComponent<MeshFilter>().sharedMesh = mesh;
base.GetComponent<MeshRenderer>().sharedMaterials = array2;
}
// Token: 0x06000192 RID: 402 RVA: 0x00015DA4 File Offset: 0x000141A4
public void MakeUnique()
{
pb_Face[] array = new pb_Face[this._faces.Length];
for (int i = 0; i < array.Length; i++)
{
array[i] = new pb_Face(this._faces[i]);
}
pb_IntArray[] array2 = new pb_IntArray[this._sharedIndices.Length];
Array.Copy(this._sharedIndices, array2, array2.Length);
this.SetSharedIndices(array2);
this.SetFaces(array);
Vector3[] array3 = new Vector3[this.vertexCount];
Array.Copy(this._vertices, array3, this.vertexCount);
this.SetVertices(array3);
if (this._uv != null && this._uv.Length == this.vertexCount)
{
Vector2[] array4 = new Vector2[this.vertexCount];
Array.Copy(this._uv, array4, this.vertexCount);
this.SetUV(array4);
}
this.msh = new Mesh();
this.ToMesh();
this.Refresh(RefreshMask.All);
}
// Token: 0x06000193 RID: 403 RVA: 0x00015E98 File Offset: 0x00014298
public void Refresh(RefreshMask mask = RefreshMask.All)
{
if ((ushort)(mask & RefreshMask.UV) > 0)
{
this.RefreshUV();
}
if ((ushort)(mask & RefreshMask.Colors) > 0)
{
this.RefreshColors();
}
if ((ushort)(mask & RefreshMask.Normals) > 0)
{
this.RefreshNormals();
}
if ((ushort)(mask & RefreshMask.Tangents) > 0)
{
this.RefreshTangents();
}
if ((ushort)(mask & RefreshMask.Collisions) > 0)
{
this.RefreshCollisions();
}
}
// Token: 0x06000194 RID: 404 RVA: 0x00015EF8 File Offset: 0x000142F8
public void RefreshCollisions()
{
Mesh msh = this.msh;
msh.RecalculateBounds();
if (!this.userCollisions && base.GetComponent<Collider>())
{
foreach (Collider collider in base.gameObject.GetComponents<Collider>())
{
Type type = collider.GetType();
if (type == typeof(BoxCollider))
{
((BoxCollider)collider).center = msh.bounds.center;
((BoxCollider)collider).size = msh.bounds.size;
}
else if (type == typeof(SphereCollider))
{
((SphereCollider)collider).center = msh.bounds.center;
((SphereCollider)collider).radius = pb_Math.LargestValue(msh.bounds.extents);
}
else if (type == typeof(CapsuleCollider))
{
((CapsuleCollider)collider).center = msh.bounds.center;
Vector2 vector = new Vector2(msh.bounds.extents.x, msh.bounds.extents.z);
((CapsuleCollider)collider).radius = pb_Math.LargestValue(vector);
((CapsuleCollider)collider).height = msh.bounds.size.y;
}
else if (type == typeof(WheelCollider))
{
((WheelCollider)collider).center = msh.bounds.center;
((WheelCollider)collider).radius = pb_Math.LargestValue(msh.bounds.extents);
}
else if (type == typeof(MeshCollider))
{
base.gameObject.GetComponent<MeshCollider>().sharedMesh = null;
base.gameObject.GetComponent<MeshCollider>().sharedMesh = msh;
}
}
}
}
// Token: 0x06000195 RID: 405 RVA: 0x00016110 File Offset: 0x00014510
public int GetUnusedTextureGroup(int i = 1)
{
while (Array.Exists<pb_Face>(this.faces, (pb_Face element) => element.textureGroup == i))
{
i++;
}
return i;
}
// Token: 0x06000196 RID: 406 RVA: 0x00016160 File Offset: 0x00014560
public int UnusedElementGroup(int i = 1)
{
while (Array.Exists<pb_Face>(this.faces, (pb_Face element) => element.elementGroup == i))
{
i++;
}
return i;
}
// Token: 0x06000197 RID: 407 RVA: 0x000161AF File Offset: 0x000145AF
public void RefreshUV()
{
this.RefreshUV(this.faces);
}
// Token: 0x06000198 RID: 408 RVA: 0x000161C0 File Offset: 0x000145C0
public void GetUVs(int channel, List<Vector4> uvs)
{
uvs.Clear();
switch (channel)
{
default:
{
for (int i = 0; i < this.vertexCount; i++)
{
uvs.Add(this._uv[i]);
}
break;
}
case 1:
if (this.msh != null && this.msh.uv2 != null)
{
Vector2[] uv = this.msh.uv2;
for (int j = 0; j < uv.Length; j++)
{
uvs.Add(uv[j]);
}
}
break;
case 2:
if (this._uv3 != null)
{
uvs.AddRange(this._uv3);
}
break;
case 3:
if (this._uv4 != null)
{
uvs.AddRange(this._uv4);
}
break;
}
}
// Token: 0x06000199 RID: 409 RVA: 0x000162BC File Offset: 0x000146BC
public void SetUVs(int channel, List<Vector4> uvs)
{
switch (channel)
{
case 1:
this.msh.uv2 = uvs.Cast<Vector2>().ToArray<Vector2>();
return;
case 2:
this._uv3 = uvs;
return;
case 3:
this._uv4 = uvs;
return;
}
this._uv = uvs.Cast<Vector2>().ToArray<Vector2>();
}
// Token: 0x0600019A RID: 410 RVA: 0x00016330 File Offset: 0x00014730
public void RefreshUV(IEnumerable<pb_Face> facesToRefresh)
{
Vector2[] uv = this.msh.uv;
Vector2[] array;
if (this._uv != null && this._uv.Length == this.vertexCount)
{
array = this._uv;
}
else if (uv != null && uv.Length == this.vertexCount)
{
array = uv;
}
else
{
foreach (pb_Face pb_Face in this.faces)
{
pb_Face.manualUV = false;
}
facesToRefresh = this.faces;
array = new Vector2[this.vertexCount];
}
int num = -2;
Dictionary<int, List<pb_Face>> dictionary = new Dictionary<int, List<pb_Face>>();
bool flag = false;
foreach (pb_Face pb_Face2 in facesToRefresh)
{
if (pb_Face2.uv.useWorldSpace)
{
flag = true;
}
if (pb_Face2 != null && !pb_Face2.manualUV)
{
List<pb_Face> list;
if (pb_Face2.textureGroup > 0 && dictionary.TryGetValue(pb_Face2.textureGroup, out list))
{
list.Add(pb_Face2);
}
else
{
Dictionary<int, List<pb_Face>> dictionary2 = dictionary;
int num2;
if (pb_Face2.textureGroup > 0)
{
num2 = pb_Face2.textureGroup;
}
else
{
num = (num2 = num) - 1;
}
dictionary2.Add(num2, new List<pb_Face> { pb_Face2 });
}
}
}
if (this.faces.Length != facesToRefresh.Count<pb_Face>())
{
foreach (pb_Face pb_Face3 in this.faces)
{
if (!pb_Face3.manualUV)
{
if (dictionary.ContainsKey(pb_Face3.textureGroup) && !dictionary[pb_Face3.textureGroup].Contains(pb_Face3))
{
dictionary[pb_Face3.textureGroup].Add(pb_Face3);
}
}
}
}
num = 0;
Vector3[] array2 = ((!flag) ? null : base.transform.ToWorldSpace(this.vertices));
foreach (KeyValuePair<int, List<pb_Face>> keyValuePair in dictionary)
{
int[] array3 = pb_Face.AllTrianglesDistinct(keyValuePair.Value).ToArray();
Vector3 vector;
if (keyValuePair.Value.Count > 1)
{
vector = pb_Projection.FindBestPlane(this._vertices, array3).normal;
}
else
{
vector = pb_Math.Normal(this, keyValuePair.Value[0]);
}
if (keyValuePair.Value[0].uv.useWorldSpace)
{
pb_UVUtility.PlanarMap2(array2, array, array3, keyValuePair.Value[0].uv, base.transform.TransformDirection(vector));
}
else
{
pb_UVUtility.PlanarMap2(this.vertices, array, array3, keyValuePair.Value[0].uv, vector);
}
Vector2 localPivot = keyValuePair.Value[0].uv.localPivot;
foreach (pb_Face pb_Face4 in keyValuePair.Value)
{
pb_Face4.uv.localPivot = localPivot;
}
}
this._uv = array;
this.msh.uv = array;
}
// Token: 0x0600019B RID: 411 RVA: 0x00016714 File Offset: 0x00014B14
public void SetFaceMaterial(pb_Face[] quad, Material mat)
{
for (int i = 0; i < quad.Length; i++)
{
quad[i].material = mat;
}
}
// Token: 0x0600019C RID: 412 RVA: 0x0001673E File Offset: 0x00014B3E
public void SetUV2(Vector2[] v)
{
base.GetComponent<MeshFilter>().sharedMesh.uv2 = v;
}
// Token: 0x0600019D RID: 413 RVA: 0x00016754 File Offset: 0x00014B54
public void RefreshColors()
{
Mesh sharedMesh = base.GetComponent<MeshFilter>().sharedMesh;
if (this._colors == null || this._colors.Length != this.vertexCount)
{
this._colors = pbUtil.FilledArray<Color>(Color.white, this.vertexCount);
}
sharedMesh.colors = this._colors;
}
// Token: 0x0600019E RID: 414 RVA: 0x000167AD File Offset: 0x00014BAD
public void SetColors(Color[] InColors)
{
this._colors = ((InColors.Length != this.vertexCount) ? pbUtil.FilledArray<Color>(Color.white, this.vertexCount) : InColors);
}
// Token: 0x0600019F RID: 415 RVA: 0x000167DC File Offset: 0x00014BDC
public void SetFaceColor(pb_Face face, Color color)
{
if (this._colors == null)
{
this._colors = pbUtil.FilledArray<Color>(Color.white, this.vertexCount);
}
foreach (int num in face.distinctIndices)
{
this._colors[num] = color;
}
}
// Token: 0x060001A0 RID: 416 RVA: 0x0001683B File Offset: 0x00014C3B
public void SetTangents(Vector4[] tangents)
{
this._tangents = tangents;
}
// Token: 0x060001A1 RID: 417 RVA: 0x00016844 File Offset: 0x00014C44
public void RefreshNormals()
{
this.msh.RecalculateNormals();
Vector3[] normals = this.msh.normals;
pb_MeshUtility.SmoothNormals(this, ref normals);
base.GetComponent<MeshFilter>().sharedMesh.normals = normals;
}
// Token: 0x060001A2 RID: 418 RVA: 0x00016884 File Offset: 0x00014C84
public void RefreshTangents()
{
Mesh sharedMesh = base.GetComponent<MeshFilter>().sharedMesh;
if (this._tangents != null && this._tangents.Length == this.vertexCount)
{
sharedMesh.tangents = this._tangents;
}
else
{
pb_MeshUtility.GenerateTangent(ref sharedMesh);
}
}
// Token: 0x060001A3 RID: 419 RVA: 0x000168D4 File Offset: 0x00014CD4
public void OnDestroy()
{
if (!this.dontDestroyMeshOnDelete && Application.isEditor && !Application.isPlaying && Time.frameCount > 0)
{
if (pb_Object.onDestroyObject != null)
{
pb_Object.onDestroyObject(this);
}
else
{
global::UnityEngine.Object.DestroyImmediate(base.gameObject.GetComponent<MeshFilter>().sharedMesh, true);
}
}
}
// Token: 0x04000132 RID: 306
[SerializeField]
private pb_Face[] _quads;
// Token: 0x04000133 RID: 307
[SerializeField]
private pb_IntArray[] _sharedIndices;
// Token: 0x04000134 RID: 308
[SerializeField]
private Vector3[] _vertices;
// Token: 0x04000135 RID: 309
[SerializeField]
private Vector2[] _uv;
// Token: 0x04000136 RID: 310
[SerializeField]
private List<Vector4> _uv3;
// Token: 0x04000137 RID: 311
[SerializeField]
private List<Vector4> _uv4;
// Token: 0x04000138 RID: 312
[SerializeField]
private Vector4[] _tangents;
// Token: 0x04000139 RID: 313
[SerializeField]
private pb_IntArray[] _sharedIndicesUV = new pb_IntArray[0];
// Token: 0x0400013A RID: 314
[SerializeField]
private Color[] _colors;
// Token: 0x0400013B RID: 315
public bool userCollisions;
// Token: 0x0400013C RID: 316
public bool isSelectable = true;
// Token: 0x0400013D RID: 317
public pb_UnwrapParameters unwrapParameters = new pb_UnwrapParameters();
// Token: 0x0400013E RID: 318
public string asset_guid;
// Token: 0x04000140 RID: 320
public bool dontDestroyMeshOnDelete;
// Token: 0x04000141 RID: 321
[SerializeField]
private int[] m_selectedFaces = new int[0];
// Token: 0x04000142 RID: 322
[SerializeField]
private pb_Edge[] m_SelectedEdges = new pb_Edge[0];
// Token: 0x04000143 RID: 323
[SerializeField]
private int[] m_selectedTriangles = new int[0];
}
+98
View File
@@ -0,0 +1,98 @@
using System;
using System.Collections;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000035 RID: 53
public class pb_ObjectPool<T> where T : global::UnityEngine.Object, new()
{
// Token: 0x060001A7 RID: 423 RVA: 0x00016988 File Offset: 0x00014D88
public pb_ObjectPool(int initialSize, int desiredSize, Func<T> constructor, Action<T> destructor)
{
this.constructor = constructor;
Action<T> action;
if (destructor == null)
{
action = new Action<T>(pb_ObjectPool<T>.DestroyObject);
}
else
{
action = destructor;
}
this.destructor = action;
this.desiredSize = desiredSize;
int num = 0;
while (num < initialSize && num < desiredSize)
{
this.pool.Enqueue((constructor == null) ? new T() : constructor());
num++;
}
}
// Token: 0x060001A8 RID: 424 RVA: 0x00016A24 File Offset: 0x00014E24
public T Get()
{
T t = ((this.pool.Count <= 0) ? ((T)((object)null)) : ((T)((object)this.pool.Dequeue())));
if (t == null)
{
t = ((this.constructor != null) ? this.constructor() : new T());
}
return t;
}
// Token: 0x060001A9 RID: 425 RVA: 0x00016A91 File Offset: 0x00014E91
public void Put(T obj)
{
if (this.pool.Count < this.desiredSize)
{
this.pool.Enqueue(obj);
}
else
{
global::UnityEngine.Object.DestroyImmediate(obj);
}
}
// Token: 0x060001AA RID: 426 RVA: 0x00016ACC File Offset: 0x00014ECC
public void Empty()
{
int count = this.pool.Count;
for (int i = 0; i < count; i++)
{
if (this.destructor != null)
{
this.destructor((T)((object)this.pool.Dequeue()));
}
else
{
pb_ObjectPool<T>.DestroyObject((T)((object)this.pool.Dequeue()));
}
}
}
// Token: 0x060001AB RID: 427 RVA: 0x00016B37 File Offset: 0x00014F37
private static void DestroyObject(T obj)
{
global::UnityEngine.Object.DestroyImmediate(obj);
}
// Token: 0x060001AC RID: 428 RVA: 0x00016B44 File Offset: 0x00014F44
private void OnDestroy()
{
this.Empty();
}
// Token: 0x04000147 RID: 327
public int desiredSize;
// Token: 0x04000148 RID: 328
public Func<T> constructor;
// Token: 0x04000149 RID: 329
public Action<T> destructor;
// Token: 0x0400014A RID: 330
private Queue pool = new Queue();
}
}
+141
View File
@@ -0,0 +1,141 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000036 RID: 54
public static class pb_Object_Utility
{
// Token: 0x060001AD RID: 429 RVA: 0x00016B4C File Offset: 0x00014F4C
public static Vector3[] VerticesInWorldSpace(this pb_Object pb)
{
Vector3[] array = new Vector3[pb.vertices.Length];
Array.Copy(pb.vertices, array, array.Length);
for (int i = 0; i < array.Length; i++)
{
array[i] = pb.transform.TransformPoint(array[i]);
}
return array;
}
// Token: 0x060001AE RID: 430 RVA: 0x00016BB0 File Offset: 0x00014FB0
public static Vector3[] VerticesInWorldSpace(this pb_Object pb, int[] indices)
{
if (indices == null)
{
Debug.LogWarning("indices == null -> VerticesInWorldSpace");
}
Vector3[] array = pb.vertices.ValuesWithIndices(indices);
for (int i = 0; i < array.Length; i++)
{
array[i] = pb.transform.TransformPoint(array[i]);
}
return array;
}
// Token: 0x060001AF RID: 431 RVA: 0x00016C12 File Offset: 0x00015012
public static void TranslateVertices_World(this pb_Object pb, int[] selectedTriangles, Vector3 offset)
{
pb.TranslateVertices_World(selectedTriangles, offset, 0f, false, null);
}
// Token: 0x060001B0 RID: 432 RVA: 0x00016C24 File Offset: 0x00015024
public static void TranslateVertices_World(this pb_Object pb, int[] selectedTriangles, Vector3 offset, float snapValue, bool snapAxisOnly, Dictionary<int, int> lookup)
{
int[] array = ((lookup == null) ? pb.sharedIndices.AllIndicesWithValues(selectedTriangles).ToArray<int>() : pb.sharedIndices.AllIndicesWithValues(lookup, selectedTriangles).ToArray<int>());
Matrix4x4 worldToLocalMatrix = pb.transform.worldToLocalMatrix;
Vector3 vector = worldToLocalMatrix * offset;
Vector3[] vertices = pb.vertices;
if (Mathf.Abs(snapValue) > Mathf.Epsilon)
{
Matrix4x4 localToWorldMatrix = pb.transform.localToWorldMatrix;
Vector3 vector2 = Vector3.zero;
Vector3 vector3 = ((!snapAxisOnly) ? Vector3.one : offset.ToMask(0.0001f));
for (int i = 0; i < array.Length; i++)
{
vector2 = localToWorldMatrix.MultiplyPoint3x4(vertices[array[i]] + vector);
vertices[array[i]] = worldToLocalMatrix.MultiplyPoint3x4(pb_Snap.SnapValue(vector2, snapValue * vector3));
}
}
else
{
for (int i = 0; i < array.Length; i++)
{
vertices[array[i]] += vector;
}
}
pb.SetVertices(vertices);
pb.msh.vertices = vertices;
}
// Token: 0x060001B1 RID: 433 RVA: 0x00016D6C File Offset: 0x0001516C
public static void TranslateVertices(this pb_Object pb, int[] selectedTriangles, Vector3 offset)
{
int[] array = pb.sharedIndices.AllIndicesWithValues(selectedTriangles).ToArray<int>();
Vector3[] vertices = pb.vertices;
for (int i = 0; i < array.Length; i++)
{
vertices[array[i]] += offset;
}
pb.SetVertices(vertices);
pb.msh.vertices = vertices;
}
// Token: 0x060001B2 RID: 434 RVA: 0x00016DD8 File Offset: 0x000151D8
public static void SetSharedVertexPosition(this pb_Object pb, int sharedIndex, Vector3 position)
{
Vector3[] vertices = pb.vertices;
int[] array = pb.sharedIndices[sharedIndex].array;
for (int i = 0; i < array.Length; i++)
{
vertices[array[i]] = position;
}
pb.SetVertices(vertices);
pb.msh.vertices = vertices;
}
// Token: 0x060001B3 RID: 435 RVA: 0x00016E30 File Offset: 0x00015230
public static void SetSharedVertexValues(this pb_Object pb, int sharedIndex, pb_Vertex vertex)
{
pb_Vertex[] vertices = pb_Vertex.GetVertices(pb, null);
int[] array = pb.sharedIndices[sharedIndex].array;
for (int i = 0; i < array.Length; i++)
{
vertices[array[i]] = vertex;
}
pb.SetVertices(vertices, false);
}
// Token: 0x060001B4 RID: 436 RVA: 0x00016E78 File Offset: 0x00015278
public static bool FaceWithTriangle(this pb_Object pb, int[] tri, out pb_Face face)
{
for (int i = 0; i < pb.faces.Length; i++)
{
if (pb.faces[i].Contains(tri))
{
face = pb.faces[i];
return true;
}
}
face = null;
return false;
}
// Token: 0x060001B5 RID: 437 RVA: 0x00016EC4 File Offset: 0x000152C4
public static bool FaceWithTriangle(this pb_Object pb, int[] tri, out int face)
{
for (int i = 0; i < pb.faces.Length; i++)
{
if (pb.faces[i].Contains(tri))
{
face = i;
return true;
}
}
face = -1;
return false;
}
}
}
+69
View File
@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000037 RID: 55
[AddComponentMenu("")]
[DisallowMultipleComponent]
[ProGridsConditionalSnap]
public class pb_PolyShape : MonoBehaviour
{
// Token: 0x17000030 RID: 48
// (get) Token: 0x060001B7 RID: 439 RVA: 0x00016F20 File Offset: 0x00015320
// (set) Token: 0x060001B8 RID: 440 RVA: 0x00016F45 File Offset: 0x00015345
public pb_Object mesh
{
get
{
if (this.m_Mesh == null)
{
this.m_Mesh = base.GetComponent<pb_Object>();
}
return this.m_Mesh;
}
set
{
this.m_Mesh = value;
}
}
// Token: 0x060001B9 RID: 441 RVA: 0x00016F4E File Offset: 0x0001534E
private bool IsSnapEnabled()
{
return this.isOnGrid;
}
// Token: 0x0400014C RID: 332
public List<Vector3> points = new List<Vector3>();
// Token: 0x0400014D RID: 333
public float extrude;
// Token: 0x0400014E RID: 334
public pb_PolyShape.PolyEditMode polyEditMode;
// Token: 0x0400014F RID: 335
public bool flipNormals;
// Token: 0x04000150 RID: 336
private pb_Object m_Mesh;
// Token: 0x04000151 RID: 337
public bool isOnGrid = true;
// Token: 0x02000038 RID: 56
public enum PolyEditMode
{
// Token: 0x04000153 RID: 339
None,
// Token: 0x04000154 RID: 340
Path,
// Token: 0x04000155 RID: 341
Height,
// Token: 0x04000156 RID: 342
Edit
}
}
}
@@ -0,0 +1,501 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000039 RID: 57
public class pb_PreferenceDictionary : ScriptableObject, IEnumerable, ISerializationCallbackReceiver, pb_IHasDefault
{
// Token: 0x060001BB RID: 443 RVA: 0x00016FB0 File Offset: 0x000153B0
public void OnBeforeSerialize()
{
this.m_Bool_keys = this.m_Bool.Keys.ToList<string>();
this.m_Int_keys = this.m_Int.Keys.ToList<string>();
this.m_Float_keys = this.m_Float.Keys.ToList<string>();
this.m_String_keys = this.m_String.Keys.ToList<string>();
this.m_Color_keys = this.m_Color.Keys.ToList<string>();
this.m_Material_keys = this.m_Material.Keys.ToList<string>();
this.m_Bool_values = this.m_Bool.Values.ToList<bool>();
this.m_Int_values = this.m_Int.Values.ToList<int>();
this.m_Float_values = this.m_Float.Values.ToList<float>();
this.m_String_values = this.m_String.Values.ToList<string>();
this.m_Color_values = this.m_Color.Values.ToList<Color>();
this.m_Material_values = this.m_Material.Values.ToList<Material>();
}
// Token: 0x060001BC RID: 444 RVA: 0x000170C8 File Offset: 0x000154C8
public void OnAfterDeserialize()
{
for (int i = 0; i < this.m_Bool_keys.Count; i++)
{
this.m_Bool.Add(this.m_Bool_keys[i], this.m_Bool_values[i]);
}
for (int j = 0; j < this.m_Int_keys.Count; j++)
{
this.m_Int.Add(this.m_Int_keys[j], this.m_Int_values[j]);
}
for (int k = 0; k < this.m_Float_keys.Count; k++)
{
this.m_Float.Add(this.m_Float_keys[k], this.m_Float_values[k]);
}
for (int l = 0; l < this.m_String_keys.Count; l++)
{
this.m_String.Add(this.m_String_keys[l], this.m_String_values[l]);
}
for (int m = 0; m < this.m_Color_keys.Count; m++)
{
this.m_Color.Add(this.m_Color_keys[m], this.m_Color_values[m]);
}
for (int n = 0; n < this.m_Material_keys.Count; n++)
{
this.m_Material.Add(this.m_Material_keys[n], this.m_Material_values[n]);
}
}
// Token: 0x17000031 RID: 49
// (get) Token: 0x060001BD RID: 445 RVA: 0x0001725B File Offset: 0x0001565B
public int Length
{
get
{
return 6;
}
}
// Token: 0x060001BE RID: 446 RVA: 0x0001725E File Offset: 0x0001565E
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
// Token: 0x060001BF RID: 447 RVA: 0x00017266 File Offset: 0x00015666
public pb_PreferenceDictionaryEnumerator GetEnumerator()
{
return new pb_PreferenceDictionaryEnumerator(this);
}
// Token: 0x060001C0 RID: 448 RVA: 0x00017270 File Offset: 0x00015670
public void SetDefaultValues()
{
this.m_Bool.Clear();
this.m_Int.Clear();
this.m_Float.Clear();
this.m_String.Clear();
this.m_Color.Clear();
this.m_Material.Clear();
}
// Token: 0x060001C1 RID: 449 RVA: 0x000172C0 File Offset: 0x000156C0
public bool HasKey(string key)
{
return this.m_Bool.ContainsKey(key) || this.m_Int.ContainsKey(key) || this.m_Float.ContainsKey(key) || this.m_String.ContainsKey(key) || this.m_Color.ContainsKey(key) || this.m_Material.ContainsKey(key);
}
// Token: 0x060001C2 RID: 450 RVA: 0x00017334 File Offset: 0x00015734
public bool HasKey<T>(string key)
{
Type typeFromHandle = typeof(T);
if (typeFromHandle == typeof(int))
{
return this.m_Int.ContainsKey(key);
}
if (typeFromHandle == typeof(float))
{
return this.m_Float.ContainsKey(key);
}
if (typeFromHandle == typeof(bool))
{
return this.m_Bool.ContainsKey(key);
}
if (typeFromHandle == typeof(string))
{
return this.m_String.ContainsKey(key);
}
if (typeFromHandle == typeof(Color))
{
return this.m_Color.ContainsKey(key);
}
if (typeFromHandle == typeof(Material))
{
return this.m_Material.ContainsKey(key);
}
Debug.LogWarning(string.Format("HasKey<{0}>({1}) not valid preference type.", typeof(T).ToString(), key));
return false;
}
// Token: 0x060001C3 RID: 451 RVA: 0x0001741C File Offset: 0x0001581C
public void DeleteKey(string key)
{
if (this.m_Bool.ContainsKey(key))
{
this.m_Bool.Remove(key);
}
if (this.m_Int.ContainsKey(key))
{
this.m_Int.Remove(key);
}
if (this.m_Float.ContainsKey(key))
{
this.m_Float.Remove(key);
}
if (this.m_String.ContainsKey(key))
{
this.m_String.Remove(key);
}
if (this.m_Color.ContainsKey(key))
{
this.m_Color.Remove(key);
}
if (this.m_Material.ContainsKey(key))
{
this.m_Material.Remove(key);
}
}
// Token: 0x060001C4 RID: 452 RVA: 0x000174E0 File Offset: 0x000158E0
public T Get<T>(string key, T fallback = default(T))
{
Type typeFromHandle = typeof(T);
if (typeFromHandle == typeof(int))
{
if (this.m_Int.ContainsKey(key))
{
return (T)((object)this.GetInt(key, 0));
}
}
else if (typeFromHandle == typeof(float))
{
if (this.m_Float.ContainsKey(key))
{
return (T)((object)this.GetFloat(key, 0f));
}
}
else if (typeFromHandle == typeof(bool))
{
if (this.m_Bool.ContainsKey(key))
{
return (T)((object)this.GetBool(key, false));
}
}
else if (typeFromHandle == typeof(string))
{
if (this.m_String.ContainsKey(key))
{
return (T)((object)this.GetString(key, null));
}
}
else if (typeFromHandle == typeof(Color))
{
if (this.m_Color.ContainsKey(key))
{
return (T)((object)this.GetColor(key, default(Color)));
}
}
else if (typeFromHandle == typeof(Material))
{
if (this.m_Material.ContainsKey(key))
{
return (T)((object)this.GetMaterial(key, null));
}
}
else
{
Debug.LogWarning(string.Format("Get<{0}>({1}) not valid preference type.", typeof(T).ToString(), key));
}
return fallback;
}
// Token: 0x060001C5 RID: 453 RVA: 0x00017670 File Offset: 0x00015A70
public void Set<T>(string key, T value)
{
object obj = value;
if (value is int)
{
this.SetInt(key, (int)obj);
}
else if (value is float)
{
this.SetFloat(key, (float)obj);
}
else if (value is bool)
{
this.SetBool(key, (bool)obj);
}
else if (value is string)
{
this.SetString(key, (string)obj);
}
else if (value is Color)
{
this.SetColor(key, (Color)obj);
}
else if (value is Material)
{
this.SetMaterial(key, (Material)obj);
}
else
{
Debug.LogWarning(string.Format("Set<{0}>({1}, {2}) not valid preference type.", typeof(T).ToString(), key, value.ToString()));
}
}
// Token: 0x060001C6 RID: 454 RVA: 0x0001777C File Offset: 0x00015B7C
public bool GetBool(string key, bool fallback = false)
{
bool flag;
if (this.m_Bool.TryGetValue(key, out flag))
{
return flag;
}
return fallback;
}
// Token: 0x060001C7 RID: 455 RVA: 0x000177A0 File Offset: 0x00015BA0
public int GetInt(string key, int fallback = 0)
{
int num;
if (this.m_Int.TryGetValue(key, out num))
{
return num;
}
return fallback;
}
// Token: 0x060001C8 RID: 456 RVA: 0x000177C4 File Offset: 0x00015BC4
public float GetFloat(string key, float fallback = 0f)
{
float num;
if (this.m_Float.TryGetValue(key, out num))
{
return num;
}
return fallback;
}
// Token: 0x060001C9 RID: 457 RVA: 0x000177E8 File Offset: 0x00015BE8
public string GetString(string key, string fallback = null)
{
string text;
if (this.m_String.TryGetValue(key, out text))
{
return text;
}
return fallback;
}
// Token: 0x060001CA RID: 458 RVA: 0x0001780C File Offset: 0x00015C0C
public Color GetColor(string key, Color fallback = default(Color))
{
Color color;
if (this.m_Color.TryGetValue(key, out color))
{
return color;
}
return fallback;
}
// Token: 0x060001CB RID: 459 RVA: 0x00017830 File Offset: 0x00015C30
public Material GetMaterial(string key, Material fallback = null)
{
Material material;
if (this.m_Material.TryGetValue(key, out material))
{
return material;
}
return fallback;
}
// Token: 0x060001CC RID: 460 RVA: 0x00017853 File Offset: 0x00015C53
public void SetBool(string key, bool value)
{
if (this.m_Bool.ContainsKey(key))
{
this.m_Bool[key] = value;
}
else
{
this.m_Bool.Add(key, value);
}
}
// Token: 0x060001CD RID: 461 RVA: 0x00017885 File Offset: 0x00015C85
public void SetInt(string key, int value)
{
if (this.m_Int.ContainsKey(key))
{
this.m_Int[key] = value;
}
else
{
this.m_Int.Add(key, value);
}
}
// Token: 0x060001CE RID: 462 RVA: 0x000178B7 File Offset: 0x00015CB7
public void SetFloat(string key, float value)
{
if (this.m_Float.ContainsKey(key))
{
this.m_Float[key] = value;
}
else
{
this.m_Float.Add(key, value);
}
}
// Token: 0x060001CF RID: 463 RVA: 0x000178E9 File Offset: 0x00015CE9
public void SetString(string key, string value)
{
if (this.m_String.ContainsKey(key))
{
this.m_String[key] = value;
}
else
{
this.m_String.Add(key, value);
}
}
// Token: 0x060001D0 RID: 464 RVA: 0x0001791B File Offset: 0x00015D1B
public void SetColor(string key, Color value)
{
if (this.m_Color.ContainsKey(key))
{
this.m_Color[key] = value;
}
else
{
this.m_Color.Add(key, value);
}
}
// Token: 0x060001D1 RID: 465 RVA: 0x0001794D File Offset: 0x00015D4D
public void SetMaterial(string key, Material value)
{
if (this.m_Material.ContainsKey(key))
{
this.m_Material[key] = value;
}
else
{
this.m_Material.Add(key, value);
}
}
// Token: 0x060001D2 RID: 466 RVA: 0x0001797F File Offset: 0x00015D7F
public Dictionary<string, bool> GetBoolDictionary()
{
return this.m_Bool;
}
// Token: 0x060001D3 RID: 467 RVA: 0x00017987 File Offset: 0x00015D87
public Dictionary<string, int> GetIntDictionary()
{
return this.m_Int;
}
// Token: 0x060001D4 RID: 468 RVA: 0x0001798F File Offset: 0x00015D8F
public Dictionary<string, float> GetFloatDictionary()
{
return this.m_Float;
}
// Token: 0x060001D5 RID: 469 RVA: 0x00017997 File Offset: 0x00015D97
public Dictionary<string, string> GetStringDictionary()
{
return this.m_String;
}
// Token: 0x060001D6 RID: 470 RVA: 0x0001799F File Offset: 0x00015D9F
public Dictionary<string, Color> GetColorDictionary()
{
return this.m_Color;
}
// Token: 0x060001D7 RID: 471 RVA: 0x000179A7 File Offset: 0x00015DA7
public Dictionary<string, Material> GetMaterialDictionary()
{
return this.m_Material;
}
// Token: 0x060001D8 RID: 472 RVA: 0x000179AF File Offset: 0x00015DAF
public void Clear()
{
this.m_Bool.Clear();
this.m_Int.Clear();
this.m_Float.Clear();
this.m_String.Clear();
this.m_Color.Clear();
}
// Token: 0x04000157 RID: 343
private Dictionary<string, bool> m_Bool = new Dictionary<string, bool>();
// Token: 0x04000158 RID: 344
private Dictionary<string, int> m_Int = new Dictionary<string, int>();
// Token: 0x04000159 RID: 345
private Dictionary<string, float> m_Float = new Dictionary<string, float>();
// Token: 0x0400015A RID: 346
private Dictionary<string, string> m_String = new Dictionary<string, string>();
// Token: 0x0400015B RID: 347
private Dictionary<string, Color> m_Color = new Dictionary<string, Color>();
// Token: 0x0400015C RID: 348
private Dictionary<string, Material> m_Material = new Dictionary<string, Material>();
// Token: 0x0400015D RID: 349
[SerializeField]
private List<string> m_Bool_keys;
// Token: 0x0400015E RID: 350
[SerializeField]
private List<string> m_Int_keys;
// Token: 0x0400015F RID: 351
[SerializeField]
private List<string> m_Float_keys;
// Token: 0x04000160 RID: 352
[SerializeField]
private List<string> m_String_keys;
// Token: 0x04000161 RID: 353
[SerializeField]
private List<string> m_Color_keys;
// Token: 0x04000162 RID: 354
[SerializeField]
private List<string> m_Material_keys;
// Token: 0x04000163 RID: 355
[SerializeField]
private List<bool> m_Bool_values;
// Token: 0x04000164 RID: 356
[SerializeField]
private List<int> m_Int_values;
// Token: 0x04000165 RID: 357
[SerializeField]
private List<float> m_Float_values;
// Token: 0x04000166 RID: 358
[SerializeField]
private List<string> m_String_values;
// Token: 0x04000167 RID: 359
[SerializeField]
private List<Color> m_Color_values;
// Token: 0x04000168 RID: 360
[SerializeField]
private List<Material> m_Material_values;
}
}
@@ -0,0 +1,78 @@
using System;
using System.Collections;
namespace ProBuilder2.Common
{
// Token: 0x0200003A RID: 58
public class pb_PreferenceDictionaryEnumerator : IEnumerator
{
// Token: 0x060001D9 RID: 473 RVA: 0x000179E8 File Offset: 0x00015DE8
public pb_PreferenceDictionaryEnumerator(pb_PreferenceDictionary dictionary)
{
this.m_Preferences = dictionary;
}
// Token: 0x060001DA RID: 474 RVA: 0x000179FE File Offset: 0x00015DFE
public bool MoveNext()
{
this.m_Position++;
return this.m_Position < this.m_Preferences.Length;
}
// Token: 0x060001DB RID: 475 RVA: 0x00017A21 File Offset: 0x00015E21
public void Reset()
{
this.m_Position = -1;
}
// Token: 0x17000032 RID: 50
// (get) Token: 0x060001DC RID: 476 RVA: 0x00017A2A File Offset: 0x00015E2A
object IEnumerator.Current
{
get
{
return this.Current;
}
}
// Token: 0x17000033 RID: 51
// (get) Token: 0x060001DD RID: 477 RVA: 0x00017A34 File Offset: 0x00015E34
public IEnumerable Current
{
get
{
if (this.m_Position == 0)
{
return this.m_Preferences.GetBoolDictionary();
}
if (this.m_Position == 1)
{
return this.m_Preferences.GetIntDictionary();
}
if (this.m_Position == 2)
{
return this.m_Preferences.GetFloatDictionary();
}
if (this.m_Position == 3)
{
return this.m_Preferences.GetStringDictionary();
}
if (this.m_Position == 4)
{
return this.m_Preferences.GetColorDictionary();
}
if (this.m_Position == 5)
{
return this.m_Preferences.GetMaterialDictionary();
}
throw new InvalidOperationException();
}
}
// Token: 0x04000169 RID: 361
private int m_Position = -1;
// Token: 0x0400016A RID: 362
private pb_PreferenceDictionary m_Preferences;
}
}
+286
View File
@@ -0,0 +1,286 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x0200003B RID: 59
public static class pb_Projection
{
// Token: 0x060001DE RID: 478 RVA: 0x00017AD5 File Offset: 0x00015ED5
public static Vector2[] PlanarProject(IList<Vector3> verts, Vector3 planeNormal)
{
return pb_Projection.PlanarProject(verts.ToArray<Vector3>(), planeNormal, pb_Projection.VectorToProjectionAxis(planeNormal), null);
}
// Token: 0x060001DF RID: 479 RVA: 0x00017AEC File Offset: 0x00015EEC
public static Vector2[] PlanarProject(pb_Object pb, pb_Face face)
{
Vector3 vector = pb_Math.Normal(pb, face);
return pb_Projection.PlanarProject(pb.vertices, vector, pb_Projection.VectorToProjectionAxis(vector), face.indices);
}
// Token: 0x060001E0 RID: 480 RVA: 0x00017B1C File Offset: 0x00015F1C
public static Vector2[] PlanarProject(IList<pb_Vertex> vertices, IList<int> indices)
{
int count = indices.Count;
Vector3[] array = new Vector3[count];
for (int i = 0; i < count; i++)
{
array[i] = vertices[indices[i]].position;
}
Vector3 vector = pb_Math.Normal(vertices, indices);
ProjectionAxis projectionAxis = pb_Projection.VectorToProjectionAxis(vector);
return pb_Projection.PlanarProject(array, vector, projectionAxis, null);
}
// Token: 0x060001E1 RID: 481 RVA: 0x00017B84 File Offset: 0x00015F84
public static Vector2[] PlanarProject(Vector3[] verts, Vector3 planeNormal, ProjectionAxis projectionAxis, int[] indices = null)
{
int num = ((indices != null && indices.Length >= 1) ? indices.Length : verts.Length);
Vector2[] array = new Vector2[num];
Vector3 vector = Vector3.zero;
switch (projectionAxis)
{
case ProjectionAxis.X:
case ProjectionAxis.X_Negative:
vector = Vector3.up;
break;
case ProjectionAxis.Y:
case ProjectionAxis.Y_Negative:
vector = Vector3.forward;
break;
case ProjectionAxis.Z:
case ProjectionAxis.Z_Negative:
vector = Vector3.up;
break;
}
Vector3 vector2 = Vector3.Cross(planeNormal, vector);
vector2.Normalize();
Vector3 vector3 = Vector3.Cross(vector2, planeNormal);
vector3.Normalize();
for (int i = 0; i < num; i++)
{
int num2 = ((indices == null) ? i : indices[i]);
float num3 = Vector3.Dot(vector2, verts[num2]);
float num4 = Vector3.Dot(vector3, verts[num2]);
array[i] = new Vector2(num3, num4);
}
return array;
}
// Token: 0x060001E2 RID: 482 RVA: 0x00017C88 File Offset: 0x00016088
public static void PlanarProject(Vector3[] verts, Vector2[] uvs, int[] indices, Vector3 planeNormal, ProjectionAxis projectionAxis)
{
Vector3 vector;
switch (projectionAxis)
{
case ProjectionAxis.X:
case ProjectionAxis.X_Negative:
vector = Vector3.up;
break;
case ProjectionAxis.Y:
case ProjectionAxis.Y_Negative:
vector = Vector3.forward;
break;
case ProjectionAxis.Z:
case ProjectionAxis.Z_Negative:
vector = Vector3.up;
break;
default:
vector = Vector3.up;
break;
}
pb_Math.Cross(planeNormal, vector, ref pb_Projection.t_uaxis.x, ref pb_Projection.t_uaxis.y, ref pb_Projection.t_uaxis.z);
pb_Projection.t_uaxis.Normalize();
pb_Math.Cross(pb_Projection.t_uaxis, planeNormal, ref pb_Projection.t_vaxis.x, ref pb_Projection.t_vaxis.y, ref pb_Projection.t_vaxis.z);
pb_Projection.t_vaxis.Normalize();
int num = indices.Length;
for (int i = 0; i < num; i++)
{
int num2 = indices[i];
uvs[num2].x = Vector3.Dot(pb_Projection.t_uaxis, verts[num2]);
uvs[num2].y = Vector3.Dot(pb_Projection.t_vaxis, verts[num2]);
}
}
// Token: 0x060001E3 RID: 483 RVA: 0x00017DA8 File Offset: 0x000161A8
public static Vector2[] SphericalProject(IList<Vector3> vertices, IList<int> indices = null)
{
int num = ((indices != null) ? indices.Count : vertices.Count);
Vector2[] array = new Vector2[num];
Vector3 vector = pb_Math.Average(vertices, indices);
for (int i = 0; i < num; i++)
{
int num2 = ((indices != null) ? indices[i] : i);
Vector3 vector2 = vertices[num2] - vector;
vector2.Normalize();
array[i].x = 0.5f + Mathf.Atan2(vector2.z, vector2.x) / 6.2831855f;
array[i].y = 0.5f - Mathf.Asin(vector2.y) / 3.1415927f;
}
return array;
}
// Token: 0x060001E4 RID: 484 RVA: 0x00017E6C File Offset: 0x0001626C
public static IList<Vector2> Sort(IList<Vector2> verts, SortMethod method = SortMethod.CounterClockwise)
{
Vector2 vector = pb_Math.Average(verts, null);
Vector2 up = Vector2.up;
int count = verts.Count;
List<pb_Tuple<float, Vector2>> list = new List<pb_Tuple<float, Vector2>>(count);
for (int i = 0; i < count; i++)
{
list.Add(new pb_Tuple<float, Vector2>(pb_Math.SignedAngle(up, verts[i] - vector), verts[i]));
}
list.Sort((pb_Tuple<float, Vector2> a, pb_Tuple<float, Vector2> b) => (a.Item1 >= b.Item1) ? 1 : (-1));
IList<Vector2> list2 = list.Select((pb_Tuple<float, Vector2> x) => x.Item2).ToList<Vector2>();
if (method == SortMethod.Clockwise)
{
list2.Reverse<Vector2>();
}
return list2;
}
// Token: 0x060001E5 RID: 485 RVA: 0x00017F30 File Offset: 0x00016330
public static Vector3 ProjectionAxisToVector(ProjectionAxis axis)
{
switch (axis)
{
case ProjectionAxis.X:
return Vector3.right;
case ProjectionAxis.Y:
return Vector3.up;
case ProjectionAxis.Z:
return Vector3.forward;
case ProjectionAxis.X_Negative:
return -Vector3.right;
case ProjectionAxis.Y_Negative:
return -Vector3.up;
case ProjectionAxis.Z_Negative:
return -Vector3.forward;
default:
return Vector3.zero;
}
}
// Token: 0x060001E6 RID: 486 RVA: 0x00017F98 File Offset: 0x00016398
public static ProjectionAxis VectorToProjectionAxis(Vector3 plane)
{
if (Mathf.Abs(plane.x) > Mathf.Abs(plane.y) && Mathf.Abs(plane.x) > Mathf.Abs(plane.z))
{
return (plane.x <= 0f) ? ProjectionAxis.X_Negative : ProjectionAxis.X;
}
if (Mathf.Abs(plane.y) > Mathf.Abs(plane.z))
{
return (plane.y <= 0f) ? ProjectionAxis.Y_Negative : ProjectionAxis.Y;
}
return (plane.z <= 0f) ? ProjectionAxis.Z_Negative : ProjectionAxis.Z;
}
// Token: 0x060001E7 RID: 487 RVA: 0x00018048 File Offset: 0x00016448
public static Plane FindBestPlane<T>(IList<T> points, Func<T, Vector3> selector, IList<int> indices = null)
{
float num = 0f;
float num2 = 0f;
float num3 = 0f;
float num4 = 0f;
float num5 = 0f;
float num6 = 0f;
bool flag = indices != null && indices.Count > 0;
int num7 = ((!flag) ? points.Count : indices.Count);
Vector3 vector = points.Average(selector, indices);
for (int i = 0; i < num7; i++)
{
Vector3 vector2 = selector(points[(!flag) ? i : indices[i]]) - vector;
num += vector2.x * vector2.x;
num2 += vector2.x * vector2.y;
num3 += vector2.x * vector2.z;
num4 += vector2.y * vector2.y;
num5 += vector2.y * vector2.z;
num6 += vector2.z * vector2.z;
}
float num8 = num4 * num6 - num5 * num5;
float num9 = num * num6 - num3 * num3;
float num10 = num * num4 - num2 * num2;
Vector3 vector3;
if (num8 > num9 && num8 > num10)
{
vector3 = new Vector3(1f, (num3 * num5 - num2 * num6) / num8, (num2 * num5 - num3 * num4) / num8);
}
else if (num9 > num10)
{
vector3 = new Vector3((num5 * num3 - num2 * num6) / num9, 1f, (num2 * num3 - num5 * num) / num9);
}
else
{
vector3 = new Vector3((num5 * num2 - num3 * num4) / num10, (num3 * num2 - num5 * num) / num10, 1f);
}
vector3.Normalize();
return new Plane(vector3, vector);
}
// Token: 0x060001E8 RID: 488 RVA: 0x00018224 File Offset: 0x00016624
public static Plane FindBestPlane(Vector3[] points, int[] indices = null)
{
float num = 0f;
float num2 = 0f;
float num3 = 0f;
float num4 = 0f;
float num5 = 0f;
float num6 = 0f;
bool flag = indices != null && indices.Length > 0;
int num7 = ((!flag) ? points.Length : indices.Length);
Vector3 zero = Vector3.zero;
Vector3 zero2 = Vector3.zero;
for (int i = 0; i < num7; i++)
{
zero.x += points[(!flag) ? i : indices[i]].x;
zero.y += points[(!flag) ? i : indices[i]].y;
zero.z += points[(!flag) ? i : indices[i]].z;
}
zero.x /= (float)num7;
zero.y /= (float)num7;
zero.z /= (float)num7;
for (int j = 0; j < num7; j++)
{
Vector3 vector = points[(!flag) ? j : indices[j]] - zero;
num += vector.x * vector.x;
num2 += vector.x * vector.y;
num3 += vector.x * vector.z;
num4 += vector.y * vector.y;
num5 += vector.y * vector.z;
num6 += vector.z * vector.z;
}
float num8 = num4 * num6 - num5 * num5;
float num9 = num * num6 - num3 * num3;
float num10 = num * num4 - num2 * num2;
if (num8 > num9 && num8 > num10)
{
zero2.x = 1f;
zero2.y = (num3 * num5 - num2 * num6) / num8;
zero2.z = (num2 * num5 - num3 * num4) / num8;
}
else if (num9 > num10)
{
zero2.x = (num5 * num3 - num2 * num6) / num9;
zero2.y = 1f;
zero2.z = (num2 * num3 - num5 * num) / num9;
}
else
{
zero2.x = (num5 * num2 - num3 * num4) / num10;
zero2.y = (num3 * num2 - num5 * num) / num10;
zero2.z = 1f;
}
zero2.Normalize();
return new Plane(zero2, zero);
}
// Token: 0x0400016B RID: 363
private static Vector3 t_uaxis = Vector3.zero;
// Token: 0x0400016C RID: 364
private static Vector3 t_vaxis = Vector3.zero;
}
}
+30
View File
@@ -0,0 +1,30 @@
using System;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000051 RID: 81
public class pb_RaycastHit
{
// Token: 0x0600027B RID: 635 RVA: 0x0001F698 File Offset: 0x0001DA98
public pb_RaycastHit(float InDistance, Vector3 InPoint, Vector3 InNormal, int InFaceIndex)
{
this.distance = InDistance;
this.point = InPoint;
this.normal = InNormal;
this.face = InFaceIndex;
}
// Token: 0x040001BF RID: 447
public float distance;
// Token: 0x040001C0 RID: 448
public Vector3 point;
// Token: 0x040001C1 RID: 449
public Vector3 normal;
// Token: 0x040001C2 RID: 450
public int face;
}
}
+65
View File
@@ -0,0 +1,65 @@
using System;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000052 RID: 82
[Serializable]
public class pb_Renderable : ScriptableObject
{
// Token: 0x0600027D RID: 637 RVA: 0x0001F6C8 File Offset: 0x0001DAC8
public static pb_Renderable CreateInstance(Mesh InMesh, Material[] InMaterials, Transform transform = null)
{
pb_Renderable pb_Renderable = ScriptableObject.CreateInstance<pb_Renderable>();
pb_Renderable.mesh = InMesh;
pb_Renderable.materials = InMaterials;
pb_Renderable.transform = transform;
return pb_Renderable;
}
// Token: 0x0600027E RID: 638 RVA: 0x0001F6F4 File Offset: 0x0001DAF4
public static pb_Renderable CreateInstance(Mesh InMesh, Material InMaterial, Transform transform = null)
{
pb_Renderable pb_Renderable = ScriptableObject.CreateInstance<pb_Renderable>();
pb_Renderable.mesh = InMesh;
pb_Renderable.materials = new Material[] { InMaterial };
pb_Renderable.transform = transform;
return pb_Renderable;
}
// Token: 0x0600027F RID: 639 RVA: 0x0001F728 File Offset: 0x0001DB28
public static pb_Renderable CreateInstance()
{
pb_Renderable pb_Renderable = pb_Renderable.CreateInstance(new Mesh(), null, null);
pb_Renderable.mesh.name = "pb_Renderable::Mesh";
pb_Renderable.mesh.hideFlags = HideFlags.DontSave;
pb_Renderable.mesh.MarkDynamic();
pb_Renderable.hideFlags = HideFlags.DontSave;
return pb_Renderable;
}
// Token: 0x06000280 RID: 640 RVA: 0x0001F773 File Offset: 0x0001DB73
public static void DestroyInstance(global::UnityEngine.Object ren)
{
global::UnityEngine.Object.DestroyImmediate(ren);
}
// Token: 0x06000281 RID: 641 RVA: 0x0001F77B File Offset: 0x0001DB7B
private void OnDestroy()
{
if (this.mesh != null)
{
global::UnityEngine.Object.DestroyImmediate(this.mesh);
}
}
// Token: 0x040001C3 RID: 451
public Mesh mesh;
// Token: 0x040001C4 RID: 452
public Material[] materials;
// Token: 0x040001C5 RID: 453
public Transform transform;
}
}
+352
View File
@@ -0,0 +1,352 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Rendering;
namespace ProBuilder2.Common
{
// Token: 0x0200003C RID: 60
public static class pb_SelectionPicker
{
// Token: 0x17000034 RID: 52
// (get) Token: 0x060001EC RID: 492 RVA: 0x00018520 File Offset: 0x00016920
private static RenderTextureFormat renderTextureFormat
{
get
{
if (pb_SelectionPicker.m_Initialized)
{
return pb_SelectionPicker.m_RenderTextureFormat;
}
pb_SelectionPicker.m_Initialized = true;
for (int i = 0; i < pb_SelectionPicker.m_PreferredFormats.Length; i++)
{
if (SystemInfo.SupportsRenderTextureFormat(pb_SelectionPicker.m_PreferredFormats[i]))
{
pb_SelectionPicker.m_RenderTextureFormat = pb_SelectionPicker.m_PreferredFormats[i];
break;
}
}
return pb_SelectionPicker.m_RenderTextureFormat;
}
}
// Token: 0x17000035 RID: 53
// (get) Token: 0x060001ED RID: 493 RVA: 0x00018582 File Offset: 0x00016982
private static TextureFormat textureFormat
{
get
{
return TextureFormat.ARGB32;
}
}
// Token: 0x060001EE RID: 494 RVA: 0x00018588 File Offset: 0x00016988
public static Dictionary<pb_Object, HashSet<pb_Face>> PickFacesInRect(Camera camera, Rect pickerRect, IEnumerable<pb_Object> selection, int renderTextureWidth = -1, int renderTextureHeight = -1)
{
Dictionary<uint, pb_Tuple<pb_Object, pb_Face>> dictionary;
Texture2D texture2D = pb_SelectionPicker.RenderSelectionPickerTexture(camera, selection, out dictionary, renderTextureWidth, renderTextureHeight);
Color32[] pixels = texture2D.GetPixels32();
int num = Math.Max(0, Mathf.FloorToInt(pickerRect.x));
int num2 = Math.Max(0, Mathf.FloorToInt((float)texture2D.height - pickerRect.y - pickerRect.height));
int width = texture2D.width;
int height = texture2D.height;
int num3 = Mathf.FloorToInt(pickerRect.width);
int num4 = Mathf.FloorToInt(pickerRect.height);
global::UnityEngine.Object.DestroyImmediate(texture2D);
Dictionary<pb_Object, HashSet<pb_Face>> dictionary2 = new Dictionary<pb_Object, HashSet<pb_Face>>();
HashSet<pb_Face> hashSet = null;
HashSet<uint> hashSet2 = new HashSet<uint>();
for (int i = num2; i < Math.Min(num2 + num4, height); i++)
{
for (int j = num; j < Math.Min(num + num3, width); j++)
{
uint num5 = pb_SelectionPicker.DecodeRGBA(pixels[i * width + j]);
pb_Tuple<pb_Object, pb_Face> pb_Tuple;
if (hashSet2.Add(num5) && dictionary.TryGetValue(num5, out pb_Tuple))
{
if (dictionary2.TryGetValue(pb_Tuple.Item1, out hashSet))
{
hashSet.Add(pb_Tuple.Item2);
}
else
{
dictionary2.Add(pb_Tuple.Item1, new HashSet<pb_Face> { pb_Tuple.Item2 });
}
}
}
}
return dictionary2;
}
// Token: 0x060001EF RID: 495 RVA: 0x000186F0 File Offset: 0x00016AF0
public static Dictionary<pb_Object, HashSet<int>> PickVerticesInRect(Camera camera, Rect pickerRect, IEnumerable<pb_Object> selection, int renderTextureWidth = -1, int renderTextureHeight = -1)
{
Dictionary<pb_Object, HashSet<int>> dictionary = new Dictionary<pb_Object, HashSet<int>>();
Dictionary<uint, pb_Tuple<pb_Object, int>> dictionary2;
Texture2D texture2D = pb_SelectionPicker.RenderSelectionPickerTexture(camera, selection, out dictionary2, renderTextureWidth, renderTextureHeight);
Color32[] pixels = texture2D.GetPixels32();
int num = Math.Max(0, Mathf.FloorToInt(pickerRect.x));
int num2 = Math.Max(0, Mathf.FloorToInt((float)texture2D.height - pickerRect.y - pickerRect.height));
int width = texture2D.width;
int height = texture2D.height;
int num3 = Mathf.FloorToInt(pickerRect.width);
int num4 = Mathf.FloorToInt(pickerRect.height);
global::UnityEngine.Object.DestroyImmediate(texture2D);
HashSet<int> hashSet = null;
HashSet<uint> hashSet2 = new HashSet<uint>();
for (int i = num2; i < Math.Min(num2 + num4, height); i++)
{
for (int j = num; j < Math.Min(num + num3, width); j++)
{
uint num5 = pb_SelectionPicker.DecodeRGBA(pixels[i * width + j]);
pb_Tuple<pb_Object, int> pb_Tuple;
if (hashSet2.Add(num5) && dictionary2.TryGetValue(num5, out pb_Tuple))
{
if (dictionary.TryGetValue(pb_Tuple.Item1, out hashSet))
{
hashSet.Add(pb_Tuple.Item2);
}
else
{
dictionary.Add(pb_Tuple.Item1, new HashSet<int> { pb_Tuple.Item2 });
}
}
}
}
return dictionary;
}
// Token: 0x060001F0 RID: 496 RVA: 0x00018854 File Offset: 0x00016C54
public static Texture2D RenderSelectionPickerTexture(Camera camera, IEnumerable<pb_Object> selection, out Dictionary<uint, pb_Tuple<pb_Object, pb_Face>> map, int width = -1, int height = -1)
{
List<GameObject> list = pb_SelectionPicker.GenerateFaceDepthTestMeshes(selection, out map);
Texture2D texture2D = pb_SelectionPicker.RenderWithReplacementShader(camera, pb_Constant.SelectionPickerShader, "ProBuilderPicker", width, height);
foreach (GameObject gameObject in list)
{
global::UnityEngine.Object.DestroyImmediate(gameObject.GetComponent<MeshFilter>().sharedMesh);
global::UnityEngine.Object.DestroyImmediate(gameObject);
}
return texture2D;
}
// Token: 0x060001F1 RID: 497 RVA: 0x000188D8 File Offset: 0x00016CD8
public static Texture2D RenderSelectionPickerTexture(Camera camera, IEnumerable<pb_Object> selection, out Dictionary<uint, pb_Tuple<pb_Object, int>> map, int width = -1, int height = -1)
{
List<GameObject> list = pb_SelectionPicker.GenerateVertexDepthTestMeshes(selection, out map);
Texture2D texture2D = pb_SelectionPicker.RenderWithReplacementShader(camera, pb_Constant.SelectionPickerShader, "ProBuilderPicker", width, height);
foreach (GameObject gameObject in list)
{
global::UnityEngine.Object.DestroyImmediate(gameObject.GetComponent<MeshFilter>().sharedMesh);
global::UnityEngine.Object.DestroyImmediate(gameObject);
}
return texture2D;
}
// Token: 0x060001F2 RID: 498 RVA: 0x0001895C File Offset: 0x00016D5C
public static List<GameObject> GenerateFaceDepthTestMeshes(IEnumerable<pb_Object> selection, out Dictionary<uint, pb_Tuple<pb_Object, pb_Face>> map)
{
List<GameObject> list = new List<GameObject>();
map = new Dictionary<uint, pb_Tuple<pb_Object, pb_Face>>();
uint num = 0U;
foreach (pb_Object pb_Object in selection)
{
GameObject gameObject = new GameObject();
gameObject.name = pb_Object.name + " (Face Depth Test)";
gameObject.transform.position = pb_Object.transform.position;
gameObject.transform.localRotation = pb_Object.transform.localRotation;
gameObject.transform.localScale = pb_Object.transform.localScale;
Mesh mesh = new Mesh();
mesh.vertices = pb_Object.vertices;
mesh.triangles = pb_Object.faces.SelectMany((pb_Face x) => x.indices).ToArray<int>();
Color32[] array = new Color32[mesh.vertexCount];
foreach (pb_Face pb_Face in pb_Object.faces)
{
Color32 color = pb_SelectionPicker.EncodeRGBA(num++);
map.Add(pb_SelectionPicker.DecodeRGBA(color), new pb_Tuple<pb_Object, pb_Face>(pb_Object, pb_Face));
for (int j = 0; j < pb_Face.distinctIndices.Length; j++)
{
array[pb_Face.distinctIndices[j]] = color;
}
}
mesh.colors32 = array;
try
{
gameObject.AddComponent<MeshFilter>().sharedMesh = mesh;
gameObject.AddComponent<MeshRenderer>().sharedMaterial = pb_Constant.FacePickerMaterial;
}
catch
{
Debug.LogWarning("Could not find shader `pb_FacePicker.shader`. Please re-import ProBuilder to fix!");
}
list.Add(gameObject);
}
return list;
}
// Token: 0x060001F3 RID: 499 RVA: 0x00018B5C File Offset: 0x00016F5C
private static List<GameObject> GenerateVertexDepthTestMeshes(IEnumerable<pb_Object> selection, out Dictionary<uint, pb_Tuple<pb_Object, int>> map)
{
List<GameObject> list = new List<GameObject>();
map = new Dictionary<uint, pb_Tuple<pb_Object, int>>();
Color32 color = new Color32(0, 0, 0, byte.MaxValue);
uint num = 2U;
foreach (pb_Object pb_Object in selection)
{
GameObject gameObject = pbUtil.EmptyGameObjectWithTransform(pb_Object.transform);
gameObject.name = pb_Object.name + " (Depth Mask)";
Mesh mesh = new Mesh();
mesh.vertices = pb_Object.vertices;
mesh.triangles = pb_Object.faces.SelectMany((pb_Face x) => x.indices).ToArray<int>();
mesh.colors32 = pbUtil.Fill<Color32>(color, pb_Object.vertexCount);
gameObject.AddComponent<MeshFilter>().sharedMesh = mesh;
gameObject.AddComponent<MeshRenderer>().sharedMaterial = pb_Constant.FacePickerMaterial;
list.Add(gameObject);
GameObject gameObject2 = pbUtil.EmptyGameObjectWithTransform(pb_Object.transform);
gameObject2.name = pb_Object.name + " (Vertex Billboards)";
gameObject2.AddComponent<MeshFilter>().sharedMesh = pb_SelectionPicker.BuildVertexMesh(pb_Object, map, ref num);
gameObject2.AddComponent<MeshRenderer>().sharedMaterial = pb_Constant.VertexPickerMaterial;
list.Add(gameObject2);
}
return list;
}
// Token: 0x060001F4 RID: 500 RVA: 0x00018CD4 File Offset: 0x000170D4
private static Mesh BuildVertexMesh(pb_Object pb, Dictionary<uint, pb_Tuple<pb_Object, int>> map, ref uint index)
{
int num = Math.Min(pb.sharedIndices.Length, 16382);
Vector3[] array = new Vector3[num * 4];
Vector2[] array2 = new Vector2[num * 4];
Vector2[] array3 = new Vector2[num * 4];
Color[] array4 = new Color[num * 4];
int[] array5 = new int[num * 6];
int num2 = 0;
int num3 = 0;
Vector3 up = Vector3.up;
Vector3 right = Vector3.right;
for (int i = 0; i < num; i++)
{
Vector3 vector = pb.vertices[pb.sharedIndices[i][0]];
array[num3] = vector;
array[num3 + 1] = vector;
array[num3 + 2] = vector;
array[num3 + 3] = vector;
array2[num3] = Vector3.zero;
array2[num3 + 1] = Vector3.right;
array2[num3 + 2] = Vector3.up;
array2[num3 + 3] = Vector3.one;
array3[num3] = -up - right;
array3[num3 + 1] = -up + right;
array3[num3 + 2] = up - right;
array3[num3 + 3] = up + right;
array5[num2] = num3;
array5[num2 + 1] = num3 + 1;
array5[num2 + 2] = num3 + 2;
array5[num2 + 3] = num3 + 1;
array5[num2 + 4] = num3 + 3;
array5[num2 + 5] = num3 + 2;
Color32 color = pb_SelectionPicker.EncodeRGBA(index);
uint num4;
index = (num4 = index) + 1U;
map.Add(num4, new pb_Tuple<pb_Object, int>(pb, i));
array4[num3] = color;
array4[num3 + 1] = color;
array4[num3 + 2] = color;
array4[num3 + 3] = color;
num3 += 4;
num2 += 6;
}
return new Mesh
{
name = "Vertex Billboard",
vertices = array,
uv = array2,
uv2 = array3,
colors = array4,
triangles = array5
};
}
// Token: 0x060001F5 RID: 501 RVA: 0x00018F94 File Offset: 0x00017394
public static uint DecodeRGBA(Color32 color)
{
uint r = (uint)color.r;
uint g = (uint)color.g;
uint b = (uint)color.b;
if (BitConverter.IsLittleEndian)
{
return (r << 16) | (g << 8) | b;
}
return (r << 24) | (g << 16) | (b << 8);
}
// Token: 0x060001F6 RID: 502 RVA: 0x00018FDC File Offset: 0x000173DC
public static Color32 EncodeRGBA(uint hash)
{
if (BitConverter.IsLittleEndian)
{
return new Color32((byte)((hash >> 16) & 255U), (byte)((hash >> 8) & 255U), (byte)(hash & 255U), byte.MaxValue);
}
return new Color32((byte)((hash >> 24) & 255U), (byte)((hash >> 16) & 255U), (byte)((hash >> 8) & 255U), byte.MaxValue);
}
// Token: 0x060001F7 RID: 503 RVA: 0x00019048 File Offset: 0x00017448
private static Texture2D RenderWithReplacementShader(Camera camera, Shader shader, string tag, int width = -1, int height = -1)
{
bool flag = width < 0 || height < 0;
int num = ((!flag) ? width : ((int)camera.pixelRect.width));
int num2 = ((!flag) ? height : ((int)camera.pixelRect.height));
GameObject gameObject = new GameObject();
Camera camera2 = gameObject.AddComponent<Camera>();
camera2.CopyFrom(camera);
camera2.renderingPath = RenderingPath.Forward;
camera2.enabled = false;
camera2.clearFlags = CameraClearFlags.Color;
camera2.backgroundColor = Color.white;
camera2.allowHDR = false;
camera2.allowMSAA = false;
camera2.forceIntoRenderTexture = true;
RenderTextureDescriptor renderTextureDescriptor = new RenderTextureDescriptor
{
width = num,
height = num2,
colorFormat = pb_SelectionPicker.renderTextureFormat,
autoGenerateMips = false,
depthBufferBits = 16,
dimension = TextureDimension.Tex2D,
enableRandomWrite = false,
memoryless = RenderTextureMemoryless.None,
sRGB = false,
useMipMap = false,
volumeDepth = 1,
msaaSamples = 1
};
RenderTexture temporary = RenderTexture.GetTemporary(renderTextureDescriptor);
RenderTexture active = RenderTexture.active;
camera2.targetTexture = temporary;
RenderTexture.active = temporary;
camera2.RenderWithShader(shader, tag);
Texture2D texture2D = new Texture2D(num, num2, pb_SelectionPicker.textureFormat, false, false);
texture2D.ReadPixels(new Rect(0f, 0f, (float)num, (float)num2), 0, 0);
texture2D.Apply();
RenderTexture.active = active;
RenderTexture.ReleaseTemporary(temporary);
global::UnityEngine.Object.DestroyImmediate(gameObject);
return texture2D;
}
// Token: 0x0400016F RID: 367
private static bool m_Initialized = false;
// Token: 0x04000170 RID: 368
private static RenderTextureFormat m_RenderTextureFormat = RenderTextureFormat.Default;
// Token: 0x04000171 RID: 369
private static RenderTextureFormat[] m_PreferredFormats = new RenderTextureFormat[]
{
RenderTextureFormat.ARGB32,
RenderTextureFormat.ARGBFloat
};
}
}
+1110
View File
@@ -0,0 +1,1110 @@
using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x0200003D RID: 61
public class pb_ShapeGenerator
{
// Token: 0x060001FC RID: 508 RVA: 0x00019210 File Offset: 0x00017610
public static pb_Object StairGenerator(Vector3 size, int steps, bool buildSides)
{
Vector3[] array = new Vector3[4 * steps * 2];
pb_Face[] array2 = new pb_Face[steps * 2];
int num = 0;
int num2 = 0;
for (int i = 0; i < steps; i++)
{
float num3 = (float)i / (float)steps;
float num4 = (float)(i + 1) / (float)steps;
float x = size.x;
float num5 = 0f;
float num6 = size.y * num3;
float num7 = size.y * num4;
float num8 = size.z * num3;
float num9 = size.z * num4;
array[num] = new Vector3(x, num6, num8);
array[num + 1] = new Vector3(num5, num6, num8);
array[num + 2] = new Vector3(x, num7, num8);
array[num + 3] = new Vector3(num5, num7, num8);
array[num + 4] = new Vector3(x, num7, num8);
array[num + 5] = new Vector3(num5, num7, num8);
array[num + 6] = new Vector3(x, num7, num9);
array[num + 7] = new Vector3(num5, num7, num9);
array2[num2] = new pb_Face(new int[]
{
num,
num + 1,
num + 2,
num + 1,
num + 3,
num + 2
});
array2[num2 + 1] = new pb_Face(new int[]
{
num + 4,
num + 5,
num + 6,
num + 5,
num + 7,
num + 6
});
num += 8;
num2 += 2;
}
if (buildSides)
{
float num10 = 0f;
for (int j = 0; j < 2; j++)
{
Vector3[] array3 = new Vector3[steps * 4 + (steps - 1) * 3];
pb_Face[] array4 = new pb_Face[steps + steps - 1];
int num11 = 0;
int num12 = 0;
for (int k = 0; k < steps; k++)
{
float num13 = (float)Mathf.Max(k, 1) / (float)steps * size.y;
float num14 = (float)(k + 1) / (float)steps * size.y;
float num15 = (float)k / (float)steps * size.z;
float num16 = (float)(k + 1) / (float)steps * size.z;
array3[num11] = new Vector3(num10, 0f, num15);
array3[num11 + 1] = new Vector3(num10, 0f, num16);
array3[num11 + 2] = new Vector3(num10, num13, num15);
array3[num11 + 3] = new Vector3(num10, num14, num16);
pb_Face[] array5 = array4;
int num17 = num12++;
int[] array7;
if (j % 2 == 0)
{
int[] array6 = new int[6];
array6[0] = num;
array6[1] = num + 1;
array6[2] = num + 2;
array6[3] = num + 1;
array6[4] = num + 3;
array7 = array6;
array6[5] = num + 2;
}
else
{
int[] array8 = new int[6];
array8[0] = num + 2;
array8[1] = num + 1;
array8[2] = num;
array8[3] = num + 2;
array8[4] = num + 3;
array7 = array8;
array8[5] = num + 1;
}
array5[num17] = new pb_Face(array7);
array4[num12 - 1].textureGroup = j + 1;
num += 4;
num11 += 4;
if (k > 0)
{
array3[num11] = new Vector3(num10, num13, num15);
array3[num11 + 1] = new Vector3(num10, num14, num15);
array3[num11 + 2] = new Vector3(num10, num14, num16);
pb_Face[] array9 = array4;
int num18 = num12++;
int[] array11;
if (j % 2 == 0)
{
int[] array10 = new int[3];
array10[0] = num + 2;
array10[1] = num + 1;
array11 = array10;
array10[2] = num;
}
else
{
int[] array12 = new int[3];
array12[0] = num;
array12[1] = num + 1;
array11 = array12;
array12[2] = num + 2;
}
array9[num18] = new pb_Face(array11);
array4[num12 - 1].textureGroup = j + 1;
num += 3;
num11 += 3;
}
}
array = array.Concat(array3);
array2 = array2.Concat(array4);
num10 += size.x;
}
array = array.Concat(new Vector3[]
{
new Vector3(0f, 0f, size.z),
new Vector3(size.x, 0f, size.z),
new Vector3(0f, size.y, size.z),
new Vector3(size.x, size.y, size.z)
});
array2 = array2.Add(new pb_Face(new int[]
{
num,
num + 1,
num + 2,
num + 1,
num + 3,
num + 2
}));
}
pb_Object pb_Object = pb_Object.CreateInstanceWithVerticesFaces(array, array2);
pb_Object.gameObject.name = "Stairs";
return pb_Object;
}
// Token: 0x060001FD RID: 509 RVA: 0x00019730 File Offset: 0x00017B30
public static pb_Object CurvedStairGenerator(float stairWidth, float height, float innerRadius, float circumference, int steps, bool buildSides)
{
bool flag = innerRadius < Mathf.Epsilon;
Vector3[] array = new Vector3[4 * steps + ((!flag) ? 4 : 3) * steps];
pb_Face[] array2 = new pb_Face[steps * 2];
int num = 0;
int num2 = 0;
float num3 = Mathf.Abs(circumference) * 0.017453292f;
float num4 = innerRadius + stairWidth;
for (int i = 0; i < steps; i++)
{
float num5 = (float)i / (float)steps * num3;
float num6 = (float)(i + 1) / (float)steps * num3;
float num7 = (float)i / (float)steps * height;
float num8 = (float)(i + 1) / (float)steps * height;
Vector3 vector = new Vector3(-Mathf.Cos(num5), 0f, Mathf.Sin(num5));
Vector3 vector2 = new Vector3(-Mathf.Cos(num6), 0f, Mathf.Sin(num6));
array[num] = vector * innerRadius;
array[num + 1] = vector * num4;
array[num + 2] = vector * innerRadius;
array[num + 3] = vector * num4;
array[num].y = num7;
array[num + 1].y = num7;
array[num + 2].y = num8;
array[num + 3].y = num8;
array[num + 4] = array[num + 2];
array[num + 5] = array[num + 3];
array[num + 6] = vector2 * num4;
array[num + 6].y = num8;
if (!flag)
{
array[num + 7] = vector2 * innerRadius;
array[num + 7].y = num8;
}
array2[num2] = new pb_Face(new int[]
{
num,
num + 1,
num + 2,
num + 1,
num + 3,
num + 2
});
if (flag)
{
array2[num2 + 1] = new pb_Face(new int[]
{
num + 4,
num + 5,
num + 6
});
}
else
{
array2[num2 + 1] = new pb_Face(new int[]
{
num + 4,
num + 5,
num + 6,
num + 4,
num + 6,
num + 7
});
}
float num9 = (num6 + num5) * -0.5f * 57.29578f;
num9 %= 360f;
if (num9 < 0f)
{
num9 = 360f + num9;
}
array2[num2 + 1].uv.rotation = num9;
num += ((!flag) ? 8 : 7);
num2 += 2;
}
if (buildSides)
{
float num10 = ((!flag) ? innerRadius : (innerRadius + stairWidth));
for (int j = ((!flag) ? 0 : 1); j < 2; j++)
{
Vector3[] array3 = new Vector3[steps * 4 + (steps - 1) * 3];
pb_Face[] array4 = new pb_Face[steps + steps - 1];
int num11 = 0;
int num12 = 0;
for (int k = 0; k < steps; k++)
{
float num13 = (float)k / (float)steps * num3;
float num14 = (float)(k + 1) / (float)steps * num3;
float num15 = (float)Mathf.Max(k, 1) / (float)steps * height;
float num16 = (float)(k + 1) / (float)steps * height;
Vector3 vector3 = new Vector3(-Mathf.Cos(num13), 0f, Mathf.Sin(num13)) * num10;
Vector3 vector4 = new Vector3(-Mathf.Cos(num14), 0f, Mathf.Sin(num14)) * num10;
array3[num11] = vector3;
array3[num11 + 1] = vector4;
array3[num11 + 2] = vector3;
array3[num11 + 3] = vector4;
array3[num11].y = 0f;
array3[num11 + 1].y = 0f;
array3[num11 + 2].y = num15;
array3[num11 + 3].y = num16;
pb_Face[] array5 = array4;
int num17 = num12++;
int[] array7;
if (j % 2 == 0)
{
int[] array6 = new int[6];
array6[0] = num + 2;
array6[1] = num + 1;
array6[2] = num;
array6[3] = num + 2;
array6[4] = num + 3;
array7 = array6;
array6[5] = num + 1;
}
else
{
int[] array8 = new int[6];
array8[0] = num;
array8[1] = num + 1;
array8[2] = num + 2;
array8[3] = num + 1;
array8[4] = num + 3;
array7 = array8;
array8[5] = num + 2;
}
array5[num17] = new pb_Face(array7);
array4[num12 - 1].smoothingGroup = j + 1;
num += 4;
num11 += 4;
if (k > 0)
{
array4[num12 - 1].textureGroup = j * steps + k;
array3[num11] = vector3;
array3[num11 + 1] = vector4;
array3[num11 + 2] = vector3;
array3[num11].y = num15;
array3[num11 + 1].y = num16;
array3[num11 + 2].y = num16;
pb_Face[] array9 = array4;
int num18 = num12++;
int[] array11;
if (j % 2 == 0)
{
int[] array10 = new int[3];
array10[0] = num + 2;
array10[1] = num + 1;
array11 = array10;
array10[2] = num;
}
else
{
int[] array12 = new int[3];
array12[0] = num;
array12[1] = num + 1;
array11 = array12;
array12[2] = num + 2;
}
array9[num18] = new pb_Face(array11);
array4[num12 - 1].textureGroup = j * steps + k;
array4[num12 - 1].smoothingGroup = j + 1;
num += 3;
num11 += 3;
}
}
array = array.Concat(array3);
array2 = array2.Concat(array4);
num10 += stairWidth;
}
float num19 = -Mathf.Cos(num3);
float num20 = Mathf.Sin(num3);
array = array.Concat(new Vector3[]
{
new Vector3(num19, 0f, num20) * innerRadius,
new Vector3(num19, 0f, num20) * num4,
new Vector3(num19 * innerRadius, height, num20 * innerRadius),
new Vector3(num19 * num4, height, num20 * num4)
});
array2 = array2.Add(new pb_Face(new int[]
{
num + 2,
num + 1,
num,
num + 2,
num + 3,
num + 1
}));
}
if (circumference < 0f)
{
Vector3 vector5 = new Vector3(-1f, 1f, 1f);
for (int l = 0; l < array.Length; l++)
{
array[l].Scale(vector5);
}
foreach (pb_Face pb_Face in array2)
{
pb_Face.ReverseIndices();
}
}
pb_Object pb_Object = pb_Object.CreateInstanceWithVerticesFaces(array, array2);
pb_Object.gameObject.name = "Stairs";
return pb_Object;
}
// Token: 0x060001FE RID: 510 RVA: 0x00019E8C File Offset: 0x0001828C
public static pb_Object StairGenerator(int steps, float width, float height, float depth, bool sidesGoToFloor, bool generateBack, bool platformsOnly)
{
List<Vector3> list = new List<Vector3>();
Vector3[] array = ((!platformsOnly) ? new Vector3[16] : new Vector3[8]);
float num = height / (float)steps;
float num2 = depth / (float)steps;
for (int i = 0; i < steps; i++)
{
float num3 = width / 2f;
float num4 = (float)i * num;
float num5 = (float)i * num2;
if (sidesGoToFloor)
{
num4 = 0f;
}
float num6 = (float)i * num + num;
array[0] = new Vector3(num3, (float)i * num, num5);
array[1] = new Vector3(-num3, (float)i * num, num5);
array[2] = new Vector3(num3, num6, num5);
array[3] = new Vector3(-num3, num6, num5);
array[4] = new Vector3(num3, num6, num5);
array[5] = new Vector3(-num3, num6, num5);
array[6] = new Vector3(num3, num6, num5 + num2);
array[7] = new Vector3(-num3, num6, num5 + num2);
if (!platformsOnly)
{
array[8] = new Vector3(num3, num4, num5 + num2);
array[9] = new Vector3(num3, num4, num5);
array[10] = new Vector3(num3, num6, num5 + num2);
array[11] = new Vector3(num3, num6, num5);
array[12] = new Vector3(-num3, num4, num5);
array[13] = new Vector3(-num3, num4, num5 + num2);
array[14] = new Vector3(-num3, num6, num5);
array[15] = new Vector3(-num3, num6, num5 + num2);
}
list.AddRange(array);
}
if (generateBack)
{
list.Add(new Vector3(-width / 2f, 0f, depth));
list.Add(new Vector3(width / 2f, 0f, depth));
list.Add(new Vector3(-width / 2f, height, depth));
list.Add(new Vector3(width / 2f, height, depth));
}
pb_Object pb_Object = pb_Object.CreateInstanceWithPoints(list.ToArray());
pb_Object.gameObject.name = "Stairs";
return pb_Object;
}
// Token: 0x060001FF RID: 511 RVA: 0x0001A134 File Offset: 0x00018534
public static pb_Object CubeGenerator(Vector3 size)
{
Vector3[] array = new Vector3[pb_Constant.TRIANGLES_CUBE.Length];
for (int i = 0; i < pb_Constant.TRIANGLES_CUBE.Length; i++)
{
array[i] = Vector3.Scale(pb_Constant.VERTICES_CUBE[pb_Constant.TRIANGLES_CUBE[i]], size);
}
pb_Object pb_Object = pb_Object.CreateInstanceWithPoints(array);
pb_Object.gameObject.name = "Cube";
return pb_Object;
}
// Token: 0x06000200 RID: 512 RVA: 0x0001A1A8 File Offset: 0x000185A8
public static pb_Object CylinderGenerator(int axisDivisions, float radius, float height, int heightCuts, int smoothing = -1)
{
if (axisDivisions % 2 != 0)
{
axisDivisions++;
}
if (axisDivisions > 64)
{
axisDivisions = 64;
}
float num = 360f / (float)axisDivisions;
float num2 = height / (float)(heightCuts + 1);
Vector3[] array = new Vector3[axisDivisions];
for (int i = 0; i < axisDivisions; i++)
{
float num3 = num * (float)i * 0.017453292f;
float num4 = Mathf.Cos(num3) * radius;
float num5 = Mathf.Sin(num3) * radius;
array[i] = new Vector3(num4, 0f, num5);
}
Vector3[] array2 = new Vector3[axisDivisions * (heightCuts + 1) * 4 + axisDivisions * 6];
pb_Face[] array3 = new pb_Face[axisDivisions * (heightCuts + 1) + axisDivisions * 2];
int num6 = 0;
for (int j = 0; j < heightCuts + 1; j++)
{
float num7 = (float)j * num2;
float num8 = (float)(j + 1) * num2;
for (int k = 0; k < axisDivisions; k++)
{
array2[num6] = new Vector3(array[k].x, num7, array[k].z);
array2[num6 + 1] = new Vector3(array[k].x, num8, array[k].z);
if (k != axisDivisions - 1)
{
array2[num6 + 2] = new Vector3(array[k + 1].x, num7, array[k + 1].z);
array2[num6 + 3] = new Vector3(array[k + 1].x, num8, array[k + 1].z);
}
else
{
array2[num6 + 2] = new Vector3(array[0].x, num7, array[0].z);
array2[num6 + 3] = new Vector3(array[0].x, num8, array[0].z);
}
num6 += 4;
}
}
int num9 = 0;
for (int l = 0; l < heightCuts + 1; l++)
{
for (int m = 0; m < axisDivisions * 4; m += 4)
{
int num10 = l * (axisDivisions * 4) + m;
int num11 = num10;
int num12 = num10 + 1;
int num13 = num10 + 2;
int num14 = num10 + 3;
array3[num9++] = new pb_Face(new int[] { num11, num12, num13, num12, num14, num13 }, pb_Constant.DefaultMaterial, new pb_UV(), smoothing, -1, -1, false);
}
}
int num15 = axisDivisions * (heightCuts + 1) * 4;
int num16 = axisDivisions * (heightCuts + 1);
for (int n = 0; n < axisDivisions; n++)
{
array2[num15] = new Vector3(array[n].x, 0f, array[n].z);
array2[num15 + 1] = Vector3.zero;
if (n != axisDivisions - 1)
{
array2[num15 + 2] = new Vector3(array[n + 1].x, 0f, array[n + 1].z);
}
else
{
array2[num15 + 2] = new Vector3(array[0].x, 0f, array[0].z);
}
array3[num16 + n] = new pb_Face(new int[]
{
num15 + 2,
num15 + 1,
num15
});
num15 += 3;
array2[num15] = new Vector3(array[n].x, height, array[n].z);
array2[num15 + 1] = new Vector3(0f, height, 0f);
if (n != axisDivisions - 1)
{
array2[num15 + 2] = new Vector3(array[n + 1].x, height, array[n + 1].z);
}
else
{
array2[num15 + 2] = new Vector3(array[0].x, height, array[0].z);
}
array3[num16 + (n + axisDivisions)] = new pb_Face(new int[]
{
num15,
num15 + 1,
num15 + 2
});
num15 += 3;
}
pb_Object pb_Object = pb_Object.CreateInstanceWithVerticesFaces(array2, array3);
pb_Object.gameObject.name = "Cylinder";
return pb_Object;
}
// Token: 0x06000201 RID: 513 RVA: 0x0001A688 File Offset: 0x00018A88
public static pb_Object PrismGenerator(Vector3 size)
{
size.y *= 2f;
Vector3[] array = new Vector3[]
{
Vector3.Scale(new Vector3(-0.5f, 0f, -0.5f), size),
Vector3.Scale(new Vector3(0.5f, 0f, -0.5f), size),
Vector3.Scale(new Vector3(0f, 0.5f, -0.5f), size),
Vector3.Scale(new Vector3(-0.5f, 0f, 0.5f), size),
Vector3.Scale(new Vector3(0.5f, 0f, 0.5f), size),
Vector3.Scale(new Vector3(0f, 0.5f, 0.5f), size)
};
Vector3[] array2 = new Vector3[]
{
array[0],
array[1],
array[2],
array[1],
array[4],
array[2],
array[5],
array[4],
array[3],
array[5],
array[3],
array[0],
array[5],
array[2],
array[0],
array[1],
array[3],
array[4]
};
pb_Face[] array3 = new pb_Face[5];
int num = 0;
int[] array4 = new int[3];
array4[0] = 2;
array4[1] = 1;
array3[num] = new pb_Face(array4);
array3[1] = new pb_Face(new int[] { 5, 4, 3, 5, 6, 4 });
array3[2] = new pb_Face(new int[] { 9, 8, 7 });
array3[3] = new pb_Face(new int[] { 12, 11, 10, 12, 13, 11 });
array3[4] = new pb_Face(new int[] { 14, 15, 16, 15, 17, 16 });
pb_Face[] array5 = array3;
pb_Object pb_Object = pb_Object.CreateInstanceWithVerticesFaces(array2, array5);
pb_Object.gameObject.name = "Prism";
return pb_Object;
}
// Token: 0x06000202 RID: 514 RVA: 0x0001A9F0 File Offset: 0x00018DF0
public static pb_Object DoorGenerator(float totalWidth, float totalHeight, float ledgeHeight, float legWidth, float depth)
{
float num = totalWidth / 2f;
legWidth = num - legWidth;
ledgeHeight = totalHeight - ledgeHeight;
Vector3[] array = new Vector3[]
{
new Vector3(-num, 0f, depth),
new Vector3(-legWidth, 0f, depth),
new Vector3(legWidth, 0f, depth),
new Vector3(num, 0f, depth),
new Vector3(-num, ledgeHeight, depth),
new Vector3(-legWidth, ledgeHeight, depth),
new Vector3(legWidth, ledgeHeight, depth),
new Vector3(num, ledgeHeight, depth),
new Vector3(-num, totalHeight, depth),
new Vector3(-legWidth, totalHeight, depth),
new Vector3(legWidth, totalHeight, depth),
new Vector3(num, totalHeight, depth)
};
List<Vector3> list = new List<Vector3>();
list.Add(array[0]);
list.Add(array[1]);
list.Add(array[4]);
list.Add(array[5]);
list.Add(array[2]);
list.Add(array[3]);
list.Add(array[6]);
list.Add(array[7]);
list.Add(array[4]);
list.Add(array[5]);
list.Add(array[8]);
list.Add(array[9]);
list.Add(array[6]);
list.Add(array[7]);
list.Add(array[10]);
list.Add(array[11]);
list.Add(array[5]);
list.Add(array[6]);
list.Add(array[9]);
list.Add(array[10]);
List<Vector3> list2 = new List<Vector3>();
for (int i = 0; i < list.Count; i += 4)
{
list2.Add(list[i + 1] - Vector3.forward * depth);
list2.Add(list[i] - Vector3.forward * depth);
list2.Add(list[i + 3] - Vector3.forward * depth);
list2.Add(list[i + 2] - Vector3.forward * depth);
}
list.AddRange(list2);
list.Add(array[6]);
list.Add(array[5]);
list.Add(array[6] - Vector3.forward * depth);
list.Add(array[5] - Vector3.forward * depth);
list.Add(array[2] - Vector3.forward * depth);
list.Add(array[2]);
list.Add(array[6] - Vector3.forward * depth);
list.Add(array[6]);
list.Add(array[1]);
list.Add(array[1] - Vector3.forward * depth);
list.Add(array[5]);
list.Add(array[5] - Vector3.forward * depth);
pb_Object pb_Object = pb_Object.CreateInstanceWithPoints(list.ToArray());
pb_Object.gameObject.name = "Door";
return pb_Object;
}
// Token: 0x06000203 RID: 515 RVA: 0x0001AEA8 File Offset: 0x000192A8
public static pb_Object PlaneGenerator(float _width, float _height, int widthCuts, int heightCuts, Axis axis, bool smooth)
{
int num = widthCuts + 1;
int num2 = heightCuts + 1;
Vector2[] array = ((!smooth) ? new Vector2[num * num2 * 4] : new Vector2[num * num2]);
Vector3[] array2 = ((!smooth) ? new Vector3[num * num2 * 4] : new Vector3[num * num2]);
pb_Face[] array3 = new pb_Face[num * num2];
int i = 0;
int num3 = 0;
for (int j = 0; j < num2; j++)
{
for (int k = 0; k < num; k++)
{
float num4 = (float)k * (_width / (float)num) - _width / 2f - _width / (float)num / (float)num;
float num5 = (float)(k + 1) * (_width / (float)num) - _width / 2f - _width / (float)num / (float)num;
float num6 = (float)j * (_height / (float)num2) - _height / 2f - _height / (float)num2 / (float)num2;
float num7 = (float)(j + 1) * (_height / (float)num2) - _height / 2f - _height / (float)num2 / (float)num2;
array[i] = new Vector2(num4, num6);
array[i + 1] = new Vector2(num5, num6);
array[i + 2] = new Vector2(num4, num7);
array[i + 3] = new Vector2(num5, num7);
array3[num3++] = new pb_Face(new int[]
{
i,
i + 1,
i + 2,
i + 1,
i + 3,
i + 2
});
i += 4;
}
}
switch (axis)
{
case Axis.Right:
for (i = 0; i < array2.Length; i++)
{
array2[i] = new Vector3(0f, array[i].x, array[i].y);
}
break;
case Axis.Left:
for (i = 0; i < array2.Length; i++)
{
array2[i] = new Vector3(0f, array[i].y, array[i].x);
}
break;
case Axis.Up:
for (i = 0; i < array2.Length; i++)
{
array2[i] = new Vector3(array[i].y, 0f, array[i].x);
}
break;
case Axis.Down:
for (i = 0; i < array2.Length; i++)
{
array2[i] = new Vector3(array[i].x, 0f, array[i].y);
}
break;
case Axis.Forward:
for (i = 0; i < array2.Length; i++)
{
array2[i] = new Vector3(array[i].x, array[i].y, 0f);
}
break;
case Axis.Backward:
for (i = 0; i < array2.Length; i++)
{
array2[i] = new Vector3(array[i].y, array[i].x, 0f);
}
break;
}
pb_Object pb_Object = pb_Object.CreateInstanceWithVerticesFaces(array2, array3);
pb_Object.gameObject.name = "Plane";
Vector3 vector = Vector3.zero;
Vector3[] array4 = pb_Object.VerticesInWorldSpace();
foreach (Vector3 vector2 in array4)
{
vector += vector2;
}
vector /= (float)array4.Length;
Vector3 vector3 = pb_Object.transform.position - vector;
pb_Object.transform.position = vector;
pb_Object.TranslateVertices_World(pb_Object.msh.triangles, vector3);
return pb_Object;
}
// Token: 0x06000204 RID: 516 RVA: 0x0001B30C File Offset: 0x0001970C
public static pb_Object PipeGenerator(float radius, float height, float thickness, int subdivAxis, int subdivHeight)
{
Vector2[] array = new Vector2[subdivAxis];
Vector2[] array2 = new Vector2[subdivAxis];
for (int i = 0; i < subdivAxis; i++)
{
array[i] = pb_Math.PointInCircumference(radius, (float)i * (360f / (float)subdivAxis), Vector2.zero);
array2[i] = pb_Math.PointInCircumference(radius - thickness, (float)i * (360f / (float)subdivAxis), Vector2.zero);
}
List<Vector3> list = new List<Vector3>();
subdivHeight++;
for (int j = 0; j < subdivHeight; j++)
{
float num = (float)j * (height / (float)subdivHeight);
float num2 = (float)(j + 1) * (height / (float)subdivHeight);
for (int k = 0; k < subdivAxis; k++)
{
Vector2 vector = array[k];
Vector2 vector2 = ((k >= subdivAxis - 1) ? array[0] : array[k + 1]);
Vector3[] array3 = new Vector3[]
{
new Vector3(vector2.x, num, vector2.y),
new Vector3(vector.x, num, vector.y),
new Vector3(vector2.x, num2, vector2.y),
new Vector3(vector.x, num2, vector.y)
};
vector = array2[k];
vector2 = ((k >= subdivAxis - 1) ? array2[0] : array2[k + 1]);
Vector3[] array4 = new Vector3[]
{
new Vector3(vector.x, num, vector.y),
new Vector3(vector2.x, num, vector2.y),
new Vector3(vector.x, num2, vector.y),
new Vector3(vector2.x, num2, vector2.y)
};
list.AddRange(array3);
list.AddRange(array4);
}
}
for (int l = 0; l < subdivAxis; l++)
{
Vector2 vector = array[l];
Vector2 vector2 = ((l >= subdivAxis - 1) ? array[0] : array[l + 1]);
Vector2 vector3 = array2[l];
Vector2 vector4 = ((l >= subdivAxis - 1) ? array2[0] : array2[l + 1]);
Vector3[] array5 = new Vector3[]
{
new Vector3(vector2.x, height, vector2.y),
new Vector3(vector.x, height, vector.y),
new Vector3(vector4.x, height, vector4.y),
new Vector3(vector3.x, height, vector3.y)
};
Vector3[] array6 = new Vector3[]
{
new Vector3(vector.x, 0f, vector.y),
new Vector3(vector2.x, 0f, vector2.y),
new Vector3(vector3.x, 0f, vector3.y),
new Vector3(vector4.x, 0f, vector4.y)
};
list.AddRange(array6);
list.AddRange(array5);
}
pb_Object pb_Object = pb_Object.CreateInstanceWithPoints(list.ToArray());
pb_Object.gameObject.name = "Pipe";
return pb_Object;
}
// Token: 0x06000205 RID: 517 RVA: 0x0001B74C File Offset: 0x00019B4C
public static pb_Object ConeGenerator(float radius, float height, int subdivAxis)
{
Vector3[] array = new Vector3[subdivAxis];
for (int i = 0; i < subdivAxis; i++)
{
Vector2 vector = pb_Math.PointInCircumference(radius, (float)i * (360f / (float)subdivAxis), Vector2.zero);
array[i] = new Vector3(vector.x, 0f, vector.y);
}
List<Vector3> list = new List<Vector3>();
List<pb_Face> list2 = new List<pb_Face>();
for (int j = 0; j < subdivAxis; j++)
{
list.Add(array[j]);
list.Add((j >= subdivAxis - 1) ? array[0] : array[j + 1]);
list.Add(Vector3.up * height);
list.Add(array[j]);
list.Add((j >= subdivAxis - 1) ? array[0] : array[j + 1]);
list.Add(Vector3.zero);
}
for (int k = 0; k < subdivAxis * 6; k += 6)
{
list2.Add(new pb_Face(new int[]
{
k + 2,
k + 1,
k
}));
list2.Add(new pb_Face(new int[]
{
k + 3,
k + 4,
k + 5
}));
}
pb_Object pb_Object = pb_Object.CreateInstanceWithVerticesFaces(list.ToArray(), list2.ToArray());
pb_Object.gameObject.name = "Cone";
return pb_Object;
}
// Token: 0x06000206 RID: 518 RVA: 0x0001B900 File Offset: 0x00019D00
public static pb_Object ArchGenerator(float angle, float radius, float width, float depth, int radialCuts, bool insideFaces, bool outsideFaces, bool frontFaces, bool backFaces, bool endCaps)
{
Vector2[] array = new Vector2[radialCuts];
Vector2[] array2 = new Vector2[radialCuts];
for (int i = 0; i < radialCuts; i++)
{
array[i] = pb_Math.PointInCircumference(radius, (float)i * (angle / (float)(radialCuts - 1)), Vector2.zero);
array2[i] = pb_Math.PointInCircumference(radius - width, (float)i * (angle / (float)(radialCuts - 1)), Vector2.zero);
}
List<Vector3> list = new List<Vector3>();
float num = 0f;
for (int j = 0; j < radialCuts - 1; j++)
{
Vector2 vector = array[j];
Vector2 vector2 = ((j >= radialCuts - 1) ? array[j] : array[j + 1]);
Vector3[] array3 = new Vector3[]
{
new Vector3(vector.x, vector.y, num),
new Vector3(vector2.x, vector2.y, num),
new Vector3(vector.x, vector.y, depth),
new Vector3(vector2.x, vector2.y, depth)
};
vector = array2[j];
vector2 = ((j >= radialCuts - 1) ? array2[j] : array2[j + 1]);
Vector3[] array4 = new Vector3[]
{
new Vector3(vector2.x, vector2.y, num),
new Vector3(vector.x, vector.y, num),
new Vector3(vector2.x, vector2.y, depth),
new Vector3(vector.x, vector.y, depth)
};
if (outsideFaces)
{
list.AddRange(array3);
}
if (j != radialCuts - 1 && insideFaces)
{
list.AddRange(array4);
}
if (angle < 360f && endCaps)
{
if (j == 0)
{
list.AddRange(new Vector3[]
{
new Vector3(array[j].x, array[j].y, depth),
new Vector3(array2[j].x, array2[j].y, depth),
new Vector3(array[j].x, array[j].y, num),
new Vector3(array2[j].x, array2[j].y, num)
});
}
if (j == radialCuts - 2)
{
list.AddRange(new Vector3[]
{
new Vector3(array2[j + 1].x, array2[j + 1].y, depth),
new Vector3(array[j + 1].x, array[j + 1].y, depth),
new Vector3(array2[j + 1].x, array2[j + 1].y, num),
new Vector3(array[j + 1].x, array[j + 1].y, num)
});
}
}
}
for (int k = 0; k < radialCuts - 1; k++)
{
Vector2 vector = array[k];
Vector2 vector2 = ((k >= radialCuts - 1) ? array[k] : array[k + 1]);
Vector2 vector3 = array2[k];
Vector2 vector4 = ((k >= radialCuts - 1) ? array2[k] : array2[k + 1]);
Vector3[] array5 = new Vector3[]
{
new Vector3(vector.x, vector.y, depth),
new Vector3(vector2.x, vector2.y, depth),
new Vector3(vector3.x, vector3.y, depth),
new Vector3(vector4.x, vector4.y, depth)
};
Vector3[] array6 = new Vector3[]
{
new Vector3(vector2.x, vector2.y, 0f),
new Vector3(vector.x, vector.y, 0f),
new Vector3(vector4.x, vector4.y, 0f),
new Vector3(vector3.x, vector3.y, 0f)
};
if (frontFaces)
{
list.AddRange(array5);
}
if (backFaces)
{
list.AddRange(array6);
}
}
pb_Object pb_Object = pb_Object.CreateInstanceWithPoints(list.ToArray());
pb_Object.gameObject.name = "Arch";
return pb_Object;
}
// Token: 0x06000207 RID: 519 RVA: 0x0001BEF4 File Offset: 0x0001A2F4
public static pb_Object IcosahedronGenerator(float radius, int subdivisions)
{
Vector3[] array = new Vector3[pb_ShapeGenerator.ICOSAHEDRON_TRIANGLES.Length];
for (int i = 0; i < pb_ShapeGenerator.ICOSAHEDRON_TRIANGLES.Length; i += 3)
{
array[i] = pb_ShapeGenerator.ICOSAHEDRON_VERTICES[pb_ShapeGenerator.ICOSAHEDRON_TRIANGLES[i]].normalized * radius;
array[i + 1] = pb_ShapeGenerator.ICOSAHEDRON_VERTICES[pb_ShapeGenerator.ICOSAHEDRON_TRIANGLES[i + 1]].normalized * radius;
array[i + 2] = pb_ShapeGenerator.ICOSAHEDRON_VERTICES[pb_ShapeGenerator.ICOSAHEDRON_TRIANGLES[i + 2]].normalized * radius;
}
for (int j = 0; j < subdivisions; j++)
{
array = pb_ShapeGenerator.SubdivideIcosahedron(array, radius);
}
pb_Face[] array2 = new pb_Face[array.Length / 3];
for (int k = 0; k < array.Length; k += 3)
{
array2[k / 3] = new pb_Face(new int[]
{
k,
k + 1,
k + 2
});
array2[k / 3].manualUV = true;
}
GameObject gameObject = new GameObject();
pb_Object pb_Object = gameObject.AddComponent<pb_Object>();
pb_Object.SetVertices(array);
pb_Object.SetUV(new Vector2[array.Length]);
pb_Object.SetFaces(array2);
pb_IntArray[] array3 = new pb_IntArray[array.Length];
for (int l = 0; l < array3.Length; l++)
{
array3[l] = new pb_IntArray(new int[] { l });
}
pb_Object.SetSharedIndices(array3);
pb_Object.ToMesh();
pb_Object.Refresh(RefreshMask.All);
pb_Object.gameObject.name = "Icosphere";
return pb_Object;
}
// Token: 0x06000208 RID: 520 RVA: 0x0001C0AC File Offset: 0x0001A4AC
private static Vector3[] SubdivideIcosahedron(Vector3[] vertices, float radius)
{
Vector3[] array = new Vector3[vertices.Length * 4];
int num = 0;
Vector3 vector = Vector3.zero;
Vector3 vector2 = Vector3.zero;
Vector3 vector3 = Vector3.zero;
Vector3 vector4 = Vector3.zero;
Vector3 vector5 = Vector3.zero;
Vector3 vector6 = Vector3.zero;
for (int i = 0; i < vertices.Length; i += 3)
{
vector = vertices[i];
vector3 = vertices[i + 1];
vector6 = vertices[i + 2];
vector2 = ((vector + vector3) * 0.5f).normalized * radius;
vector4 = ((vector + vector6) * 0.5f).normalized * radius;
vector5 = ((vector3 + vector6) * 0.5f).normalized * radius;
array[num++] = vector;
array[num++] = vector2;
array[num++] = vector4;
array[num++] = vector2;
array[num++] = vector3;
array[num++] = vector5;
array[num++] = vector2;
array[num++] = vector5;
array[num++] = vector4;
array[num++] = vector4;
array[num++] = vector5;
array[num++] = vector6;
}
return array;
}
// Token: 0x06000209 RID: 521 RVA: 0x0001C274 File Offset: 0x0001A674
private static Vector3[] CircleVertices(int segments, float radius, float circumference, Quaternion rotation, float offset)
{
float num = (float)segments - 1f;
Vector3[] array = new Vector3[(segments - 1) * 2];
array[0] = new Vector3(Mathf.Cos(0f / num * circumference * 0.017453292f) * radius, Mathf.Sin(0f / num * circumference * 0.017453292f) * radius, 0f);
array[1] = new Vector3(Mathf.Cos(1f / num * circumference * 0.017453292f) * radius, Mathf.Sin(1f / num * circumference * 0.017453292f) * radius, 0f);
array[0] = rotation * (array[0] + Vector3.right * offset);
array[1] = rotation * (array[1] + Vector3.right * offset);
int num2 = 2;
StringBuilder stringBuilder = new StringBuilder();
for (int i = 2; i < segments; i++)
{
float num3 = (float)i / num * circumference * 0.017453292f;
stringBuilder.AppendLine(num3.ToString());
array[num2] = array[num2 - 1];
array[num2 + 1] = rotation * (new Vector3(Mathf.Cos(num3) * radius, Mathf.Sin(num3) * radius, 0f) + Vector3.right * offset);
num2 += 2;
}
return array;
}
// Token: 0x0600020A RID: 522 RVA: 0x0001C418 File Offset: 0x0001A818
public static pb_Object TorusGenerator(int InRows, int InColumns, float InRadius, float InTubeRadius, bool InSmooth, float InHorizontalCircumference, float InVerticalCircumference)
{
int num = Mathf.Clamp(InRows + 1, 4, 128);
int num2 = Mathf.Clamp(InColumns + 1, 4, 128);
float num3 = Mathf.Clamp(InRadius, 0.01f, 2048f);
float num4 = Mathf.Clamp(InTubeRadius, 0.01f, num3);
num3 -= num4;
float num5 = Mathf.Clamp(InHorizontalCircumference, 0.01f, 360f);
float num6 = Mathf.Clamp(InVerticalCircumference, 0.01f, 360f);
List<Vector3> list = new List<Vector3>();
int num7 = num2 - 1;
Vector3[] array = pb_ShapeGenerator.CircleVertices(num, num4, num6, Quaternion.Euler(Vector3.up * 0f * num5), num3);
for (int i = 1; i < num2; i++)
{
list.AddRange(array);
Quaternion quaternion = Quaternion.Euler(Vector3.up * ((float)i / (float)num7 * num5));
array = pb_ShapeGenerator.CircleVertices(num, num4, num6, quaternion, num3);
list.AddRange(array);
}
List<pb_Face> list2 = new List<pb_Face>();
int num8 = 0;
for (int j = 0; j < (num2 - 1) * 2; j += 2)
{
for (int k = 0; k < num - 1; k++)
{
int num9 = j * ((num - 1) * 2) + k * 2;
int num10 = (j + 1) * ((num - 1) * 2) + k * 2;
int num11 = j * ((num - 1) * 2) + k * 2 + 1;
int num12 = (j + 1) * ((num - 1) * 2) + k * 2 + 1;
list2.Add(new pb_Face(new int[] { num9, num10, num11, num10, num12, num11 }));
list2[num8].smoothingGroup = ((!InSmooth) ? (-1) : 1);
list2[num8].manualUV = true;
num8++;
}
}
pb_Object pb_Object = pb_Object.CreateInstanceWithVerticesFaces(list.ToArray(), list2.ToArray());
pb_Object.gameObject.name = "Torus";
return pb_Object;
}
// Token: 0x04000174 RID: 372
private static readonly Vector3[] ICOSAHEDRON_VERTICES = new Vector3[]
{
new Vector3(-1f, 1.618034f, 0f),
new Vector3(1f, 1.618034f, 0f),
new Vector3(-1f, -1.618034f, 0f),
new Vector3(1f, -1.618034f, 0f),
new Vector3(0f, -1f, 1.618034f),
new Vector3(0f, 1f, 1.618034f),
new Vector3(0f, -1f, -1.618034f),
new Vector3(0f, 1f, -1.618034f),
new Vector3(1.618034f, 0f, -1f),
new Vector3(1.618034f, 0f, 1f),
new Vector3(-1.618034f, 0f, -1f),
new Vector3(-1.618034f, 0f, 1f)
};
// Token: 0x04000175 RID: 373
private static readonly int[] ICOSAHEDRON_TRIANGLES = new int[]
{
0, 11, 5, 0, 5, 1, 0, 1, 7, 0,
7, 10, 0, 10, 11, 1, 5, 9, 5, 11,
4, 11, 10, 2, 10, 7, 6, 7, 1, 8,
3, 9, 4, 3, 4, 2, 3, 2, 6, 3,
6, 8, 3, 8, 9, 4, 9, 5, 2, 4,
11, 6, 2, 10, 8, 6, 7, 9, 8, 1
};
}
}
+156
View File
@@ -0,0 +1,156 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x0200003E RID: 62
public class pb_Shortcut
{
// Token: 0x0600020C RID: 524 RVA: 0x0001C7CB File Offset: 0x0001ABCB
public pb_Shortcut(string a, string d, KeyCode k, EventModifiers e)
{
this.action = a;
this.description = d;
this.key = k;
this.eventModifiers = e;
}
// Token: 0x0600020D RID: 525 RVA: 0x0001C7F0 File Offset: 0x0001ABF0
public pb_Shortcut(string str)
{
try
{
string[] array = str.Split(new char[] { '-' });
this.action = array[0];
this.description = array[1];
int num;
if (int.TryParse(array[2], out num))
{
this.key = (KeyCode)num;
}
if (int.TryParse(array[3], out num))
{
this.eventModifiers = (EventModifiers)num;
}
}
catch
{
Debug.LogWarning("Failed parsing shortcut: " + str);
}
}
// Token: 0x0600020E RID: 526 RVA: 0x0001C880 File Offset: 0x0001AC80
public bool Matches(KeyCode key, EventModifiers modifiers)
{
return this.key == key && this.eventModifiers == modifiers;
}
// Token: 0x0600020F RID: 527 RVA: 0x0001C89C File Offset: 0x0001AC9C
public static int IndexOf(pb_Shortcut[] shortcuts, KeyCode k, EventModifiers e)
{
for (int i = 0; i < shortcuts.Length; i++)
{
if (shortcuts[i].key == k && shortcuts[i].eventModifiers == e)
{
return i;
}
}
return -1;
}
// Token: 0x06000210 RID: 528 RVA: 0x0001C8DC File Offset: 0x0001ACDC
public static IEnumerable<pb_Shortcut> DefaultShortcuts()
{
return new List<pb_Shortcut>
{
new pb_Shortcut("Escape", "Top Level", KeyCode.Escape, EventModifiers.None),
new pb_Shortcut("Toggle Geometry Mode", "Geometry Level", KeyCode.G, EventModifiers.None),
new pb_Shortcut("Toggle Selection Mode", "Toggle Selection Mode. If Toggle Mode Shortcuts is disabled, this shortcut does not apply.", KeyCode.H, EventModifiers.None),
new pb_Shortcut("Set Trigger", "Sets all selected objects to entity type Trigger.", KeyCode.T, EventModifiers.None),
new pb_Shortcut("Set Occluder", "Sets all selected objects to entity type Occluder.", KeyCode.O, EventModifiers.None),
new pb_Shortcut("Set Collider", "Sets all selected objects to entity type Collider.", KeyCode.C, EventModifiers.None),
new pb_Shortcut("Set Mover", "Sets all selected objects to entity type Mover.", KeyCode.M, EventModifiers.None),
new pb_Shortcut("Set Detail", "Sets all selected objects to entity type Brush.", KeyCode.B, EventModifiers.None),
new pb_Shortcut("Toggle Handle Pivot", "Toggles the orientation of the ProBuilder selection handle.", KeyCode.P, EventModifiers.None),
new pb_Shortcut("Set Pivot", "Center pivot around current selection.", KeyCode.J, EventModifiers.Command),
new pb_Shortcut("Delete Face", "Deletes all selected faces.", KeyCode.Backspace, EventModifiers.FunctionKey),
new pb_Shortcut("Vertex Mode", "Enter Vertex editing mode. Automatically swaps to Element level editing.", KeyCode.H, EventModifiers.None),
new pb_Shortcut("Edge Mode", "Enter Edge editing mode. Automatically swaps to Element level editing.", KeyCode.J, EventModifiers.None),
new pb_Shortcut("Face Mode", "Enter Face editing mode. Automatically swaps to Element level editing.", KeyCode.K, EventModifiers.None)
};
}
// Token: 0x06000211 RID: 529 RVA: 0x0001CA40 File Offset: 0x0001AE40
public static IEnumerable<pb_Shortcut> ParseShortcuts(string str)
{
if (str == null || str.Length < 3)
{
return pb_Shortcut.DefaultShortcuts();
}
string[] array = str.Split(new char[] { '*' });
pb_Shortcut[] array2 = new pb_Shortcut[array.Length];
for (int i = 0; i < array2.Length; i++)
{
array2[i] = new pb_Shortcut(array[i]);
}
return array2;
}
// Token: 0x06000212 RID: 530 RVA: 0x0001CAA0 File Offset: 0x0001AEA0
public override string ToString()
{
return string.Format("{0}: {1}, {2} ({3})", new object[]
{
this.action,
this.key.ToString(),
this.eventModifiers.ToString(),
(int)this.eventModifiers
});
}
// Token: 0x06000213 RID: 531 RVA: 0x0001CAFC File Offset: 0x0001AEFC
public string Serialize()
{
this.action = this.action.Replace("-", " ").Replace("*", string.Empty);
this.description = this.description.Replace("-", " ").Replace("*", string.Empty);
return string.Concat(new object[]
{
this.action,
"-",
this.description,
"-",
(int)this.key,
"-",
(int)this.eventModifiers
});
}
// Token: 0x06000214 RID: 532 RVA: 0x0001CBB0 File Offset: 0x0001AFB0
public static string ShortcutsToString(pb_Shortcut[] shortcuts)
{
string text = string.Empty;
for (int i = 0; i < shortcuts.Length; i++)
{
text += shortcuts[i].Serialize();
if (i != shortcuts.Length - 1)
{
text += "*";
}
}
return text;
}
// Token: 0x04000176 RID: 374
public string action;
// Token: 0x04000177 RID: 375
public string description;
// Token: 0x04000178 RID: 376
public KeyCode key;
// Token: 0x04000179 RID: 377
public EventModifiers eventModifiers;
}
}
+31
View File
@@ -0,0 +1,31 @@
using System;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x0200003F RID: 63
public static class pb_Snap
{
// Token: 0x06000215 RID: 533 RVA: 0x0001CBFE File Offset: 0x0001AFFE
public static Vector3 SnapValue(Vector3 vertex, float snpVal)
{
return new Vector3(snpVal * Mathf.Round(vertex.x / snpVal), snpVal * Mathf.Round(vertex.y / snpVal), snpVal * Mathf.Round(vertex.z / snpVal));
}
// Token: 0x06000216 RID: 534 RVA: 0x0001CC35 File Offset: 0x0001B035
public static float SnapValue(float val, float snpVal)
{
return snpVal * Mathf.Round(val / snpVal);
}
// Token: 0x06000217 RID: 535 RVA: 0x0001CC44 File Offset: 0x0001B044
public static Vector3 SnapValue(Vector3 vertex, Vector3 snap)
{
float x = vertex.x;
float y = vertex.y;
float z = vertex.z;
Vector3 vector = new Vector3((Mathf.Abs(snap.x) >= 0.0001f) ? (snap.x * Mathf.Round(x / snap.x)) : x, (Mathf.Abs(snap.y) >= 0.0001f) ? (snap.y * Mathf.Round(y / snap.y)) : y, (Mathf.Abs(snap.z) >= 0.0001f) ? (snap.z * Mathf.Round(z / snap.z)) : z);
return vector;
}
}
}
+181
View File
@@ -0,0 +1,181 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000040 RID: 64
public static class pb_Spline
{
// Token: 0x06000218 RID: 536 RVA: 0x0001CD08 File Offset: 0x0001B108
public static pb_Object Extrude(IList<pb_BezierPoint> points, float radius = 0.5f, int columns = 32, int rows = 16, bool closeLoop = false, bool smooth = true)
{
pb_Object pb_Object = null;
pb_Spline.Extrude(points, radius, columns, rows, closeLoop, smooth, ref pb_Object);
return pb_Object;
}
// Token: 0x06000219 RID: 537 RVA: 0x0001CD28 File Offset: 0x0001B128
public static void Extrude(IList<pb_BezierPoint> bezierPoints, float radius, int columns, int rows, bool closeLoop, bool smooth, ref pb_Object target)
{
List<Quaternion> list = new List<Quaternion>();
List<Vector3> controlPoints = pb_Spline.GetControlPoints(bezierPoints, columns, closeLoop, list);
pb_Spline.Extrude(controlPoints, radius, rows, closeLoop, smooth, ref target, list);
}
// Token: 0x0600021A RID: 538 RVA: 0x0001CD58 File Offset: 0x0001B158
public static List<Vector3> GetControlPoints(IList<pb_BezierPoint> bezierPoints, int subdivisionsPerSegment, bool closeLoop, List<Quaternion> rotations)
{
int count = bezierPoints.Count;
List<Vector3> list = new List<Vector3>(subdivisionsPerSegment * count);
if (rotations != null)
{
rotations.Clear();
rotations.Capacity = subdivisionsPerSegment * count;
}
int num = ((!closeLoop) ? (count - 1) : count);
for (int i = 0; i < num; i++)
{
int num2 = ((closeLoop || i < count - 2) ? subdivisionsPerSegment : (subdivisionsPerSegment + 1));
for (int j = 0; j < num2; j++)
{
float num3 = (float)subdivisionsPerSegment;
list.Add(pb_BezierPoint.CubicPosition(bezierPoints[i], bezierPoints[(i + 1) % count], (float)j / num3));
if (rotations != null)
{
rotations.Add(Quaternion.Slerp(bezierPoints[i].rotation, bezierPoints[(i + 1) % count].rotation, (float)j / (float)(num2 - 1)));
}
}
}
return list;
}
// Token: 0x0600021B RID: 539 RVA: 0x0001CE50 File Offset: 0x0001B250
public static void Extrude(IList<Vector3> points, float radius, int radiusRows, bool closeLoop, bool smooth, ref pb_Object target, IList<Quaternion> pointRotations = null)
{
if (points == null || points.Count < 2)
{
return;
}
int count = points.Count;
int num = Math.Max(3, radiusRows);
int num2 = num + 1;
int num3 = num * 2;
int num4 = ((!closeLoop) ? (count - 1) : count) * 2 * num3;
bool flag = false;
bool flag2 = pointRotations != null && pointRotations.Count == points.Count;
Vector3[] array = new Vector3[num4];
pb_Face[] array2 = ((!flag) ? new pb_Face[((!closeLoop) ? (count - 1) : count) * num] : null);
int num5 = 0;
int num6 = 0;
int num7 = 0;
int num8 = ((!closeLoop) ? (count - 1) : count);
for (int i = 0; i < num8; i++)
{
float num9;
Quaternion quaternion = pb_Spline.GetRingRotation(points, i, closeLoop, out num9);
float num10;
Quaternion quaternion2 = pb_Spline.GetRingRotation(points, (i + 1) % count, closeLoop, out num10);
if (flag2)
{
quaternion *= pointRotations[i];
quaternion2 *= pointRotations[(i + 1) % count];
}
Vector3[] array3 = pb_Spline.VertexRing(quaternion, points[i], radius, num2);
Vector3[] array4 = pb_Spline.VertexRing(quaternion2, points[(i + 1) % count], radius, num2);
Array.Copy(array3, 0, array, num7, num3);
num7 += num3;
Array.Copy(array4, 0, array, num7, num3);
num7 += num3;
if (!flag)
{
for (int j = 0; j < num3; j += 2)
{
array2[num6] = new pb_Face(new int[]
{
num5,
num5 + 1,
num5 + num3,
num5 + num3,
num5 + 1,
num5 + num3 + 1
});
if (smooth)
{
array2[num6].smoothingGroup = 2;
}
num6++;
num5 += 2;
}
num5 += num3;
}
}
if (target != null)
{
if (array2 != null)
{
target.GeometryWithVerticesFaces(array, array2);
}
else
{
target.SetVertices(array);
target.ToMesh();
target.Refresh(RefreshMask.UV | RefreshMask.Colors | RefreshMask.Normals | RefreshMask.Tangents);
}
}
else
{
target = pb_Object.CreateInstanceWithVerticesFaces(array, array2);
}
}
// Token: 0x0600021C RID: 540 RVA: 0x0001D084 File Offset: 0x0001B484
private static Quaternion GetRingRotation(IList<Vector3> points, int i, bool closeLoop, out float secant)
{
int count = points.Count;
Vector3 vector;
if (closeLoop || (i > 0 && i < count - 1))
{
int num = ((i >= 1) ? (i - 1) : (count - 1));
int num2 = (i + 1) % count;
Vector3 normalized = (points[i] - points[num]).normalized;
Vector3 normalized2 = (points[num2] - points[i]).normalized;
vector = (normalized + normalized2) * 0.5f;
secant = pb_Math.Secant(Vector3.Angle(normalized, vector) * 0.017453292f);
}
else
{
if (i < 1)
{
vector = points[i + 1] - points[i];
}
else
{
vector = points[i] - points[i - 1];
}
secant = 1f;
}
vector.Normalize();
if (vector.Approx3(Vector3.up, 0.0001f) || vector.Approx3(Vector3.zero, 0.0001f))
{
return Quaternion.identity;
}
return Quaternion.LookRotation(vector);
}
// Token: 0x0600021D RID: 541 RVA: 0x0001D1B4 File Offset: 0x0001B5B4
private static Vector3[] VertexRing(Quaternion orientation, Vector3 offset, float radius, int segments)
{
Vector3[] array = new Vector3[segments * 2];
for (int i = 0; i < segments; i++)
{
float num = (float)i / (float)(segments - 1) * 360f * 0.017453292f;
int num2 = (i + 1) % segments;
float num3 = (float)num2 / (float)(segments - 1) * 360f * 0.017453292f;
array[i * 2] = offset + orientation * new Vector3(Mathf.Cos(num) * radius, Mathf.Sin(num) * radius, 0f);
array[i * 2 + 1] = offset + orientation * new Vector3(Mathf.Cos(num3) * radius, Mathf.Sin(num3) * radius, 0f);
}
return array;
}
}
}
+41
View File
@@ -0,0 +1,41 @@
using System;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000053 RID: 83
public class pb_Transform2D
{
// Token: 0x06000282 RID: 642 RVA: 0x0001F799 File Offset: 0x0001DB99
public pb_Transform2D(Vector2 position, float rotation, Vector2 scale)
{
this.position = position;
this.rotation = rotation;
this.scale = scale;
}
// Token: 0x06000283 RID: 643 RVA: 0x0001F7B6 File Offset: 0x0001DBB6
public Vector2 TransformPoint(Vector2 p)
{
p += this.position;
p.RotateAroundPoint(p, this.rotation);
p.ScaleAroundPoint(p, this.scale);
return p;
}
// Token: 0x06000284 RID: 644 RVA: 0x0001F7E4 File Offset: 0x0001DBE4
public override string ToString()
{
return string.Concat(new object[] { "T: ", this.position, "\nR: ", this.rotation, '°', "\nS: ", this.scale });
}
// Token: 0x040001C6 RID: 454
public Vector2 position;
// Token: 0x040001C7 RID: 455
public float rotation;
// Token: 0x040001C8 RID: 456
public Vector2 scale;
}
}
+36
View File
@@ -0,0 +1,36 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000055 RID: 85
public class pb_Tuple<T1, T2, T3>
{
// Token: 0x06000288 RID: 648 RVA: 0x0001F897 File Offset: 0x0001DC97
public pb_Tuple()
{
}
// Token: 0x06000289 RID: 649 RVA: 0x0001F89F File Offset: 0x0001DC9F
public pb_Tuple(T1 item1, T2 item2, T3 item3)
{
this.Item1 = item1;
this.Item2 = item2;
this.Item3 = item3;
}
// Token: 0x0600028A RID: 650 RVA: 0x0001F8BC File Offset: 0x0001DCBC
public override string ToString()
{
return string.Format("{0}, {1}, {2}", this.Item1.ToString(), this.Item2.ToString(), this.Item3.ToString());
}
// Token: 0x040001CB RID: 459
public T1 Item1;
// Token: 0x040001CC RID: 460
public T2 Item2;
// Token: 0x040001CD RID: 461
public T3 Item3;
}
}
+46
View File
@@ -0,0 +1,46 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000056 RID: 86
public class pb_Tuple<T1, T2, T3, T4>
{
// Token: 0x0600028B RID: 651 RVA: 0x0001F8FB File Offset: 0x0001DCFB
public pb_Tuple()
{
}
// Token: 0x0600028C RID: 652 RVA: 0x0001F903 File Offset: 0x0001DD03
public pb_Tuple(T1 item1, T2 item2, T3 item3, T4 item4)
{
this.Item1 = item1;
this.Item2 = item2;
this.Item3 = item3;
this.Item4 = item4;
}
// Token: 0x0600028D RID: 653 RVA: 0x0001F928 File Offset: 0x0001DD28
public override string ToString()
{
return string.Format("{0}, {1}, {2}, {3}", new object[]
{
this.Item1.ToString(),
this.Item2.ToString(),
this.Item3.ToString(),
this.Item4.ToString()
});
}
// Token: 0x040001CE RID: 462
public T1 Item1;
// Token: 0x040001CF RID: 463
public T2 Item2;
// Token: 0x040001D0 RID: 464
public T3 Item3;
// Token: 0x040001D1 RID: 465
public T4 Item4;
}
}
+32
View File
@@ -0,0 +1,32 @@
using System;
namespace ProBuilder2.Common
{
// Token: 0x02000054 RID: 84
public class pb_Tuple<T1, T2>
{
// Token: 0x06000285 RID: 645 RVA: 0x0001F84B File Offset: 0x0001DC4B
public pb_Tuple()
{
}
// Token: 0x06000286 RID: 646 RVA: 0x0001F853 File Offset: 0x0001DC53
public pb_Tuple(T1 item1, T2 item2)
{
this.Item1 = item1;
this.Item2 = item2;
}
// Token: 0x06000287 RID: 647 RVA: 0x0001F869 File Offset: 0x0001DC69
public override string ToString()
{
return string.Format("{0}, {1}", this.Item1.ToString(), this.Item2.ToString());
}
// Token: 0x040001C9 RID: 457
public T1 Item1;
// Token: 0x040001CA RID: 458
public T2 Item2;
}
}
+47
View File
@@ -0,0 +1,47 @@
using System;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000057 RID: 87
[Serializable]
public class pb_Type : ISerializationCallbackReceiver
{
// Token: 0x0600028E RID: 654 RVA: 0x0001F995 File Offset: 0x0001DD95
public pb_Type(Type t)
{
this.type = t;
}
// Token: 0x0600028F RID: 655 RVA: 0x0001F9A4 File Offset: 0x0001DDA4
public void OnBeforeSerialize()
{
this.assemblyQualifiedName = this.type.AssemblyQualifiedName;
}
// Token: 0x06000290 RID: 656 RVA: 0x0001F9B7 File Offset: 0x0001DDB7
public void OnAfterDeserialize()
{
this.type = Type.GetType(this.assemblyQualifiedName);
}
// Token: 0x06000291 RID: 657 RVA: 0x0001F9CA File Offset: 0x0001DDCA
public static implicit operator Type(pb_Type t)
{
return t.type;
}
// Token: 0x06000292 RID: 658 RVA: 0x0001F9D2 File Offset: 0x0001DDD2
public static implicit operator pb_Type(Type t)
{
return new pb_Type(t);
}
// Token: 0x040001D2 RID: 466
[SerializeField]
private string assemblyQualifiedName;
// Token: 0x040001D3 RID: 467
public Type type;
}
}
+152
View File
@@ -0,0 +1,152 @@
using System;
using UnityEngine;
// Token: 0x02000041 RID: 65
[Serializable]
public class pb_UV
{
// Token: 0x0600021E RID: 542 RVA: 0x0001D278 File Offset: 0x0001B678
public pb_UV()
{
this.useWorldSpace = false;
this.flipU = false;
this.flipV = false;
this.swapUV = false;
this.fill = pb_UV.Fill.Tile;
this.scale = new Vector2(1f, 1f);
this.offset = new Vector2(0f, 0f);
this.rotation = 0f;
this.anchor = pb_UV.Anchor.None;
}
// Token: 0x0600021F RID: 543 RVA: 0x0001D2EC File Offset: 0x0001B6EC
public pb_UV(pb_UV uvs)
{
this.useWorldSpace = uvs.useWorldSpace;
this.flipU = uvs.flipU;
this.flipV = uvs.flipV;
this.swapUV = uvs.swapUV;
this.fill = uvs.fill;
this.scale = uvs.scale;
this.offset = uvs.offset;
this.rotation = uvs.rotation;
this.anchor = uvs.anchor;
}
// Token: 0x06000220 RID: 544 RVA: 0x0001D36C File Offset: 0x0001B76C
public void Reset()
{
this.useWorldSpace = false;
this.flipU = false;
this.flipV = false;
this.swapUV = false;
this.fill = pb_UV.Fill.Tile;
this.scale = new Vector2(1f, 1f);
this.offset = new Vector2(0f, 0f);
this.rotation = 0f;
this.anchor = pb_UV.Anchor.LowerLeft;
}
// Token: 0x06000221 RID: 545 RVA: 0x0001D3D8 File Offset: 0x0001B7D8
public override string ToString()
{
return string.Concat(new object[]
{
"Use World Space: ", this.useWorldSpace, "\nFlip U: ", this.flipU, "\nFlip V: ", this.flipV, "\nSwap UV: ", this.swapUV, "\nFill Mode: ", this.fill,
"\nAnchor: ", this.anchor, "\nScale: ", this.scale, "\nOffset: ", this.offset, "\nRotation: ", this.rotation, "\nPivot: ", this.localPivot,
"\n"
});
}
// Token: 0x0400017A RID: 378
public bool useWorldSpace;
// Token: 0x0400017B RID: 379
public bool flipU;
// Token: 0x0400017C RID: 380
public bool flipV;
// Token: 0x0400017D RID: 381
public bool swapUV;
// Token: 0x0400017E RID: 382
public pb_UV.Fill fill;
// Token: 0x0400017F RID: 383
public Vector2 scale;
// Token: 0x04000180 RID: 384
public Vector2 offset;
// Token: 0x04000181 RID: 385
public float rotation;
// Token: 0x04000182 RID: 386
[Obsolete("Please use pb_UV.anchor.")]
public pb_UV.Justify justify;
// Token: 0x04000183 RID: 387
public Vector2 localPivot;
// Token: 0x04000184 RID: 388
[Obsolete("localPivot and localSize are no longer stored.")]
public Vector2 localSize;
// Token: 0x04000185 RID: 389
public pb_UV.Anchor anchor;
// Token: 0x02000042 RID: 66
[Obsolete("See pb_UV.Anchor")]
public enum Justify
{
// Token: 0x04000187 RID: 391
Right,
// Token: 0x04000188 RID: 392
Left,
// Token: 0x04000189 RID: 393
Top,
// Token: 0x0400018A RID: 394
Center,
// Token: 0x0400018B RID: 395
Bottom,
// Token: 0x0400018C RID: 396
None
}
// Token: 0x02000043 RID: 67
public enum Anchor
{
// Token: 0x0400018E RID: 398
UpperLeft,
// Token: 0x0400018F RID: 399
UpperCenter,
// Token: 0x04000190 RID: 400
UpperRight,
// Token: 0x04000191 RID: 401
MiddleLeft,
// Token: 0x04000192 RID: 402
MiddleCenter,
// Token: 0x04000193 RID: 403
MiddleRight,
// Token: 0x04000194 RID: 404
LowerLeft,
// Token: 0x04000195 RID: 405
LowerCenter,
// Token: 0x04000196 RID: 406
LowerRight,
// Token: 0x04000197 RID: 407
None
}
// Token: 0x02000044 RID: 68
public enum Fill
{
// Token: 0x04000199 RID: 409
Fit,
// Token: 0x0400019A RID: 410
Tile,
// Token: 0x0400019B RID: 411
Stretch
}
}
+196
View File
@@ -0,0 +1,196 @@
using System;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000045 RID: 69
public class pb_UVUtility
{
// Token: 0x06000223 RID: 547 RVA: 0x0001D4EC File Offset: 0x0001B8EC
public static void PlanarMap2(Vector3[] verts, Vector2[] uvs, int[] indices, pb_UV uvSettings, Vector3 normal)
{
ProjectionAxis projectionAxis = pb_Projection.VectorToProjectionAxis(normal);
pb_Projection.PlanarProject(verts, uvs, indices, normal, projectionAxis);
pb_UVUtility.ApplyUVSettings(uvs, indices, uvSettings);
}
// Token: 0x06000224 RID: 548 RVA: 0x0001D514 File Offset: 0x0001B914
private static void ApplyUVSettings(Vector2[] uvs, int[] indices, pb_UV uvSettings)
{
int num = indices.Length;
pb_UV.Fill fill = uvSettings.fill;
if (fill != pb_UV.Fill.Tile)
{
if (fill != pb_UV.Fill.Fit)
{
if (fill == pb_UV.Fill.Stretch)
{
uvs = pb_UVUtility.StretchUVs(uvs, indices);
}
}
else
{
uvs = pb_UVUtility.NormalizeUVs(uvs, indices);
}
}
if (!uvSettings.useWorldSpace && uvSettings.anchor != pb_UV.Anchor.None)
{
pb_UVUtility.ApplyUVAnchor(uvs, indices, uvSettings.anchor);
}
if (uvSettings.scale.x != 1f || uvSettings.scale.y != 1f || uvSettings.rotation != 0f)
{
Vector2 vector = pb_Bounds2D.Center(uvs, indices);
for (int i = 0; i < num; i++)
{
uvs[indices[i]] = uvs[indices[i]].ScaleAroundPoint(vector, uvSettings.scale);
uvs[indices[i]] = uvs[indices[i]].RotateAroundPoint(vector, uvSettings.rotation);
}
}
if (uvSettings.flipU || uvSettings.flipV || uvSettings.swapUV)
{
for (int j = 0; j < num; j++)
{
float num2 = uvs[indices[j]].x;
float num3 = uvs[indices[j]].y;
if (uvSettings.flipU)
{
num2 = -num2;
}
if (uvSettings.flipV)
{
num3 = -num3;
}
if (!uvSettings.swapUV)
{
uvs[indices[j]].x = num2;
uvs[indices[j]].y = num3;
}
else
{
uvs[indices[j]].x = num3;
uvs[indices[j]].y = num2;
}
}
}
uvSettings.localPivot = pb_Bounds2D.Center(uvs, indices);
for (int k = 0; k < indices.Length; k++)
{
Vector2[] array = uvs;
int num4 = indices[k];
array[num4].x = array[num4].x - uvSettings.offset.x;
Vector2[] array2 = uvs;
int num5 = indices[k];
array2[num5].y = array2[num5].y - uvSettings.offset.y;
}
}
// Token: 0x06000225 RID: 549 RVA: 0x0001D764 File Offset: 0x0001BB64
private static Vector2[] StretchUVs(Vector2[] uvs, int[] indices)
{
Vector2 vector = pb_Math.LargestVector2(uvs, indices) - pb_Math.SmallestVector2(uvs, indices);
for (int i = 0; i < indices.Length; i++)
{
uvs[i].x = uvs[indices[i]].x / vector.x;
uvs[i].y = uvs[indices[i]].y / vector.y;
}
return uvs;
}
// Token: 0x06000226 RID: 550 RVA: 0x0001D7E0 File Offset: 0x0001BBE0
private static Vector2[] NormalizeUVs(Vector2[] uvs, int[] indices)
{
int num = indices.Length;
Vector2 vector = pb_Math.SmallestVector2(uvs, indices);
for (int i = 0; i < num; i++)
{
int num2 = indices[i];
uvs[num2].x = uvs[num2].x - vector.x;
int num3 = indices[i];
uvs[num3].y = uvs[num3].y - vector.y;
}
float num4 = pb_Math.LargestValue(pb_Math.LargestVector2(uvs, indices));
for (int i = 0; i < num; i++)
{
int num5 = indices[i];
uvs[num5].x = uvs[num5].x / num4;
int num6 = indices[i];
uvs[num6].y = uvs[num6].y / num4;
}
return uvs;
}
// Token: 0x06000227 RID: 551 RVA: 0x0001D890 File Offset: 0x0001BC90
[Obsolete("See ApplyAnchor().")]
private static Vector2[] JustifyUVs(Vector2[] uvs, pb_UV.Justify j)
{
Vector2 vector = new Vector2(0f, 0f);
switch (j)
{
case pb_UV.Justify.Right:
vector = new Vector2(pb_Math.LargestVector2(uvs).x - 1f, 0f);
break;
case pb_UV.Justify.Left:
vector = new Vector2(pb_Math.SmallestVector2(uvs).x, 0f);
break;
case pb_UV.Justify.Top:
vector = new Vector2(0f, pb_Math.LargestVector2(uvs).y - 1f);
break;
case pb_UV.Justify.Center:
vector = pb_Math.Average(uvs, null) - new Vector2(0.5f, 0.5f);
break;
case pb_UV.Justify.Bottom:
vector = new Vector2(0f, pb_Math.SmallestVector2(uvs).y);
break;
}
for (int i = 0; i < uvs.Length; i++)
{
uvs[i] -= vector;
}
return uvs;
}
// Token: 0x06000228 RID: 552 RVA: 0x0001D9AC File Offset: 0x0001BDAC
private static void ApplyUVAnchor(Vector2[] uvs, int[] indices, pb_UV.Anchor anchor)
{
pb_UVUtility.tvec2.x = 0f;
pb_UVUtility.tvec2.y = 0f;
Vector2 vector = pb_Math.SmallestVector2(uvs, indices);
Vector2 vector2 = pb_Math.LargestVector2(uvs, indices);
if (anchor == pb_UV.Anchor.UpperLeft || anchor == pb_UV.Anchor.MiddleLeft || anchor == pb_UV.Anchor.LowerLeft)
{
pb_UVUtility.tvec2.x = vector.x;
}
else if (anchor == pb_UV.Anchor.UpperRight || anchor == pb_UV.Anchor.MiddleRight || anchor == pb_UV.Anchor.LowerRight)
{
pb_UVUtility.tvec2.x = vector2.x - 1f;
}
else
{
pb_UVUtility.tvec2.x = vector.x + (vector2.x - vector.x) * 0.5f - 0.5f;
}
if (anchor == pb_UV.Anchor.UpperLeft || anchor == pb_UV.Anchor.UpperCenter || anchor == pb_UV.Anchor.UpperRight)
{
pb_UVUtility.tvec2.y = vector2.y - 1f;
}
else if (anchor == pb_UV.Anchor.MiddleLeft || anchor == pb_UV.Anchor.MiddleCenter || anchor == pb_UV.Anchor.MiddleRight)
{
pb_UVUtility.tvec2.y = vector.y + (vector2.y - vector.y) * 0.5f - 0.5f;
}
else
{
pb_UVUtility.tvec2.y = vector.y;
}
int num = indices.Length;
for (int i = 0; i < num; i++)
{
int num2 = indices[i];
uvs[num2].x = uvs[num2].x - pb_UVUtility.tvec2.x;
int num3 = indices[i];
uvs[num3].y = uvs[num3].y - pb_UVUtility.tvec2.y;
}
}
// Token: 0x0400019C RID: 412
private static Vector2 tvec2 = Vector2.zero;
}
}
@@ -0,0 +1,39 @@
using System;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000058 RID: 88
[Serializable]
public class pb_UnwrapParameters
{
// Token: 0x06000294 RID: 660 RVA: 0x0001FA0E File Offset: 0x0001DE0E
public void Reset()
{
this.hardAngle = 88f;
this.packMargin = 4f;
this.angleError = 8f;
this.areaError = 15f;
}
// Token: 0x040001D4 RID: 468
[Tooltip("Angle between neighbor triangles that will generate seam.")]
[Range(1f, 180f)]
public float hardAngle = 88f;
// Token: 0x040001D5 RID: 469
[Tooltip("Measured in pixels, assuming mesh will cover an entire 1024x1024 lightmap.")]
[Range(1f, 64f)]
public float packMargin = 4f;
// Token: 0x040001D6 RID: 470
[Tooltip("Measured in percents. Angle error measures deviation of UV angles from geometry angles. Area error measures deviation of UV triangles area from geometry triangles if they were uniformly scaled.")]
[Range(1f, 75f)]
public float angleError = 8f;
// Token: 0x040001D7 RID: 471
[Tooltip("Does... something.")]
[Range(1f, 75f)]
public float areaError = 15f;
}
}
+39
View File
@@ -0,0 +1,39 @@
using System;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000059 RID: 89
public static class pb_Vector
{
// Token: 0x06000295 RID: 661 RVA: 0x0001FA3C File Offset: 0x0001DE3C
public static int GetHashCode(Vector2 v)
{
int num = 27;
num = num * 29 + Convert.ToInt32(v.x * 1000f);
return num * 29 + Convert.ToInt32(v.y * 1000f);
}
// Token: 0x06000296 RID: 662 RVA: 0x0001FA80 File Offset: 0x0001DE80
public static int GetHashCode(Vector3 v)
{
int num = 27;
num = num * 29 + Convert.ToInt32(v.x * 1000f);
num = num * 29 + Convert.ToInt32(v.y * 1000f);
return num * 29 + Convert.ToInt32(v.z * 1000f);
}
// Token: 0x06000297 RID: 663 RVA: 0x0001FADC File Offset: 0x0001DEDC
public static int GetHashCode(Vector4 v)
{
int num = 27;
num = num * 29 + Convert.ToInt32(v.x * 1000f);
num = num * 29 + Convert.ToInt32(v.y * 1000f);
num = num * 29 + Convert.ToInt32(v.z * 1000f);
return num * 29 + Convert.ToInt32(v.w * 1000f);
}
// Token: 0x040001D8 RID: 472
public const float FLT_COMPARE_RESOLUTION = 1000f;
}
}
+564
View File
@@ -0,0 +1,564 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x0200005A RID: 90
public class pb_Vertex : IEquatable<pb_Vertex>
{
// Token: 0x06000298 RID: 664 RVA: 0x0001FB4D File Offset: 0x0001DF4D
public pb_Vertex(bool hasAllValues = false)
{
this.hasPosition = hasAllValues;
this.hasColor = hasAllValues;
this.hasNormal = hasAllValues;
this.hasTangent = hasAllValues;
this.hasUv0 = hasAllValues;
this.hasUv2 = hasAllValues;
this.hasUv3 = hasAllValues;
this.hasUv4 = hasAllValues;
}
// Token: 0x06000299 RID: 665 RVA: 0x0001FB90 File Offset: 0x0001DF90
public pb_Vertex(pb_Vertex v)
{
this.position = v.position;
this.hasPosition = v.hasPosition;
this.color = v.color;
this.hasColor = v.hasColor;
this.uv0 = v.uv0;
this.hasUv0 = v.hasUv0;
this.normal = v.normal;
this.hasNormal = v.hasNormal;
this.tangent = v.tangent;
this.hasTangent = v.hasTangent;
this.uv2 = v.uv2;
this.hasUv2 = v.hasUv2;
this.uv3 = v.uv3;
this.hasUv3 = v.hasUv3;
this.uv4 = v.uv4;
this.hasUv4 = v.hasUv4;
}
// Token: 0x0600029A RID: 666 RVA: 0x0001FC63 File Offset: 0x0001E063
public override bool Equals(object other)
{
return other is pb_Vertex && this.Equals(other as pb_Vertex);
}
// Token: 0x0600029B RID: 667 RVA: 0x0001FC80 File Offset: 0x0001E080
public bool Equals(pb_Vertex other)
{
return other != null && (this.position.Approx3(other.position, 0.0001f) && this.color.ApproxC(other.color, 0.0001f) && this.normal.Approx3(other.normal, 0.0001f) && this.tangent.Approx4(other.tangent, 0.0001f) && this.uv0.Approx2(other.uv0, 0.0001f) && this.uv2.Approx2(other.uv2, 0.0001f) && this.uv3.Approx4(other.uv3, 0.0001f)) && this.uv4.Approx4(other.uv4, 0.0001f);
}
// Token: 0x0600029C RID: 668 RVA: 0x0001FD6C File Offset: 0x0001E16C
public override int GetHashCode()
{
int num = 783 + pb_Vector.GetHashCode(this.position);
num = num * 29 + pb_Vector.GetHashCode(this.uv0);
return num * 31 + pb_Vector.GetHashCode(this.normal);
}
// Token: 0x0600029D RID: 669 RVA: 0x0001FDB0 File Offset: 0x0001E1B0
public static pb_Vertex operator +(pb_Vertex a, pb_Vertex b)
{
pb_Vertex pb_Vertex = new pb_Vertex(a);
pb_Vertex.Add(b);
return pb_Vertex;
}
// Token: 0x0600029E RID: 670 RVA: 0x0001FDCC File Offset: 0x0001E1CC
public void Add(pb_Vertex b)
{
this.position += b.position;
this.color += b.color;
this.normal += b.normal;
this.tangent += b.tangent;
this.uv0 += b.uv0;
this.uv2 += b.uv2;
this.uv3 += b.uv3;
this.uv4 += b.uv4;
}
// Token: 0x0600029F RID: 671 RVA: 0x0001FE94 File Offset: 0x0001E294
public static pb_Vertex operator -(pb_Vertex a, pb_Vertex b)
{
pb_Vertex pb_Vertex = new pb_Vertex(a);
pb_Vertex.Subtract(b);
return pb_Vertex;
}
// Token: 0x060002A0 RID: 672 RVA: 0x0001FEB0 File Offset: 0x0001E2B0
public void Subtract(pb_Vertex b)
{
this.position -= b.position;
this.color -= b.color;
this.normal -= b.normal;
this.tangent -= b.tangent;
this.uv0 -= b.uv0;
this.uv2 -= b.uv2;
this.uv3 -= b.uv3;
this.uv4 -= b.uv4;
}
// Token: 0x060002A1 RID: 673 RVA: 0x0001FF78 File Offset: 0x0001E378
public static pb_Vertex operator *(pb_Vertex a, float value)
{
pb_Vertex pb_Vertex = new pb_Vertex(a);
pb_Vertex.Multiply(value);
return pb_Vertex;
}
// Token: 0x060002A2 RID: 674 RVA: 0x0001FF94 File Offset: 0x0001E394
public void Multiply(float value)
{
this.position *= value;
this.color *= value;
this.normal *= value;
this.tangent *= value;
this.uv0 *= value;
this.uv2 *= value;
this.uv3 *= value;
this.uv4 *= value;
}
// Token: 0x060002A3 RID: 675 RVA: 0x00020034 File Offset: 0x0001E434
public static pb_Vertex operator /(pb_Vertex a, float value)
{
pb_Vertex pb_Vertex = new pb_Vertex(a);
pb_Vertex.Divide(value);
return pb_Vertex;
}
// Token: 0x060002A4 RID: 676 RVA: 0x00020050 File Offset: 0x0001E450
public void Divide(float value)
{
this.position /= value;
this.color /= value;
this.normal /= value;
this.tangent /= value;
this.uv0 /= value;
this.uv2 /= value;
this.uv3 /= value;
this.uv4 /= value;
}
// Token: 0x060002A5 RID: 677 RVA: 0x000200F0 File Offset: 0x0001E4F0
public void Normalize()
{
this.position.Normalize();
Vector4 vector = this.color;
vector.Normalize();
this.color.r = vector.x;
this.color.g = vector.y;
this.color.b = vector.z;
this.color.a = vector.w;
this.normal.Normalize();
this.tangent.Normalize();
this.uv0.Normalize();
this.uv2.Normalize();
this.uv3.Normalize();
this.uv4.Normalize();
}
// Token: 0x060002A6 RID: 678 RVA: 0x000201A5 File Offset: 0x0001E5A5
public override string ToString()
{
return this.position.ToString();
}
// Token: 0x060002A7 RID: 679 RVA: 0x000201B8 File Offset: 0x0001E5B8
public static pb_Vertex[] GetVertices(pb_Object pb, IList<int> indices = null)
{
int vertexCount = pb.vertexCount;
int num = ((indices == null) ? pb.vertexCount : indices.Count);
pb_Vertex[] array = new pb_Vertex[num];
Vector3[] vertices = pb.vertices;
Color[] colors = pb.colors;
Vector2[] uv = pb.uv;
Vector3[] normals = pb.msh.normals;
Vector4[] tangents = pb.msh.tangents;
Vector2[] array2 = pb.msh.uv2;
List<Vector4> list = new List<Vector4>();
List<Vector4> list2 = new List<Vector4>();
pb.GetUVs(2, list);
pb.GetUVs(3, list2);
bool flag = vertices != null && vertices.Count<Vector3>() == vertexCount;
bool flag2 = colors != null && colors.Count<Color>() == vertexCount;
bool flag3 = normals != null && normals.Count<Vector3>() == vertexCount;
bool flag4 = tangents != null && tangents.Count<Vector4>() == vertexCount;
bool flag5 = uv != null && uv.Count<Vector2>() == vertexCount;
bool flag6 = array2 != null && array2.Count<Vector2>() == vertexCount;
bool flag7 = list != null && list.Count<Vector4>() == vertexCount;
bool flag8 = list2 != null && list2.Count<Vector4>() == vertexCount;
for (int i = 0; i < num; i++)
{
array[i] = new pb_Vertex(false);
int num2 = ((indices != null) ? indices[i] : i);
if (flag)
{
array[i].hasPosition = true;
array[i].position = vertices[num2];
}
if (flag2)
{
array[i].hasColor = true;
array[i].color = colors[num2];
}
if (flag3)
{
array[i].hasNormal = true;
array[i].normal = normals[num2];
}
if (flag4)
{
array[i].hasTangent = true;
array[i].tangent = tangents[num2];
}
if (flag5)
{
array[i].hasUv0 = true;
array[i].uv0 = uv[num2];
}
if (flag6)
{
array[i].hasUv2 = true;
array[i].uv2 = array2[num2];
}
if (flag7)
{
array[i].hasUv3 = true;
array[i].uv3 = list[num2];
}
if (flag8)
{
array[i].hasUv4 = true;
array[i].uv4 = list2[num2];
}
}
return array;
}
// Token: 0x060002A8 RID: 680 RVA: 0x00020464 File Offset: 0x0001E864
public static pb_Vertex[] GetVertices(Mesh m)
{
if (m == null)
{
return null;
}
int vertexCount = m.vertexCount;
pb_Vertex[] array = new pb_Vertex[vertexCount];
Vector3[] vertices = m.vertices;
Color[] colors = m.colors;
Vector3[] normals = m.normals;
Vector4[] tangents = m.tangents;
Vector2[] uv = m.uv;
Vector2[] array2 = m.uv2;
List<Vector4> list = new List<Vector4>();
List<Vector4> list2 = new List<Vector4>();
m.GetUVs(2, list);
m.GetUVs(3, list2);
bool flag = vertices != null && vertices.Count<Vector3>() == vertexCount;
bool flag2 = colors != null && colors.Count<Color>() == vertexCount;
bool flag3 = normals != null && normals.Count<Vector3>() == vertexCount;
bool flag4 = tangents != null && tangents.Count<Vector4>() == vertexCount;
bool flag5 = uv != null && uv.Count<Vector2>() == vertexCount;
bool flag6 = array2 != null && array2.Count<Vector2>() == vertexCount;
bool flag7 = list != null && list.Count<Vector4>() == vertexCount;
bool flag8 = list2 != null && list2.Count<Vector4>() == vertexCount;
for (int i = 0; i < vertexCount; i++)
{
array[i] = new pb_Vertex(false);
if (flag)
{
array[i].hasPosition = true;
array[i].position = vertices[i];
}
if (flag2)
{
array[i].hasColor = true;
array[i].color = colors[i];
}
if (flag3)
{
array[i].hasNormal = true;
array[i].normal = normals[i];
}
if (flag4)
{
array[i].hasTangent = true;
array[i].tangent = tangents[i];
}
if (flag5)
{
array[i].hasUv0 = true;
array[i].uv0 = uv[i];
}
if (flag6)
{
array[i].hasUv2 = true;
array[i].uv2 = array2[i];
}
if (flag7)
{
array[i].hasUv3 = true;
array[i].uv3 = list[i];
}
if (flag8)
{
array[i].hasUv4 = true;
array[i].uv4 = list2[i];
}
}
return array;
}
// Token: 0x060002A9 RID: 681 RVA: 0x000206DC File Offset: 0x0001EADC
public static void GetArrays(IList<pb_Vertex> vertices, out Vector3[] position, out Color[] color, out Vector2[] uv0, out Vector3[] normal, out Vector4[] tangent, out Vector2[] uv2, out List<Vector4> uv3, out List<Vector4> uv4)
{
int count = vertices.Count;
position = new Vector3[count];
color = new Color[count];
uv0 = new Vector2[count];
normal = new Vector3[count];
tangent = new Vector4[count];
uv2 = new Vector2[count];
uv3 = new List<Vector4>(count);
uv4 = new List<Vector4>(count);
for (int i = 0; i < count; i++)
{
position[i] = vertices[i].position;
color[i] = vertices[i].color;
uv0[i] = vertices[i].uv0;
normal[i] = vertices[i].normal;
tangent[i] = vertices[i].tangent;
uv2[i] = vertices[i].uv2;
uv3.Add(vertices[i].uv3);
uv4.Add(vertices[i].uv4);
}
}
// Token: 0x060002AA RID: 682 RVA: 0x00020808 File Offset: 0x0001EC08
public static void SetMesh(Mesh m, IList<pb_Vertex> vertices)
{
Vector3[] array = null;
Color[] array2 = null;
Vector2[] array3 = null;
Vector3[] array4 = null;
Vector4[] array5 = null;
Vector2[] array6 = null;
List<Vector4> list = null;
List<Vector4> list2 = null;
pb_Vertex.GetArrays(vertices, out array, out array2, out array3, out array4, out array5, out array6, out list, out list2);
m.Clear();
pb_Vertex pb_Vertex = vertices[0];
if (pb_Vertex.hasPosition)
{
m.vertices = array;
}
if (pb_Vertex.hasColor)
{
m.colors = array2;
}
if (pb_Vertex.hasUv0)
{
m.uv = array3;
}
if (pb_Vertex.hasNormal)
{
m.normals = array4;
}
if (pb_Vertex.hasTangent)
{
m.tangents = array5;
}
if (pb_Vertex.hasUv2)
{
m.uv2 = array6;
}
if (pb_Vertex.hasUv3 && list != null)
{
m.SetUVs(2, list);
}
if (pb_Vertex.hasUv4 && list2 != null)
{
m.SetUVs(3, list2);
}
}
// Token: 0x060002AB RID: 683 RVA: 0x000208FC File Offset: 0x0001ECFC
public static pb_Vertex Average(IList<pb_Vertex> vertices, IList<int> indices = null)
{
pb_Vertex pb_Vertex = new pb_Vertex(false);
int num = ((indices == null) ? vertices.Count : indices.Count);
int num2 = 0;
int num3 = 0;
int num4 = 0;
int num5 = 0;
int num6 = 0;
for (int i = 0; i < num; i++)
{
int num7 = ((indices != null) ? indices[i] : i);
pb_Vertex.position += vertices[num7].position;
pb_Vertex.color += vertices[num7].color;
pb_Vertex.uv0 += vertices[num7].uv0;
if (vertices[num7].hasNormal)
{
num2++;
pb_Vertex.normal += vertices[num7].normal;
}
if (vertices[num7].hasTangent)
{
num3++;
pb_Vertex.tangent += vertices[num7].tangent;
}
if (vertices[num7].hasUv2)
{
num4++;
pb_Vertex.uv2 += vertices[num7].uv2;
}
if (vertices[num7].hasUv3)
{
num5++;
pb_Vertex.uv3 += vertices[num7].uv3;
}
if (vertices[num7].hasUv4)
{
num6++;
pb_Vertex.uv4 += vertices[num7].uv4;
}
}
pb_Vertex.position *= 1f / (float)num;
pb_Vertex.color *= 1f / (float)num;
pb_Vertex.uv0 *= 1f / (float)num;
pb_Vertex.normal *= 1f / (float)num2;
pb_Vertex.tangent *= 1f / (float)num3;
pb_Vertex.uv2 *= 1f / (float)num4;
pb_Vertex.uv3 *= 1f / (float)num5;
pb_Vertex.uv4 *= 1f / (float)num6;
return pb_Vertex;
}
// Token: 0x060002AC RID: 684 RVA: 0x00020B94 File Offset: 0x0001EF94
public static pb_Vertex Mix(pb_Vertex x, pb_Vertex y, float a)
{
float num = 1f - a;
pb_Vertex pb_Vertex = new pb_Vertex(false);
pb_Vertex.position = x.position * num + y.position * a;
pb_Vertex.color = x.color * num + y.color * a;
pb_Vertex.uv0 = x.uv0 * num + y.uv0 * a;
if (x.hasNormal && y.hasNormal)
{
pb_Vertex.normal = x.normal * num + y.normal * a;
}
else if (x.hasNormal)
{
pb_Vertex.normal = x.normal;
}
else if (y.hasNormal)
{
pb_Vertex.normal = y.normal;
}
if (x.hasTangent && y.hasTangent)
{
pb_Vertex.tangent = x.tangent * num + y.tangent * a;
}
else if (x.hasTangent)
{
pb_Vertex.tangent = x.tangent;
}
else if (y.hasTangent)
{
pb_Vertex.tangent = y.tangent;
}
if (x.hasUv2 && y.hasUv2)
{
pb_Vertex.uv2 = x.uv2 * num + y.uv2 * a;
}
else if (x.hasUv2)
{
pb_Vertex.uv2 = x.uv2;
}
else if (y.hasUv2)
{
pb_Vertex.uv2 = y.uv2;
}
if (x.hasUv3 && y.hasUv3)
{
pb_Vertex.uv3 = x.uv3 * num + y.uv3 * a;
}
else if (x.hasUv3)
{
pb_Vertex.uv3 = x.uv3;
}
else if (y.hasUv3)
{
pb_Vertex.uv3 = y.uv3;
}
if (x.hasUv4 && y.hasUv4)
{
pb_Vertex.uv4 = x.uv4 * num + y.uv4 * a;
}
else if (x.hasUv4)
{
pb_Vertex.uv4 = x.uv4;
}
else if (y.hasUv4)
{
pb_Vertex.uv4 = y.uv4;
}
return pb_Vertex;
}
// Token: 0x040001D9 RID: 473
public Vector3 position;
// Token: 0x040001DA RID: 474
public Color color;
// Token: 0x040001DB RID: 475
public Vector3 normal;
// Token: 0x040001DC RID: 476
public Vector4 tangent;
// Token: 0x040001DD RID: 477
public Vector2 uv0;
// Token: 0x040001DE RID: 478
public Vector2 uv2;
// Token: 0x040001DF RID: 479
public Vector4 uv3;
// Token: 0x040001E0 RID: 480
public Vector4 uv4;
// Token: 0x040001E1 RID: 481
public bool hasPosition;
// Token: 0x040001E2 RID: 482
public bool hasColor;
// Token: 0x040001E3 RID: 483
public bool hasNormal;
// Token: 0x040001E4 RID: 484
public bool hasTangent;
// Token: 0x040001E5 RID: 485
public bool hasUv0;
// Token: 0x040001E6 RID: 486
public bool hasUv2;
// Token: 0x040001E7 RID: 487
public bool hasUv3;
// Token: 0x040001E8 RID: 488
public bool hasUv4;
}
}
@@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace ProBuilder2.Common
{
// Token: 0x0200005B RID: 91
public class pb_VertexConnection : IEquatable<pb_VertexConnection>
{
// Token: 0x060002AD RID: 685 RVA: 0x00020E4F File Offset: 0x0001F24F
public pb_VertexConnection(pb_Face face, List<int> indices)
{
this.face = face;
this.indices = indices;
}
// Token: 0x1700003D RID: 61
// (get) Token: 0x060002AE RID: 686 RVA: 0x00020E65 File Offset: 0x0001F265
public bool isValid
{
get
{
return this.indices != null && this.indices.Count > 1;
}
}
// Token: 0x060002AF RID: 687 RVA: 0x00020E83 File Offset: 0x0001F283
public pb_VertexConnection Distinct(pb_IntArray[] sharedIndices)
{
return new pb_VertexConnection(this.face, sharedIndices.UniqueIndicesWithValues(this.indices).ToList<int>());
}
// Token: 0x060002B0 RID: 688 RVA: 0x00020EA1 File Offset: 0x0001F2A1
public override bool Equals(object b)
{
return b is pb_VertexConnection && this.face == ((pb_VertexConnection)b).face;
}
// Token: 0x060002B1 RID: 689 RVA: 0x00020EC7 File Offset: 0x0001F2C7
public bool Equals(pb_VertexConnection vc)
{
return this.face == vc.face;
}
// Token: 0x060002B2 RID: 690 RVA: 0x00020ED7 File Offset: 0x0001F2D7
public static implicit operator pb_Face(pb_VertexConnection vc)
{
return vc.face;
}
// Token: 0x060002B3 RID: 691 RVA: 0x00020EDF File Offset: 0x0001F2DF
public override int GetHashCode()
{
return base.GetHashCode();
}
// Token: 0x060002B4 RID: 692 RVA: 0x00020EE7 File Offset: 0x0001F2E7
public override string ToString()
{
return this.face.ToString() + " : " + this.indices.ToString(", ");
}
// Token: 0x060002B5 RID: 693 RVA: 0x00020F10 File Offset: 0x0001F310
public static List<int> AllTriangles(List<pb_VertexConnection> vcs)
{
List<int> list = new List<int>();
for (int i = 0; i < vcs.Count; i++)
{
list.AddRange(vcs[i].indices);
}
return list;
}
// Token: 0x040001E9 RID: 489
public pb_Face face;
// Token: 0x040001EA RID: 490
public List<int> indices;
}
}
+218
View File
@@ -0,0 +1,218 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace ProBuilder2.Common
{
// Token: 0x0200005C RID: 92
public class pb_WingedEdge : IEquatable<pb_WingedEdge>, IEnumerable
{
// Token: 0x060002B7 RID: 695 RVA: 0x00020F55 File Offset: 0x0001F355
public bool Equals(pb_WingedEdge b)
{
return b != null && this.edge.local.Equals(b.edge.local);
}
// Token: 0x060002B8 RID: 696 RVA: 0x00020F7C File Offset: 0x0001F37C
public override bool Equals(object b)
{
pb_WingedEdge pb_WingedEdge = b as pb_WingedEdge;
if (pb_WingedEdge != null && this.Equals(pb_WingedEdge))
{
return true;
}
pb_Edge pb_Edge = b as pb_Edge;
return pb_Edge == null || !this.Equals(pb_Edge) || true;
}
// Token: 0x060002B9 RID: 697 RVA: 0x00020FC0 File Offset: 0x0001F3C0
public override int GetHashCode()
{
return this.edge.local.GetHashCode();
}
// Token: 0x060002BA RID: 698 RVA: 0x00020FD2 File Offset: 0x0001F3D2
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
// Token: 0x060002BB RID: 699 RVA: 0x00020FDA File Offset: 0x0001F3DA
public pb_WingedEdgeEnumerator GetEnumerator()
{
return new pb_WingedEdgeEnumerator(this);
}
// Token: 0x060002BC RID: 700 RVA: 0x00020FE4 File Offset: 0x0001F3E4
public override string ToString()
{
return string.Format("Common: {0}\nLocal: {1}\nOpposite: {2}\nFace: {3}", new object[]
{
this.edge.common.ToString(),
this.edge.local.ToString(),
(this.opposite != null) ? this.opposite.edge.ToString() : "null",
this.face.ToString()
});
}
// Token: 0x060002BD RID: 701 RVA: 0x00021060 File Offset: 0x0001F460
public pb_WingedEdge GetAdjacentEdgeWithCommonIndex(int common)
{
if (this.next.edge.common.Contains(common))
{
return this.next;
}
if (this.previous.edge.common.Contains(common))
{
return this.previous;
}
return null;
}
// Token: 0x060002BE RID: 702 RVA: 0x000210B4 File Offset: 0x0001F4B4
public static List<pb_Edge> SortEdgesByAdjacency(pb_Face face)
{
List<pb_Edge> list = new List<pb_Edge>(face.edges);
return pb_WingedEdge.SortEdgesByAdjacency(list);
}
// Token: 0x060002BF RID: 703 RVA: 0x000210D4 File Offset: 0x0001F4D4
public static List<pb_Edge> SortEdgesByAdjacency(List<pb_Edge> edges)
{
for (int i = 1; i < edges.Count; i++)
{
int y = edges[i - 1].y;
for (int j = i + 1; j < edges.Count; j++)
{
if (edges[j].x == y || edges[j].y == y)
{
pb_Edge pb_Edge = edges[j];
edges[j] = edges[i];
edges[i] = pb_Edge;
}
}
}
return edges;
}
// Token: 0x060002C0 RID: 704 RVA: 0x00021164 File Offset: 0x0001F564
public static Dictionary<int, List<pb_WingedEdge>> GetSpokes(List<pb_WingedEdge> wings)
{
Dictionary<int, List<pb_WingedEdge>> dictionary = new Dictionary<int, List<pb_WingedEdge>>();
List<pb_WingedEdge> list = null;
for (int i = 0; i < wings.Count; i++)
{
if (dictionary.TryGetValue(wings[i].edge.common.x, out list))
{
list.Add(wings[i]);
}
else
{
dictionary.Add(wings[i].edge.common.x, new List<pb_WingedEdge> { wings[i] });
}
if (dictionary.TryGetValue(wings[i].edge.common.y, out list))
{
list.Add(wings[i]);
}
else
{
dictionary.Add(wings[i].edge.common.y, new List<pb_WingedEdge> { wings[i] });
}
}
return dictionary;
}
// Token: 0x060002C1 RID: 705 RVA: 0x0002125C File Offset: 0x0001F65C
public static List<int> SortCommonIndicesByAdjacency(List<pb_WingedEdge> wings, HashSet<int> common)
{
List<pb_Edge> list = (from x in wings
where common.Contains(x.edge.common.x) && common.Contains(x.edge.common.y)
select x into y
select y.edge.common).ToList<pb_Edge>();
if (list.Count != common.Count)
{
return null;
}
return (from x in pb_WingedEdge.SortEdgesByAdjacency(list)
select x.x).ToList<int>();
}
// Token: 0x060002C2 RID: 706 RVA: 0x000212F5 File Offset: 0x0001F6F5
public static List<pb_WingedEdge> GetWingedEdges(pb_Object pb, bool oneWingPerFace = false)
{
return pb_WingedEdge.GetWingedEdges(pb, pb.faces, oneWingPerFace, null);
}
// Token: 0x060002C3 RID: 707 RVA: 0x00021308 File Offset: 0x0001F708
public static List<pb_WingedEdge> GetWingedEdges(pb_Object pb, IEnumerable<pb_Face> faces, bool oneWingPerFace = false, Dictionary<int, int> sharedIndexLookup = null)
{
Dictionary<int, int> dictionary = ((sharedIndexLookup != null) ? sharedIndexLookup : pb.sharedIndices.ToDictionary());
IEnumerable<pb_Face> enumerable = faces.Distinct<pb_Face>();
List<pb_WingedEdge> list = new List<pb_WingedEdge>();
Dictionary<pb_Edge, pb_WingedEdge> dictionary2 = new Dictionary<pb_Edge, pb_WingedEdge>();
int num = 0;
foreach (pb_Face pb_Face in enumerable)
{
List<pb_Edge> list2 = pb_WingedEdge.SortEdgesByAdjacency(pb_Face);
int count = list2.Count;
pb_WingedEdge pb_WingedEdge = null;
pb_WingedEdge pb_WingedEdge2 = null;
for (int i = 0; i < count; i++)
{
pb_Edge pb_Edge = list2[i];
pb_WingedEdge pb_WingedEdge3 = new pb_WingedEdge();
pb_WingedEdge3.edge = new pb_EdgeLookup(dictionary[pb_Edge.x], dictionary[pb_Edge.y], pb_Edge.x, pb_Edge.y);
pb_WingedEdge3.face = pb_Face;
if (i < 1)
{
pb_WingedEdge = pb_WingedEdge3;
}
if (i > 0)
{
pb_WingedEdge3.previous = pb_WingedEdge2;
pb_WingedEdge2.next = pb_WingedEdge3;
}
if (i == count - 1)
{
pb_WingedEdge3.next = pb_WingedEdge;
pb_WingedEdge.previous = pb_WingedEdge3;
}
pb_WingedEdge2 = pb_WingedEdge3;
pb_WingedEdge pb_WingedEdge4;
if (dictionary2.TryGetValue(pb_WingedEdge3.edge.common, out pb_WingedEdge4))
{
pb_WingedEdge4.opposite = pb_WingedEdge3;
pb_WingedEdge3.opposite = pb_WingedEdge4;
}
else
{
pb_WingedEdge3.opposite = null;
dictionary2.Add(pb_WingedEdge3.edge.common, pb_WingedEdge3);
}
if (!oneWingPerFace || i < 1)
{
list.Add(pb_WingedEdge3);
}
}
num += count;
}
return list;
}
// Token: 0x040001EB RID: 491
public pb_EdgeLookup edge;
// Token: 0x040001EC RID: 492
public pb_Face face;
// Token: 0x040001ED RID: 493
public pb_WingedEdge next;
// Token: 0x040001EE RID: 494
public pb_WingedEdge previous;
// Token: 0x040001EF RID: 495
public pb_WingedEdge opposite;
}
}
@@ -0,0 +1,69 @@
using System;
using System.Collections;
namespace ProBuilder2.Common
{
// Token: 0x0200005D RID: 93
public class pb_WingedEdgeEnumerator : IEnumerator
{
// Token: 0x060002C6 RID: 710 RVA: 0x00021521 File Offset: 0x0001F921
public pb_WingedEdgeEnumerator(pb_WingedEdge start)
{
this._start = start;
this._current = null;
}
// Token: 0x060002C7 RID: 711 RVA: 0x00021538 File Offset: 0x0001F938
public bool MoveNext()
{
if (this._current == null)
{
this._current = this._start;
return this._current != null;
}
this._current = this._current.next;
return this._current != null && this._current != this._start;
}
// Token: 0x060002C8 RID: 712 RVA: 0x00021599 File Offset: 0x0001F999
public void Reset()
{
this._current = null;
}
// Token: 0x1700003E RID: 62
// (get) Token: 0x060002C9 RID: 713 RVA: 0x000215A2 File Offset: 0x0001F9A2
object IEnumerator.Current
{
get
{
return this.Current;
}
}
// Token: 0x1700003F RID: 63
// (get) Token: 0x060002CA RID: 714 RVA: 0x000215AC File Offset: 0x0001F9AC
public pb_WingedEdge Current
{
get
{
pb_WingedEdge current;
try
{
current = this._current;
}
catch (IndexOutOfRangeException)
{
throw new InvalidOperationException();
}
return current;
}
}
// Token: 0x040001F2 RID: 498
private pb_WingedEdge _start;
// Token: 0x040001F3 RID: 499
private pb_WingedEdge _current;
}
}
+44
View File
@@ -0,0 +1,44 @@
using System;
using UnityEngine;
namespace ProBuilder2.Common
{
// Token: 0x02000009 RID: 9
public class pb_XYZ_Color
{
// Token: 0x06000040 RID: 64 RVA: 0x0000301B File Offset: 0x0000141B
public pb_XYZ_Color(float x, float y, float z)
{
this.x = x;
this.y = y;
this.z = z;
}
// Token: 0x06000041 RID: 65 RVA: 0x00003038 File Offset: 0x00001438
public static pb_XYZ_Color FromRGB(Color col)
{
return pb_ColorUtil.RGBToXYZ(col);
}
// Token: 0x06000042 RID: 66 RVA: 0x00003040 File Offset: 0x00001440
public static pb_XYZ_Color FromRGB(float R, float G, float B)
{
return pb_ColorUtil.RGBToXYZ(R, G, B);
}
// Token: 0x06000043 RID: 67 RVA: 0x0000304A File Offset: 0x0000144A
public override string ToString()
{
return string.Format("( {0}, {1}, {2} )", this.x, this.y, this.z);
}
// Token: 0x04000016 RID: 22
public float x;
// Token: 0x04000017 RID: 23
public float y;
// Token: 0x04000018 RID: 24
public float z;
}
}