scripts
This commit is contained in:
@@ -0,0 +1,168 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x02000103 RID: 259
|
||||
[UsedByNativeCode]
|
||||
public struct CullResults
|
||||
{
|
||||
// Token: 0x06001251 RID: 4689 RVA: 0x00018498 File Offset: 0x00016698
|
||||
public unsafe static bool GetCullingParameters(Camera camera, out CullingParameters cullingParameters)
|
||||
{
|
||||
return CullResults.GetCullingParameters_Internal(camera, out cullingParameters, sizeof(CullingParameters));
|
||||
}
|
||||
|
||||
// Token: 0x06001252 RID: 4690
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern bool GetCullingParameters_Internal(Camera camera, out CullingParameters cullingParameters, int managedCullingParametersSize);
|
||||
|
||||
// Token: 0x06001253 RID: 4691 RVA: 0x000184BC File Offset: 0x000166BC
|
||||
internal static void Internal_Cull(ref CullingParameters parameters, ScriptableRenderContext renderLoop, out CullResults results)
|
||||
{
|
||||
CullResults.INTERNAL_CALL_Internal_Cull(ref parameters, ref renderLoop, out results);
|
||||
}
|
||||
|
||||
// Token: 0x06001254 RID: 4692
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern void INTERNAL_CALL_Internal_Cull(ref CullingParameters parameters, ref ScriptableRenderContext renderLoop, out CullResults results);
|
||||
|
||||
// Token: 0x06001255 RID: 4693 RVA: 0x000184C8 File Offset: 0x000166C8
|
||||
public static CullResults Cull(ref CullingParameters parameters, ScriptableRenderContext renderLoop)
|
||||
{
|
||||
CullResults cullResults;
|
||||
CullResults.Internal_Cull(ref parameters, renderLoop, out cullResults);
|
||||
return cullResults;
|
||||
}
|
||||
|
||||
// Token: 0x06001256 RID: 4694 RVA: 0x000184E8 File Offset: 0x000166E8
|
||||
public static bool Cull(Camera camera, ScriptableRenderContext renderLoop, out CullResults results)
|
||||
{
|
||||
results.cullResults = IntPtr.Zero;
|
||||
results.visibleLights = null;
|
||||
results.visibleOffscreenVertexLights = null;
|
||||
results.visibleReflectionProbes = null;
|
||||
CullingParameters cullingParameters;
|
||||
bool flag;
|
||||
if (!CullResults.GetCullingParameters(camera, out cullingParameters))
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
results = CullResults.Cull(ref cullingParameters, renderLoop);
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06001257 RID: 4695 RVA: 0x00018540 File Offset: 0x00016740
|
||||
public bool GetShadowCasterBounds(int lightIndex, out Bounds outBounds)
|
||||
{
|
||||
return CullResults.GetShadowCasterBounds(this.cullResults, lightIndex, out outBounds);
|
||||
}
|
||||
|
||||
// Token: 0x06001258 RID: 4696
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern bool GetShadowCasterBounds(IntPtr cullResults, int lightIndex, out Bounds bounds);
|
||||
|
||||
// Token: 0x06001259 RID: 4697 RVA: 0x00018564 File Offset: 0x00016764
|
||||
public int GetLightIndicesCount()
|
||||
{
|
||||
return CullResults.GetLightIndicesCount(this.cullResults);
|
||||
}
|
||||
|
||||
// Token: 0x0600125A RID: 4698
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern int GetLightIndicesCount(IntPtr cullResults);
|
||||
|
||||
// Token: 0x0600125B RID: 4699 RVA: 0x00018584 File Offset: 0x00016784
|
||||
public void FillLightIndices(ComputeBuffer computeBuffer)
|
||||
{
|
||||
CullResults.FillLightIndices(this.cullResults, computeBuffer);
|
||||
}
|
||||
|
||||
// Token: 0x0600125C RID: 4700
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern void FillLightIndices(IntPtr cullResults, ComputeBuffer computeBuffer);
|
||||
|
||||
// Token: 0x0600125D RID: 4701 RVA: 0x00018594 File Offset: 0x00016794
|
||||
internal int[] GetLightIndexMap()
|
||||
{
|
||||
return CullResults.GetLightIndexMap(this.cullResults);
|
||||
}
|
||||
|
||||
// Token: 0x0600125E RID: 4702
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern int[] GetLightIndexMap(IntPtr cullResults);
|
||||
|
||||
// Token: 0x0600125F RID: 4703 RVA: 0x000185B4 File Offset: 0x000167B4
|
||||
internal void SetLightIndexMap(int[] mapping)
|
||||
{
|
||||
CullResults.SetLightIndexMap(this.cullResults, mapping);
|
||||
}
|
||||
|
||||
// Token: 0x06001260 RID: 4704
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern void SetLightIndexMap(IntPtr cullResults, int[] mapping);
|
||||
|
||||
// Token: 0x06001261 RID: 4705 RVA: 0x000185C4 File Offset: 0x000167C4
|
||||
public bool ComputeSpotShadowMatricesAndCullingPrimitives(int activeLightIndex, out Matrix4x4 viewMatrix, out Matrix4x4 projMatrix, out ShadowSplitData shadowSplitData)
|
||||
{
|
||||
return CullResults.ComputeSpotShadowMatricesAndCullingPrimitives(this.cullResults, activeLightIndex, out viewMatrix, out projMatrix, out shadowSplitData);
|
||||
}
|
||||
|
||||
// Token: 0x06001262 RID: 4706
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern bool ComputeSpotShadowMatricesAndCullingPrimitives(IntPtr cullResults, int activeLightIndex, out Matrix4x4 viewMatrix, out Matrix4x4 projMatrix, out ShadowSplitData shadowSplitData);
|
||||
|
||||
// Token: 0x06001263 RID: 4707 RVA: 0x000185EC File Offset: 0x000167EC
|
||||
public bool ComputePointShadowMatricesAndCullingPrimitives(int activeLightIndex, CubemapFace cubemapFace, float fovBias, out Matrix4x4 viewMatrix, out Matrix4x4 projMatrix, out ShadowSplitData shadowSplitData)
|
||||
{
|
||||
return CullResults.ComputePointShadowMatricesAndCullingPrimitives(this.cullResults, activeLightIndex, cubemapFace, fovBias, out viewMatrix, out projMatrix, out shadowSplitData);
|
||||
}
|
||||
|
||||
// Token: 0x06001264 RID: 4708
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern bool ComputePointShadowMatricesAndCullingPrimitives(IntPtr cullResults, int activeLightIndex, CubemapFace cubemapFace, float fovBias, out Matrix4x4 viewMatrix, out Matrix4x4 projMatrix, out ShadowSplitData shadowSplitData);
|
||||
|
||||
// Token: 0x06001265 RID: 4709 RVA: 0x00018618 File Offset: 0x00016818
|
||||
public bool ComputeDirectionalShadowMatricesAndCullingPrimitives(int activeLightIndex, int splitIndex, int splitCount, Vector3 splitRatio, int shadowResolution, float shadowNearPlaneOffset, out Matrix4x4 viewMatrix, out Matrix4x4 projMatrix, out ShadowSplitData shadowSplitData)
|
||||
{
|
||||
return CullResults.ComputeDirectionalShadowMatricesAndCullingPrimitives(this.cullResults, activeLightIndex, splitIndex, splitCount, splitRatio, shadowResolution, shadowNearPlaneOffset, out viewMatrix, out projMatrix, out shadowSplitData);
|
||||
}
|
||||
|
||||
// Token: 0x06001266 RID: 4710 RVA: 0x00018648 File Offset: 0x00016848
|
||||
private static bool ComputeDirectionalShadowMatricesAndCullingPrimitives(IntPtr cullResults, int activeLightIndex, int splitIndex, int splitCount, Vector3 splitRatio, int shadowResolution, float shadowNearPlaneOffset, out Matrix4x4 viewMatrix, out Matrix4x4 projMatrix, out ShadowSplitData shadowSplitData)
|
||||
{
|
||||
return CullResults.INTERNAL_CALL_ComputeDirectionalShadowMatricesAndCullingPrimitives(cullResults, activeLightIndex, splitIndex, splitCount, ref splitRatio, shadowResolution, shadowNearPlaneOffset, out viewMatrix, out projMatrix, out shadowSplitData);
|
||||
}
|
||||
|
||||
// Token: 0x06001267 RID: 4711
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern bool INTERNAL_CALL_ComputeDirectionalShadowMatricesAndCullingPrimitives(IntPtr cullResults, int activeLightIndex, int splitIndex, int splitCount, ref Vector3 splitRatio, int shadowResolution, float shadowNearPlaneOffset, out Matrix4x4 viewMatrix, out Matrix4x4 projMatrix, out ShadowSplitData shadowSplitData);
|
||||
|
||||
// Token: 0x04000262 RID: 610
|
||||
public VisibleLight[] visibleLights;
|
||||
|
||||
// Token: 0x04000263 RID: 611
|
||||
public VisibleLight[] visibleOffscreenVertexLights;
|
||||
|
||||
// Token: 0x04000264 RID: 612
|
||||
public VisibleReflectionProbe[] visibleReflectionProbes;
|
||||
|
||||
// Token: 0x04000265 RID: 613
|
||||
internal IntPtr cullResults;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020004D5 RID: 1237
|
||||
[UsedByNativeCode]
|
||||
public struct CullingParameters
|
||||
{
|
||||
// Token: 0x06003BF5 RID: 15349 RVA: 0x0006979C File Offset: 0x0006799C
|
||||
public unsafe float GetLayerCullDistance(int layerIndex)
|
||||
{
|
||||
if (layerIndex < 0 || layerIndex >= 32)
|
||||
{
|
||||
throw new IndexOutOfRangeException("Invalid layer index");
|
||||
}
|
||||
fixed (float* ptr = &this._layerFarCullDistances.FixedElementField)
|
||||
{
|
||||
return ptr[(IntPtr)layerIndex * 4];
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003BF6 RID: 15350 RVA: 0x000697E0 File Offset: 0x000679E0
|
||||
public unsafe void SetLayerCullDistance(int layerIndex, float distance)
|
||||
{
|
||||
if (layerIndex < 0 || layerIndex >= 32)
|
||||
{
|
||||
throw new IndexOutOfRangeException("Invalid layer index");
|
||||
}
|
||||
fixed (float* ptr = &this._layerFarCullDistances.FixedElementField)
|
||||
{
|
||||
ptr[(IntPtr)layerIndex * 4] = distance;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003BF7 RID: 15351 RVA: 0x00069824 File Offset: 0x00067A24
|
||||
public unsafe Plane GetCullingPlane(int index)
|
||||
{
|
||||
if (index < 0 || index >= this.cullingPlaneCount || index >= 10)
|
||||
{
|
||||
throw new IndexOutOfRangeException("Invalid plane index");
|
||||
}
|
||||
fixed (float* ptr = &this._cullingPlanes.FixedElementField)
|
||||
{
|
||||
return new Plane(new Vector3(ptr[(IntPtr)(index * 4) * 4], ptr[(IntPtr)(index * 4 + 1) * 4], ptr[(IntPtr)(index * 4 + 2) * 4]), ptr[(IntPtr)(index * 4 + 3) * 4]);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003BF8 RID: 15352 RVA: 0x000698A0 File Offset: 0x00067AA0
|
||||
public unsafe void SetCullingPlane(int index, Plane plane)
|
||||
{
|
||||
if (index < 0 || index >= this.cullingPlaneCount || index >= 10)
|
||||
{
|
||||
throw new IndexOutOfRangeException("Invalid plane index");
|
||||
}
|
||||
fixed (float* ptr = &this._cullingPlanes.FixedElementField)
|
||||
{
|
||||
ptr[(IntPtr)(index * 4) * 4] = plane.normal.x;
|
||||
ptr[(IntPtr)(index * 4 + 1) * 4] = plane.normal.y;
|
||||
ptr[(IntPtr)(index * 4 + 2) * 4] = plane.normal.z;
|
||||
ptr[(IntPtr)(index * 4 + 3) * 4] = plane.distance;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04001207 RID: 4615
|
||||
public int isOrthographic;
|
||||
|
||||
// Token: 0x04001208 RID: 4616
|
||||
public LODParameters lodParameters;
|
||||
|
||||
// Token: 0x04001209 RID: 4617
|
||||
private CullingParameters.<_cullingPlanes>__FixedBuffer0 _cullingPlanes;
|
||||
|
||||
// Token: 0x0400120A RID: 4618
|
||||
public int cullingPlaneCount;
|
||||
|
||||
// Token: 0x0400120B RID: 4619
|
||||
public int cullingMask;
|
||||
|
||||
// Token: 0x0400120C RID: 4620
|
||||
private long sceneMask;
|
||||
|
||||
// Token: 0x0400120D RID: 4621
|
||||
private CullingParameters.<_layerFarCullDistances>__FixedBuffer1 _layerFarCullDistances;
|
||||
|
||||
// Token: 0x0400120E RID: 4622
|
||||
private int layerCull;
|
||||
|
||||
// Token: 0x0400120F RID: 4623
|
||||
public Matrix4x4 cullingMatrix;
|
||||
|
||||
// Token: 0x04001210 RID: 4624
|
||||
public Vector3 position;
|
||||
|
||||
// Token: 0x04001211 RID: 4625
|
||||
public float shadowDistance;
|
||||
|
||||
// Token: 0x04001212 RID: 4626
|
||||
private int _cullingFlags;
|
||||
|
||||
// Token: 0x04001213 RID: 4627
|
||||
private int _cameraInstanceID;
|
||||
|
||||
// Token: 0x04001214 RID: 4628
|
||||
public ReflectionProbeSortOptions reflectionProbeSortOptions;
|
||||
|
||||
// Token: 0x020004D6 RID: 1238
|
||||
[UnsafeValueType]
|
||||
[CompilerGenerated]
|
||||
[StructLayout(LayoutKind.Sequential, Size = 160)]
|
||||
public struct <_cullingPlanes>__FixedBuffer0
|
||||
{
|
||||
// Token: 0x04001215 RID: 4629
|
||||
public float FixedElementField;
|
||||
}
|
||||
|
||||
// Token: 0x020004D7 RID: 1239
|
||||
[UnsafeValueType]
|
||||
[CompilerGenerated]
|
||||
[StructLayout(LayoutKind.Sequential, Size = 128)]
|
||||
public struct <_layerFarCullDistances>__FixedBuffer1
|
||||
{
|
||||
// Token: 0x04001216 RID: 4630
|
||||
public float FixedElementField;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020004D8 RID: 1240
|
||||
[Flags]
|
||||
public enum DrawRendererFlags
|
||||
{
|
||||
// Token: 0x04001218 RID: 4632
|
||||
None = 0,
|
||||
// Token: 0x04001219 RID: 4633
|
||||
EnableDynamicBatching = 1,
|
||||
// Token: 0x0400121A RID: 4634
|
||||
EnableInstancing = 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020000FF RID: 255
|
||||
public struct DrawRendererSettings
|
||||
{
|
||||
// Token: 0x0600123A RID: 4666 RVA: 0x00018360 File Offset: 0x00016560
|
||||
public DrawRendererSettings(CullResults cullResults, Camera camera, ShaderPassName shaderPassName)
|
||||
{
|
||||
this._cullResults = cullResults.cullResults;
|
||||
this.shaderPassName = shaderPassName;
|
||||
this.rendererConfiguration = RendererConfiguration.None;
|
||||
this.flags = DrawRendererFlags.EnableInstancing;
|
||||
this.inputFilter = InputFilter.Default();
|
||||
DrawRendererSettings.InitializeSortSettings(camera, out this.sorting);
|
||||
}
|
||||
|
||||
// Token: 0x17000394 RID: 916
|
||||
// (set) Token: 0x0600123B RID: 4667 RVA: 0x0001839C File Offset: 0x0001659C
|
||||
public CullResults cullResults
|
||||
{
|
||||
set
|
||||
{
|
||||
this._cullResults = value.cullResults;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600123C RID: 4668
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern void InitializeSortSettings(Camera camera, out DrawRendererSortSettings sortSettings);
|
||||
|
||||
// Token: 0x0400024A RID: 586
|
||||
public DrawRendererSortSettings sorting;
|
||||
|
||||
// Token: 0x0400024B RID: 587
|
||||
public ShaderPassName shaderPassName;
|
||||
|
||||
// Token: 0x0400024C RID: 588
|
||||
public InputFilter inputFilter;
|
||||
|
||||
// Token: 0x0400024D RID: 589
|
||||
public RendererConfiguration rendererConfiguration;
|
||||
|
||||
// Token: 0x0400024E RID: 590
|
||||
public DrawRendererFlags flags;
|
||||
|
||||
// Token: 0x0400024F RID: 591
|
||||
private IntPtr _cullResults;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020004D9 RID: 1241
|
||||
public struct DrawRendererSortSettings
|
||||
{
|
||||
// Token: 0x17000D8D RID: 3469
|
||||
// (get) Token: 0x06003BF9 RID: 15353 RVA: 0x00069944 File Offset: 0x00067B44
|
||||
// (set) Token: 0x06003BFA RID: 15354 RVA: 0x00069968 File Offset: 0x00067B68
|
||||
public bool sortOrthographic
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._sortOrthographic != 0;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._sortOrthographic = ((!value) ? 0 : 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400121B RID: 4635
|
||||
public Matrix4x4 worldToCameraMatrix;
|
||||
|
||||
// Token: 0x0400121C RID: 4636
|
||||
public Vector3 cameraPosition;
|
||||
|
||||
// Token: 0x0400121D RID: 4637
|
||||
public SortFlags flags;
|
||||
|
||||
// Token: 0x0400121E RID: 4638
|
||||
private int _sortOrthographic;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020004DA RID: 1242
|
||||
[UsedByNativeCode]
|
||||
public struct DrawShadowsSettings
|
||||
{
|
||||
// Token: 0x06003BFB RID: 15355 RVA: 0x00069980 File Offset: 0x00067B80
|
||||
public DrawShadowsSettings(CullResults cullResults, int lightIndex)
|
||||
{
|
||||
this._cullResults = cullResults.cullResults;
|
||||
this.lightIndex = lightIndex;
|
||||
this.splitData.cullingPlaneCount = 0;
|
||||
this.splitData.cullingSphere = Vector4.zero;
|
||||
}
|
||||
|
||||
// Token: 0x17000D8E RID: 3470
|
||||
// (set) Token: 0x06003BFC RID: 15356 RVA: 0x000699B4 File Offset: 0x00067BB4
|
||||
public CullResults cullResults
|
||||
{
|
||||
set
|
||||
{
|
||||
this._cullResults = value.cullResults;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400121F RID: 4639
|
||||
private IntPtr _cullResults;
|
||||
|
||||
// Token: 0x04001220 RID: 4640
|
||||
public int lightIndex;
|
||||
|
||||
// Token: 0x04001221 RID: 4641
|
||||
public ShadowSplitData splitData;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020004DC RID: 1244
|
||||
public interface IRenderPipeline : IDisposable
|
||||
{
|
||||
// Token: 0x17000D8F RID: 3471
|
||||
// (get) Token: 0x06003C00 RID: 15360
|
||||
bool disposed { get; }
|
||||
|
||||
// Token: 0x06003C01 RID: 15361
|
||||
void Render(ScriptableRenderContext renderContext, Camera[] cameras);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020004DD RID: 1245
|
||||
public interface IRenderPipelineAsset
|
||||
{
|
||||
// Token: 0x06003C02 RID: 15362
|
||||
void DestroyCreatedInstances();
|
||||
|
||||
// Token: 0x06003C03 RID: 15363
|
||||
IRenderPipeline CreatePipeline();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020004DB RID: 1243
|
||||
public struct InputFilter
|
||||
{
|
||||
// Token: 0x06003BFD RID: 15357 RVA: 0x000699C4 File Offset: 0x00067BC4
|
||||
public static InputFilter Default()
|
||||
{
|
||||
return new InputFilter
|
||||
{
|
||||
renderQueueMin = 0,
|
||||
renderQueueMax = 5000,
|
||||
layerMask = -1
|
||||
};
|
||||
}
|
||||
|
||||
// Token: 0x06003BFE RID: 15358 RVA: 0x00069A00 File Offset: 0x00067C00
|
||||
public void SetQueuesOpaque()
|
||||
{
|
||||
this.renderQueueMin = 0;
|
||||
this.renderQueueMax = 2500;
|
||||
}
|
||||
|
||||
// Token: 0x06003BFF RID: 15359 RVA: 0x00069A18 File Offset: 0x00067C18
|
||||
public void SetQueuesTransparent()
|
||||
{
|
||||
this.renderQueueMin = 2501;
|
||||
this.renderQueueMax = 5000;
|
||||
}
|
||||
|
||||
// Token: 0x04001222 RID: 4642
|
||||
public int renderQueueMin;
|
||||
|
||||
// Token: 0x04001223 RID: 4643
|
||||
public int renderQueueMax;
|
||||
|
||||
// Token: 0x04001224 RID: 4644
|
||||
public int layerMask;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020004DE RID: 1246
|
||||
public struct LODParameters
|
||||
{
|
||||
// Token: 0x04001225 RID: 4645
|
||||
public bool isOrthographic;
|
||||
|
||||
// Token: 0x04001226 RID: 4646
|
||||
public Vector3 cameraPosition;
|
||||
|
||||
// Token: 0x04001227 RID: 4647
|
||||
public float fieldOfView;
|
||||
|
||||
// Token: 0x04001228 RID: 4648
|
||||
public float orthoSize;
|
||||
|
||||
// Token: 0x04001229 RID: 4649
|
||||
public int cameraPixelHeight;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020004DF RID: 1247
|
||||
public enum ReflectionProbeSortOptions
|
||||
{
|
||||
// Token: 0x0400122B RID: 4651
|
||||
None,
|
||||
// Token: 0x0400122C RID: 4652
|
||||
Importance,
|
||||
// Token: 0x0400122D RID: 4653
|
||||
Size,
|
||||
// Token: 0x0400122E RID: 4654
|
||||
ImportanceThenSize
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020004E1 RID: 1249
|
||||
public abstract class RenderPipelineAsset : ScriptableObject, IRenderPipelineAsset
|
||||
{
|
||||
// Token: 0x06003C05 RID: 15365 RVA: 0x00069A48 File Offset: 0x00067C48
|
||||
public void DestroyCreatedInstances()
|
||||
{
|
||||
foreach (IRenderPipeline renderPipeline in this.m_CreatedPipelines)
|
||||
{
|
||||
renderPipeline.Dispose();
|
||||
}
|
||||
this.m_CreatedPipelines.Clear();
|
||||
}
|
||||
|
||||
// Token: 0x06003C06 RID: 15366 RVA: 0x00069AB0 File Offset: 0x00067CB0
|
||||
public IRenderPipeline CreatePipeline()
|
||||
{
|
||||
IRenderPipeline renderPipeline = this.InternalCreatePipeline();
|
||||
if (renderPipeline != null)
|
||||
{
|
||||
this.m_CreatedPipelines.Add(renderPipeline);
|
||||
}
|
||||
return renderPipeline;
|
||||
}
|
||||
|
||||
// Token: 0x06003C07 RID: 15367
|
||||
protected abstract IRenderPipeline InternalCreatePipeline();
|
||||
|
||||
// Token: 0x06003C08 RID: 15368 RVA: 0x00069AE0 File Offset: 0x00067CE0
|
||||
protected IEnumerable<IRenderPipeline> CreatedInstances()
|
||||
{
|
||||
return this.m_CreatedPipelines;
|
||||
}
|
||||
|
||||
// Token: 0x06003C09 RID: 15369 RVA: 0x00069AFC File Offset: 0x00067CFC
|
||||
private void OnValidate()
|
||||
{
|
||||
this.DestroyCreatedInstances();
|
||||
}
|
||||
|
||||
// Token: 0x06003C0A RID: 15370 RVA: 0x00069B08 File Offset: 0x00067D08
|
||||
private void OnDisable()
|
||||
{
|
||||
this.DestroyCreatedInstances();
|
||||
}
|
||||
|
||||
// Token: 0x04001236 RID: 4662
|
||||
private readonly List<IRenderPipeline> m_CreatedPipelines = new List<IRenderPipeline>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020004E2 RID: 1250
|
||||
public static class RenderPipelineManager
|
||||
{
|
||||
// Token: 0x17000D90 RID: 3472
|
||||
// (get) Token: 0x06003C0B RID: 15371 RVA: 0x00069B14 File Offset: 0x00067D14
|
||||
// (set) Token: 0x06003C0C RID: 15372 RVA: 0x00069B30 File Offset: 0x00067D30
|
||||
public static IRenderPipeline currentPipeline { get; private set; }
|
||||
|
||||
// Token: 0x06003C0D RID: 15373 RVA: 0x00069B38 File Offset: 0x00067D38
|
||||
[RequiredByNativeCode]
|
||||
internal static void CleanupRenderPipeline()
|
||||
{
|
||||
if (RenderPipelineManager.s_CurrentPipelineAsset != null)
|
||||
{
|
||||
RenderPipelineManager.s_CurrentPipelineAsset.DestroyCreatedInstances();
|
||||
}
|
||||
RenderPipelineManager.s_CurrentPipelineAsset = null;
|
||||
RenderPipelineManager.currentPipeline = null;
|
||||
}
|
||||
|
||||
// Token: 0x06003C0E RID: 15374 RVA: 0x00069B5C File Offset: 0x00067D5C
|
||||
[RequiredByNativeCode]
|
||||
private static void DoRenderLoop_Internal(IRenderPipelineAsset pipe, Camera[] cameras, IntPtr loopPtr)
|
||||
{
|
||||
RenderPipelineManager.PrepareRenderPipeline(pipe);
|
||||
if (RenderPipelineManager.currentPipeline != null)
|
||||
{
|
||||
ScriptableRenderContext scriptableRenderContext = new ScriptableRenderContext(loopPtr);
|
||||
RenderPipelineManager.currentPipeline.Render(scriptableRenderContext, cameras);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003C0F RID: 15375 RVA: 0x00069B94 File Offset: 0x00067D94
|
||||
private static void PrepareRenderPipeline(IRenderPipelineAsset pipe)
|
||||
{
|
||||
if (RenderPipelineManager.s_CurrentPipelineAsset != pipe)
|
||||
{
|
||||
if (RenderPipelineManager.s_CurrentPipelineAsset != null)
|
||||
{
|
||||
RenderPipelineManager.CleanupRenderPipeline();
|
||||
}
|
||||
RenderPipelineManager.s_CurrentPipelineAsset = pipe;
|
||||
}
|
||||
if (RenderPipelineManager.s_CurrentPipelineAsset != null && (RenderPipelineManager.currentPipeline == null || RenderPipelineManager.currentPipeline.disposed))
|
||||
{
|
||||
RenderPipelineManager.currentPipeline = RenderPipelineManager.s_CurrentPipelineAsset.CreatePipeline();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04001237 RID: 4663
|
||||
private static IRenderPipelineAsset s_CurrentPipelineAsset;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020004E0 RID: 1248
|
||||
[Flags]
|
||||
public enum RendererConfiguration
|
||||
{
|
||||
// Token: 0x04001230 RID: 4656
|
||||
None = 0,
|
||||
// Token: 0x04001231 RID: 4657
|
||||
PerObjectLightProbe = 1,
|
||||
// Token: 0x04001232 RID: 4658
|
||||
PerObjectReflectionProbes = 2,
|
||||
// Token: 0x04001233 RID: 4659
|
||||
PerObjectLightProbeProxyVolume = 4,
|
||||
// Token: 0x04001234 RID: 4660
|
||||
PerObjectLightmaps = 8,
|
||||
// Token: 0x04001235 RID: 4661
|
||||
ProvideLightIndices = 16
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x02000100 RID: 256
|
||||
public struct ScriptableRenderContext
|
||||
{
|
||||
// Token: 0x0600123D RID: 4669 RVA: 0x000183AC File Offset: 0x000165AC
|
||||
internal ScriptableRenderContext(IntPtr ptr)
|
||||
{
|
||||
this.m_Ptr = ptr;
|
||||
}
|
||||
|
||||
// Token: 0x0600123E RID: 4670 RVA: 0x000183B8 File Offset: 0x000165B8
|
||||
public void Submit()
|
||||
{
|
||||
this.CheckValid();
|
||||
this.Submit_Internal();
|
||||
}
|
||||
|
||||
// Token: 0x0600123F RID: 4671 RVA: 0x000183C8 File Offset: 0x000165C8
|
||||
public void DrawRenderers(ref DrawRendererSettings settings)
|
||||
{
|
||||
this.CheckValid();
|
||||
this.DrawRenderers_Internal(ref settings);
|
||||
}
|
||||
|
||||
// Token: 0x06001240 RID: 4672 RVA: 0x000183D8 File Offset: 0x000165D8
|
||||
public void DrawShadows(ref DrawShadowsSettings settings)
|
||||
{
|
||||
this.CheckValid();
|
||||
this.DrawShadows_Internal(ref settings);
|
||||
}
|
||||
|
||||
// Token: 0x06001241 RID: 4673 RVA: 0x000183E8 File Offset: 0x000165E8
|
||||
public void ExecuteCommandBuffer(CommandBuffer commandBuffer)
|
||||
{
|
||||
this.CheckValid();
|
||||
this.ExecuteCommandBuffer_Internal(commandBuffer);
|
||||
}
|
||||
|
||||
// Token: 0x06001242 RID: 4674 RVA: 0x000183F8 File Offset: 0x000165F8
|
||||
public void SetupCameraProperties(Camera camera)
|
||||
{
|
||||
this.CheckValid();
|
||||
this.SetupCameraProperties_Internal(camera);
|
||||
}
|
||||
|
||||
// Token: 0x06001243 RID: 4675 RVA: 0x00018408 File Offset: 0x00016608
|
||||
public void DrawSkybox(Camera camera)
|
||||
{
|
||||
this.CheckValid();
|
||||
this.DrawSkybox_Internal(camera);
|
||||
}
|
||||
|
||||
// Token: 0x06001244 RID: 4676
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern void Submit_Internal();
|
||||
|
||||
// Token: 0x06001245 RID: 4677
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern void DrawRenderers_Internal(ref DrawRendererSettings settings);
|
||||
|
||||
// Token: 0x06001246 RID: 4678
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern void DrawShadows_Internal(ref DrawShadowsSettings settings);
|
||||
|
||||
// Token: 0x06001247 RID: 4679
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern void ExecuteCommandBuffer_Internal(CommandBuffer commandBuffer);
|
||||
|
||||
// Token: 0x06001248 RID: 4680
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern void SetupCameraProperties_Internal(Camera camera);
|
||||
|
||||
// Token: 0x06001249 RID: 4681
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern void DrawSkybox_Internal(Camera camera);
|
||||
|
||||
// Token: 0x0600124A RID: 4682 RVA: 0x00018418 File Offset: 0x00016618
|
||||
internal void CheckValid()
|
||||
{
|
||||
if (this.m_Ptr.ToInt64() == 0L)
|
||||
{
|
||||
throw new ArgumentException("Invalid ScriptableRenderContext. This can be caused by allocating a context in user code.");
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000250 RID: 592
|
||||
private IntPtr m_Ptr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020000FE RID: 254
|
||||
public struct ShaderPassName
|
||||
{
|
||||
// Token: 0x06001238 RID: 4664 RVA: 0x00018350 File Offset: 0x00016550
|
||||
public ShaderPassName(string name)
|
||||
{
|
||||
this.nameIndex = ShaderPassName.Init(name);
|
||||
}
|
||||
|
||||
// Token: 0x06001239 RID: 4665
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern int Init(string name);
|
||||
|
||||
// Token: 0x04000249 RID: 585
|
||||
private int nameIndex;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020004E3 RID: 1251
|
||||
[UsedByNativeCode]
|
||||
public struct ShadowSplitData
|
||||
{
|
||||
// Token: 0x06003C10 RID: 15376 RVA: 0x00069BF8 File Offset: 0x00067DF8
|
||||
public unsafe Plane GetCullingPlane(int index)
|
||||
{
|
||||
if (index < 0 || index >= this.cullingPlaneCount || index >= 10)
|
||||
{
|
||||
throw new IndexOutOfRangeException("Invalid plane index");
|
||||
}
|
||||
fixed (float* ptr = &this._cullingPlanes.FixedElementField)
|
||||
{
|
||||
return new Plane(new Vector3(ptr[(IntPtr)(index * 4) * 4], ptr[(IntPtr)(index * 4 + 1) * 4], ptr[(IntPtr)(index * 4 + 2) * 4]), ptr[(IntPtr)(index * 4 + 3) * 4]);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003C11 RID: 15377 RVA: 0x00069C74 File Offset: 0x00067E74
|
||||
public unsafe void SetCullingPlane(int index, Plane plane)
|
||||
{
|
||||
if (index < 0 || index >= this.cullingPlaneCount || index >= 10)
|
||||
{
|
||||
throw new IndexOutOfRangeException("Invalid plane index");
|
||||
}
|
||||
fixed (float* ptr = &this._cullingPlanes.FixedElementField)
|
||||
{
|
||||
ptr[(IntPtr)(index * 4) * 4] = plane.normal.x;
|
||||
ptr[(IntPtr)(index * 4 + 1) * 4] = plane.normal.y;
|
||||
ptr[(IntPtr)(index * 4 + 2) * 4] = plane.normal.z;
|
||||
ptr[(IntPtr)(index * 4 + 3) * 4] = plane.distance;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04001239 RID: 4665
|
||||
public int cullingPlaneCount;
|
||||
|
||||
// Token: 0x0400123A RID: 4666
|
||||
private ShadowSplitData.<_cullingPlanes>__FixedBuffer2 _cullingPlanes;
|
||||
|
||||
// Token: 0x0400123B RID: 4667
|
||||
public Vector4 cullingSphere;
|
||||
|
||||
// Token: 0x020004E4 RID: 1252
|
||||
[UnsafeValueType]
|
||||
[CompilerGenerated]
|
||||
[StructLayout(LayoutKind.Sequential, Size = 160)]
|
||||
public struct <_cullingPlanes>__FixedBuffer2
|
||||
{
|
||||
// Token: 0x0400123C RID: 4668
|
||||
public float FixedElementField;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020004E5 RID: 1253
|
||||
[Flags]
|
||||
public enum SortFlags
|
||||
{
|
||||
// Token: 0x0400123E RID: 4670
|
||||
None = 0,
|
||||
// Token: 0x0400123F RID: 4671
|
||||
SortingLayer = 1,
|
||||
// Token: 0x04001240 RID: 4672
|
||||
RenderQueue = 2,
|
||||
// Token: 0x04001241 RID: 4673
|
||||
BackToFront = 4,
|
||||
// Token: 0x04001242 RID: 4674
|
||||
QuantizedFrontToBack = 8,
|
||||
// Token: 0x04001243 RID: 4675
|
||||
OptimizeStateChanges = 16,
|
||||
// Token: 0x04001244 RID: 4676
|
||||
CanvasOrder = 32,
|
||||
// Token: 0x04001245 RID: 4677
|
||||
CommonOpaque = 59,
|
||||
// Token: 0x04001246 RID: 4678
|
||||
CommonTransparent = 23
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x02000101 RID: 257
|
||||
[UsedByNativeCode]
|
||||
public struct VisibleLight
|
||||
{
|
||||
// Token: 0x17000395 RID: 917
|
||||
// (get) Token: 0x0600124B RID: 4683 RVA: 0x00018438 File Offset: 0x00016638
|
||||
public Light light
|
||||
{
|
||||
get
|
||||
{
|
||||
return VisibleLight.GetLightObject(this.instanceId);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600124C RID: 4684
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern Light GetLightObject(int instanceId);
|
||||
|
||||
// Token: 0x04000251 RID: 593
|
||||
public LightType lightType;
|
||||
|
||||
// Token: 0x04000252 RID: 594
|
||||
public Color finalColor;
|
||||
|
||||
// Token: 0x04000253 RID: 595
|
||||
public Rect screenRect;
|
||||
|
||||
// Token: 0x04000254 RID: 596
|
||||
public Matrix4x4 localToWorld;
|
||||
|
||||
// Token: 0x04000255 RID: 597
|
||||
public float range;
|
||||
|
||||
// Token: 0x04000256 RID: 598
|
||||
public float spotAngle;
|
||||
|
||||
// Token: 0x04000257 RID: 599
|
||||
private int instanceId;
|
||||
|
||||
// Token: 0x04000258 RID: 600
|
||||
public VisibleLightFlags flags;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x020004E6 RID: 1254
|
||||
[Flags]
|
||||
public enum VisibleLightFlags
|
||||
{
|
||||
// Token: 0x04001248 RID: 4680
|
||||
None = 0,
|
||||
// Token: 0x04001249 RID: 4681
|
||||
IntersectsNearPlane = 1,
|
||||
// Token: 0x0400124A RID: 4682
|
||||
IntersectsFarPlane = 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace UnityEngine.Experimental.Rendering
|
||||
{
|
||||
// Token: 0x02000102 RID: 258
|
||||
[UsedByNativeCode]
|
||||
public struct VisibleReflectionProbe
|
||||
{
|
||||
// Token: 0x17000396 RID: 918
|
||||
// (get) Token: 0x0600124D RID: 4685 RVA: 0x00018458 File Offset: 0x00016658
|
||||
public Texture texture
|
||||
{
|
||||
get
|
||||
{
|
||||
return VisibleReflectionProbe.GetTextureObject(this.textureId);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600124E RID: 4686
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern Texture GetTextureObject(int textureId);
|
||||
|
||||
// Token: 0x17000397 RID: 919
|
||||
// (get) Token: 0x0600124F RID: 4687 RVA: 0x00018478 File Offset: 0x00016678
|
||||
public ReflectionProbe probe
|
||||
{
|
||||
get
|
||||
{
|
||||
return VisibleReflectionProbe.GetReflectionProbeObject(this.instanceId);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001250 RID: 4688
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern ReflectionProbe GetReflectionProbeObject(int instanceId);
|
||||
|
||||
// Token: 0x04000259 RID: 601
|
||||
public Bounds bounds;
|
||||
|
||||
// Token: 0x0400025A RID: 602
|
||||
public Matrix4x4 localToWorld;
|
||||
|
||||
// Token: 0x0400025B RID: 603
|
||||
public Vector4 hdr;
|
||||
|
||||
// Token: 0x0400025C RID: 604
|
||||
public Vector3 center;
|
||||
|
||||
// Token: 0x0400025D RID: 605
|
||||
public float blendDistance;
|
||||
|
||||
// Token: 0x0400025E RID: 606
|
||||
public int importance;
|
||||
|
||||
// Token: 0x0400025F RID: 607
|
||||
public int boxProjection;
|
||||
|
||||
// Token: 0x04000260 RID: 608
|
||||
private int instanceId;
|
||||
|
||||
// Token: 0x04000261 RID: 609
|
||||
private int textureId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000336 RID: 822
|
||||
internal abstract class BaseVisualElementPanel : IPanel
|
||||
{
|
||||
// Token: 0x17000B99 RID: 2969
|
||||
// (get) Token: 0x06003332 RID: 13106 RVA: 0x0004FA1C File Offset: 0x0004DC1C
|
||||
// (set) Token: 0x06003333 RID: 13107 RVA: 0x0004FA38 File Offset: 0x0004DC38
|
||||
public virtual VisualElement focusedElement { get; set; }
|
||||
|
||||
// Token: 0x17000B9A RID: 2970
|
||||
// (get) Token: 0x06003334 RID: 13108
|
||||
// (set) Token: 0x06003335 RID: 13109
|
||||
public abstract EventInterests IMGUIEventInterests { get; set; }
|
||||
|
||||
// Token: 0x17000B9B RID: 2971
|
||||
// (get) Token: 0x06003336 RID: 13110
|
||||
// (set) Token: 0x06003337 RID: 13111
|
||||
public abstract int instanceID { get; protected set; }
|
||||
|
||||
// Token: 0x17000B9C RID: 2972
|
||||
// (get) Token: 0x06003338 RID: 13112
|
||||
// (set) Token: 0x06003339 RID: 13113
|
||||
public abstract LoadResourceFunction loadResourceFunc { get; protected set; }
|
||||
|
||||
// Token: 0x17000B9D RID: 2973
|
||||
// (get) Token: 0x0600333A RID: 13114
|
||||
// (set) Token: 0x0600333B RID: 13115
|
||||
public abstract int IMGUIContainersCount { get; set; }
|
||||
|
||||
// Token: 0x0600333C RID: 13116
|
||||
public abstract void Repaint(Event e);
|
||||
|
||||
// Token: 0x0600333D RID: 13117
|
||||
public abstract void ValidateLayout();
|
||||
|
||||
// Token: 0x17000B9E RID: 2974
|
||||
// (get) Token: 0x0600333E RID: 13118 RVA: 0x0004FA44 File Offset: 0x0004DC44
|
||||
// (set) Token: 0x0600333F RID: 13119 RVA: 0x0004FA60 File Offset: 0x0004DC60
|
||||
internal virtual IStylePainter stylePainter { get; set; }
|
||||
|
||||
// Token: 0x17000B9F RID: 2975
|
||||
// (get) Token: 0x06003340 RID: 13120
|
||||
public abstract VisualContainer visualTree { get; }
|
||||
|
||||
// Token: 0x17000BA0 RID: 2976
|
||||
// (get) Token: 0x06003341 RID: 13121
|
||||
// (set) Token: 0x06003342 RID: 13122
|
||||
public abstract IDispatcher dispatcher { get; protected set; }
|
||||
|
||||
// Token: 0x17000BA1 RID: 2977
|
||||
// (get) Token: 0x06003343 RID: 13123
|
||||
public abstract IScheduler scheduler { get; }
|
||||
|
||||
// Token: 0x17000BA2 RID: 2978
|
||||
// (get) Token: 0x06003344 RID: 13124
|
||||
// (set) Token: 0x06003345 RID: 13125
|
||||
public abstract IDataWatchService dataWatch { get; protected set; }
|
||||
|
||||
// Token: 0x17000BA3 RID: 2979
|
||||
// (get) Token: 0x06003346 RID: 13126
|
||||
// (set) Token: 0x06003347 RID: 13127
|
||||
public abstract ContextType contextType { get; protected set; }
|
||||
|
||||
// Token: 0x06003348 RID: 13128
|
||||
public abstract VisualElement Pick(Vector2 point);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200030B RID: 779
|
||||
public class Button : VisualElement
|
||||
{
|
||||
// Token: 0x060031F3 RID: 12787 RVA: 0x0004A154 File Offset: 0x00048354
|
||||
public Button(Action clickEvent)
|
||||
{
|
||||
this.clickable = new Clickable(clickEvent);
|
||||
base.AddManipulator(this.clickable);
|
||||
}
|
||||
|
||||
// Token: 0x04000A09 RID: 2569
|
||||
private Clickable clickable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000334 RID: 820
|
||||
[Flags]
|
||||
public enum ChangeType
|
||||
{
|
||||
// Token: 0x04000A7F RID: 2687
|
||||
Layout = 16,
|
||||
// Token: 0x04000A80 RID: 2688
|
||||
Styles = 8,
|
||||
// Token: 0x04000A81 RID: 2689
|
||||
Transform = 4,
|
||||
// Token: 0x04000A82 RID: 2690
|
||||
StylesPath = 2,
|
||||
// Token: 0x04000A83 RID: 2691
|
||||
Repaint = 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200030C RID: 780
|
||||
internal class ClampedDragger : Clickable
|
||||
{
|
||||
// Token: 0x060031F4 RID: 12788 RVA: 0x0004A178 File Offset: 0x00048378
|
||||
public ClampedDragger(Slider slider, Action clickHandler, Action dragHandler)
|
||||
: base(clickHandler, 250L, 30L)
|
||||
{
|
||||
this.dragDirection = ClampedDragger.DragDirection.None;
|
||||
this.slider = slider;
|
||||
this.dragging += dragHandler;
|
||||
}
|
||||
|
||||
// Token: 0x14000025 RID: 37
|
||||
// (add) Token: 0x060031F5 RID: 12789 RVA: 0x0004A1A0 File Offset: 0x000483A0
|
||||
// (remove) Token: 0x060031F6 RID: 12790 RVA: 0x0004A1D8 File Offset: 0x000483D8
|
||||
[field: DebuggerBrowsable(DebuggerBrowsableState.Never)]
|
||||
public event Action dragging;
|
||||
|
||||
// Token: 0x17000B52 RID: 2898
|
||||
// (get) Token: 0x060031F7 RID: 12791 RVA: 0x0004A210 File Offset: 0x00048410
|
||||
// (set) Token: 0x060031F8 RID: 12792 RVA: 0x0004A22C File Offset: 0x0004842C
|
||||
public ClampedDragger.DragDirection dragDirection { get; set; }
|
||||
|
||||
// Token: 0x17000B53 RID: 2899
|
||||
// (get) Token: 0x060031F9 RID: 12793 RVA: 0x0004A238 File Offset: 0x00048438
|
||||
// (set) Token: 0x060031FA RID: 12794 RVA: 0x0004A254 File Offset: 0x00048454
|
||||
private Slider slider { get; set; }
|
||||
|
||||
// Token: 0x17000B54 RID: 2900
|
||||
// (get) Token: 0x060031FB RID: 12795 RVA: 0x0004A260 File Offset: 0x00048460
|
||||
// (set) Token: 0x060031FC RID: 12796 RVA: 0x0004A27C File Offset: 0x0004847C
|
||||
public Vector2 startMousePosition { get; private set; }
|
||||
|
||||
// Token: 0x17000B55 RID: 2901
|
||||
// (get) Token: 0x060031FD RID: 12797 RVA: 0x0004A288 File Offset: 0x00048488
|
||||
public Vector2 delta
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.lastMousePosition - this.startMousePosition;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060031FE RID: 12798 RVA: 0x0004A2B0 File Offset: 0x000484B0
|
||||
public override EventPropagation HandleEvent(Event evt, VisualElement finalTarget)
|
||||
{
|
||||
EventType type = evt.type;
|
||||
if (type != EventType.MouseDown)
|
||||
{
|
||||
if (type != EventType.MouseDrag)
|
||||
{
|
||||
if (type == EventType.MouseUp)
|
||||
{
|
||||
if (base.CanStopManipulation(evt))
|
||||
{
|
||||
return base.HandleEvent(evt, finalTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (this.HasCapture())
|
||||
{
|
||||
base.HandleEvent(evt, finalTarget);
|
||||
if (this.dragDirection == ClampedDragger.DragDirection.None)
|
||||
{
|
||||
this.dragDirection = ClampedDragger.DragDirection.Free;
|
||||
}
|
||||
if (this.dragDirection == ClampedDragger.DragDirection.Free)
|
||||
{
|
||||
if (this.dragging != null)
|
||||
{
|
||||
this.dragging();
|
||||
}
|
||||
}
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
else if (base.CanStartManipulation(evt))
|
||||
{
|
||||
this.startMousePosition = evt.mousePosition;
|
||||
this.dragDirection = ClampedDragger.DragDirection.None;
|
||||
base.HandleEvent(evt, finalTarget);
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
return EventPropagation.Continue;
|
||||
}
|
||||
|
||||
// Token: 0x0200030D RID: 781
|
||||
[Flags]
|
||||
public enum DragDirection
|
||||
{
|
||||
// Token: 0x04000A0F RID: 2575
|
||||
None = 0,
|
||||
// Token: 0x04000A10 RID: 2576
|
||||
LowToHigh = 1,
|
||||
// Token: 0x04000A11 RID: 2577
|
||||
HighToLow = 2,
|
||||
// Token: 0x04000A12 RID: 2578
|
||||
Free = 4
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200030E RID: 782
|
||||
public class Clickable : MouseManipulator
|
||||
{
|
||||
// Token: 0x060031FF RID: 12799 RVA: 0x0004A394 File Offset: 0x00048594
|
||||
public Clickable(Action handler, long delay, long interval)
|
||||
: this(handler)
|
||||
{
|
||||
this.m_Delay = delay;
|
||||
this.m_Interval = interval;
|
||||
}
|
||||
|
||||
// Token: 0x06003200 RID: 12800 RVA: 0x0004A3AC File Offset: 0x000485AC
|
||||
public Clickable(Action handler)
|
||||
{
|
||||
this.clicked = handler;
|
||||
base.activators.Add(new ManipulatorActivationFilter
|
||||
{
|
||||
button = MouseButton.LeftMouse
|
||||
});
|
||||
}
|
||||
|
||||
// Token: 0x14000026 RID: 38
|
||||
// (add) Token: 0x06003201 RID: 12801 RVA: 0x0004A3E4 File Offset: 0x000485E4
|
||||
// (remove) Token: 0x06003202 RID: 12802 RVA: 0x0004A41C File Offset: 0x0004861C
|
||||
[field: DebuggerBrowsable(DebuggerBrowsableState.Never)]
|
||||
public event Action clicked;
|
||||
|
||||
// Token: 0x17000B56 RID: 2902
|
||||
// (get) Token: 0x06003203 RID: 12803 RVA: 0x0004A454 File Offset: 0x00048654
|
||||
// (set) Token: 0x06003204 RID: 12804 RVA: 0x0004A470 File Offset: 0x00048670
|
||||
public Vector2 lastMousePosition { get; private set; }
|
||||
|
||||
// Token: 0x06003205 RID: 12805 RVA: 0x0004A47C File Offset: 0x0004867C
|
||||
private void OnTimer(TimerState timerState)
|
||||
{
|
||||
if (this.clicked != null && this.IsRepeatable())
|
||||
{
|
||||
if (base.target.ContainsPointToLocal(this.lastMousePosition))
|
||||
{
|
||||
this.clicked();
|
||||
base.target.pseudoStates |= PseudoStates.Active;
|
||||
}
|
||||
else
|
||||
{
|
||||
base.target.pseudoStates &= ~PseudoStates.Active;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003206 RID: 12806 RVA: 0x0004A4F4 File Offset: 0x000486F4
|
||||
private bool IsRepeatable()
|
||||
{
|
||||
return this.m_Delay > 0L || this.m_Interval > 0L;
|
||||
}
|
||||
|
||||
// Token: 0x06003207 RID: 12807 RVA: 0x0004A524 File Offset: 0x00048724
|
||||
public override EventPropagation HandleEvent(Event evt, VisualElement finalTarget)
|
||||
{
|
||||
EventType type = evt.type;
|
||||
if (type != EventType.MouseDown)
|
||||
{
|
||||
if (type != EventType.MouseUp)
|
||||
{
|
||||
if (type == EventType.MouseDrag)
|
||||
{
|
||||
if (this.HasCapture())
|
||||
{
|
||||
this.lastMousePosition = evt.mousePosition;
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (base.CanStopManipulation(evt))
|
||||
{
|
||||
this.ReleaseCapture();
|
||||
if (this.IsRepeatable())
|
||||
{
|
||||
base.target.Unschedule(new Action<TimerState>(this.OnTimer));
|
||||
}
|
||||
else if (this.clicked != null && base.target.ContainsPointToLocal(evt.mousePosition))
|
||||
{
|
||||
this.clicked();
|
||||
}
|
||||
base.target.pseudoStates &= ~PseudoStates.Active;
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
else if (base.CanStartManipulation(evt))
|
||||
{
|
||||
this.TakeCapture();
|
||||
this.lastMousePosition = evt.mousePosition;
|
||||
if (this.IsRepeatable())
|
||||
{
|
||||
if (this.clicked != null && base.target.ContainsPointToLocal(evt.mousePosition))
|
||||
{
|
||||
this.clicked();
|
||||
}
|
||||
this.Schedule(new Action<TimerState>(this.OnTimer)).StartingIn(this.m_Delay).Every(this.m_Interval);
|
||||
}
|
||||
base.target.pseudoStates |= PseudoStates.Active;
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
return EventPropagation.Continue;
|
||||
}
|
||||
|
||||
// Token: 0x04000A14 RID: 2580
|
||||
private readonly long m_Delay;
|
||||
|
||||
// Token: 0x04000A15 RID: 2581
|
||||
private readonly long m_Interval;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000333 RID: 819
|
||||
public enum ContextType
|
||||
{
|
||||
// Token: 0x04000A7C RID: 2684
|
||||
Player,
|
||||
// Token: 0x04000A7D RID: 2685
|
||||
Editor
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,348 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000316 RID: 790
|
||||
internal class EventDispatcher : IDispatcher
|
||||
{
|
||||
// Token: 0x17000B61 RID: 2913
|
||||
// (get) Token: 0x06003227 RID: 12839 RVA: 0x0004A98C File Offset: 0x00048B8C
|
||||
// (set) Token: 0x06003228 RID: 12840 RVA: 0x0004A9A8 File Offset: 0x00048BA8
|
||||
public IEventHandler capture { get; set; }
|
||||
|
||||
// Token: 0x06003229 RID: 12841 RVA: 0x0004A9B4 File Offset: 0x00048BB4
|
||||
public void ReleaseCapture(IEventHandler handler)
|
||||
{
|
||||
Debug.Assert(handler == this.capture, "Element releasing capture does not have capture");
|
||||
this.capture = null;
|
||||
}
|
||||
|
||||
// Token: 0x0600322A RID: 12842 RVA: 0x0004A9D4 File Offset: 0x00048BD4
|
||||
public void RemoveCapture()
|
||||
{
|
||||
if (this.capture != null)
|
||||
{
|
||||
this.capture.OnLostCapture();
|
||||
}
|
||||
this.capture = null;
|
||||
}
|
||||
|
||||
// Token: 0x0600322B RID: 12843 RVA: 0x0004A9F8 File Offset: 0x00048BF8
|
||||
public void TakeCapture(IEventHandler handler)
|
||||
{
|
||||
if (this.capture != handler)
|
||||
{
|
||||
if (GUIUtility.hotControl != 0)
|
||||
{
|
||||
Debug.Log("Should not be capturing when there is a hotcontrol");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.RemoveCapture();
|
||||
this.capture = handler;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000B62 RID: 2914
|
||||
// (get) Token: 0x0600322C RID: 12844 RVA: 0x0004AA34 File Offset: 0x00048C34
|
||||
// (set) Token: 0x0600322D RID: 12845 RVA: 0x0004AA50 File Offset: 0x00048C50
|
||||
private VisualElement elementUnderMouse
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_ElementUnderMouse;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this.m_ElementUnderMouse != value)
|
||||
{
|
||||
if (this.m_ElementUnderMouse != null)
|
||||
{
|
||||
this.m_ElementUnderMouse.pseudoStates = this.m_ElementUnderMouse.pseudoStates & ~PseudoStates.Hover;
|
||||
}
|
||||
this.m_ElementUnderMouse = value;
|
||||
if (this.m_ElementUnderMouse != null)
|
||||
{
|
||||
this.m_ElementUnderMouse.pseudoStates = this.m_ElementUnderMouse.pseudoStates | PseudoStates.Hover;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600322E RID: 12846 RVA: 0x0004AAC4 File Offset: 0x00048CC4
|
||||
public EventPropagation DispatchEvent(Event e, BaseVisualElementPanel panel)
|
||||
{
|
||||
EventPropagation eventPropagation;
|
||||
if (e.type == EventType.Repaint)
|
||||
{
|
||||
Debug.Log("Repaint should be handled by Panel before Dispatcher");
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
bool flag = false;
|
||||
if (this.capture != null && this.capture.panel == null)
|
||||
{
|
||||
Debug.Log(string.Format("Capture has no panel, forcing removal (capture={0} eventType={1})", this.capture, e.type));
|
||||
this.RemoveCapture();
|
||||
}
|
||||
if (this.capture != null)
|
||||
{
|
||||
if (this.capture.panel.contextType != panel.contextType)
|
||||
{
|
||||
return EventPropagation.Continue;
|
||||
}
|
||||
VisualElement visualElement = this.capture as VisualElement;
|
||||
if (visualElement != null)
|
||||
{
|
||||
e.mousePosition = visualElement.GlobalToBound(e.mousePosition);
|
||||
}
|
||||
else
|
||||
{
|
||||
IManipulator manipulator = this.capture as IManipulator;
|
||||
if (manipulator != null)
|
||||
{
|
||||
e.mousePosition = manipulator.target.GlobalToBound(e.mousePosition);
|
||||
}
|
||||
}
|
||||
flag = true;
|
||||
if (this.capture.HandleEvent(e, this.capture as VisualElement) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
if (e.isKey)
|
||||
{
|
||||
flag = true;
|
||||
if (panel.focusedElement != null)
|
||||
{
|
||||
if (this.PropagateEvent(panel.focusedElement, e) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
else if (this.SendEventToIMGUIContainers(panel.visualTree, e, panel.focusedElement) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
else if (e.isMouse || e.isScrollWheel || e.type == EventType.DragUpdated || e.type == EventType.DragPerform || e.type == EventType.DragExited)
|
||||
{
|
||||
if (e.type == EventType.MouseLeaveWindow)
|
||||
{
|
||||
this.elementUnderMouse = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.elementUnderMouse = panel.Pick(e.mousePosition);
|
||||
}
|
||||
if (e.type == EventType.MouseDown && this.elementUnderMouse != null && this.elementUnderMouse.enabled)
|
||||
{
|
||||
this.SetFocusedElement(panel, this.elementUnderMouse);
|
||||
}
|
||||
if (this.elementUnderMouse != null)
|
||||
{
|
||||
flag = true;
|
||||
if (this.PropagateEvent(this.elementUnderMouse, e) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
if (e.type == EventType.MouseEnterWindow || e.type == EventType.MouseLeaveWindow)
|
||||
{
|
||||
flag = true;
|
||||
if (this.SendEventToIMGUIContainers(panel.visualTree, e, null) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.type == EventType.ExecuteCommand || e.type == EventType.ValidateCommand)
|
||||
{
|
||||
flag = true;
|
||||
if (panel.focusedElement != null && this.PropagateEvent(panel.focusedElement, e) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
if (this.SendEventToIMGUIContainers(panel.visualTree, e, panel.focusedElement) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
if (e.type == EventType.Used)
|
||||
{
|
||||
flag = true;
|
||||
if (this.SendEventToIMGUIContainers(panel.visualTree, e, null) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
if (!flag)
|
||||
{
|
||||
if (this.SendEventToIMGUIContainers(panel.visualTree, e, null) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
return eventPropagation;
|
||||
}
|
||||
|
||||
// Token: 0x0600322F RID: 12847 RVA: 0x0004AE04 File Offset: 0x00049004
|
||||
private EventPropagation SendEventToIMGUIContainers(VisualElement root, Event evt, VisualElement skipElement)
|
||||
{
|
||||
IMGUIContainer imguicontainer = root as IMGUIContainer;
|
||||
EventPropagation eventPropagation;
|
||||
if (imguicontainer != null && imguicontainer != skipElement)
|
||||
{
|
||||
if (imguicontainer.HandleEvent(evt, imguicontainer) == EventPropagation.Stop)
|
||||
{
|
||||
eventPropagation = EventPropagation.Stop;
|
||||
}
|
||||
else
|
||||
{
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VisualContainer visualContainer = root as VisualContainer;
|
||||
if (visualContainer != null)
|
||||
{
|
||||
for (int i = 0; i < visualContainer.childrenCount; i++)
|
||||
{
|
||||
if (this.SendEventToIMGUIContainers(visualContainer.GetChildAt(i), evt, skipElement) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
}
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
return eventPropagation;
|
||||
}
|
||||
|
||||
// Token: 0x06003230 RID: 12848 RVA: 0x0004AE90 File Offset: 0x00049090
|
||||
private EventPropagation PropagateEvent(VisualElement target, Event evt)
|
||||
{
|
||||
List<VisualElement> list = this.BuildPropagationPath(target);
|
||||
Vector2 mousePosition = evt.mousePosition;
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
VisualElement visualElement = list[i];
|
||||
if (visualElement.enabled)
|
||||
{
|
||||
evt.mousePosition = visualElement.GlobalToBound(mousePosition);
|
||||
List<IManipulator>.Enumerator manipulatorsInternal = visualElement.GetManipulatorsInternal();
|
||||
while (manipulatorsInternal.MoveNext())
|
||||
{
|
||||
IManipulator manipulator = manipulatorsInternal.Current;
|
||||
if (manipulator.phaseInterest == EventPhase.Capture && manipulator.HandleEvent(evt, target) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
if (visualElement.phaseInterest != EventPhase.Capture || visualElement.HandleEvent(evt, target) != EventPropagation.Stop)
|
||||
{
|
||||
goto IL_A2;
|
||||
}
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
IL_A2:;
|
||||
}
|
||||
if (target.enabled)
|
||||
{
|
||||
evt.mousePosition = target.GlobalToBound(mousePosition);
|
||||
List<IManipulator>.Enumerator enumerator = target.GetManipulatorsInternal();
|
||||
while (enumerator.MoveNext())
|
||||
{
|
||||
IManipulator manipulator2 = enumerator.Current;
|
||||
if (manipulator2.phaseInterest == EventPhase.Capture && manipulator2.HandleEvent(evt, target) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
if (target.HandleEvent(evt, target) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
enumerator = target.GetManipulatorsInternal();
|
||||
while (enumerator.MoveNext())
|
||||
{
|
||||
IManipulator manipulator3 = enumerator.Current;
|
||||
if (manipulator3.phaseInterest == EventPhase.BubbleUp && manipulator3.HandleEvent(evt, target) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int j = list.Count - 1; j >= 0; j--)
|
||||
{
|
||||
VisualElement visualElement2 = list[j];
|
||||
if (visualElement2.enabled)
|
||||
{
|
||||
evt.mousePosition = visualElement2.GlobalToBound(mousePosition);
|
||||
if (visualElement2.phaseInterest == EventPhase.BubbleUp && visualElement2.HandleEvent(evt, target) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
List<IManipulator>.Enumerator manipulatorsInternal2 = visualElement2.GetManipulatorsInternal();
|
||||
while (manipulatorsInternal2.MoveNext())
|
||||
{
|
||||
IManipulator manipulator4 = manipulatorsInternal2.Current;
|
||||
if (manipulator4.phaseInterest == EventPhase.BubbleUp && manipulator4.HandleEvent(evt, target) == EventPropagation.Stop)
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return EventPropagation.Continue;
|
||||
}
|
||||
|
||||
// Token: 0x06003231 RID: 12849 RVA: 0x0004B0CC File Offset: 0x000492CC
|
||||
private void SetFocusedElement(BaseVisualElementPanel panel, VisualElement element)
|
||||
{
|
||||
if (panel.focusedElement != element)
|
||||
{
|
||||
if (panel.focusedElement != null)
|
||||
{
|
||||
panel.focusedElement.pseudoStates = panel.focusedElement.pseudoStates & ~PseudoStates.Focus;
|
||||
panel.focusedElement.OnLostKeyboardFocus();
|
||||
}
|
||||
panel.focusedElement = element;
|
||||
if (element != null)
|
||||
{
|
||||
element.pseudoStates |= PseudoStates.Focus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003232 RID: 12850 RVA: 0x0004B13C File Offset: 0x0004933C
|
||||
private List<VisualElement> BuildPropagationPath(VisualElement elem)
|
||||
{
|
||||
List<VisualElement> list = new List<VisualElement>();
|
||||
List<VisualElement> list2;
|
||||
if (elem == null)
|
||||
{
|
||||
list2 = list;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (elem.parent != null)
|
||||
{
|
||||
list.Insert(0, elem.parent);
|
||||
elem = elem.parent;
|
||||
}
|
||||
list2 = list;
|
||||
}
|
||||
return list2;
|
||||
}
|
||||
|
||||
// Token: 0x04000A24 RID: 2596
|
||||
private VisualElement m_ElementUnderMouse;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000314 RID: 788
|
||||
public static class EventHandlerExtensions
|
||||
{
|
||||
// Token: 0x0600321C RID: 12828 RVA: 0x0004A844 File Offset: 0x00048A44
|
||||
public static void TakeCapture(this IEventHandler handler)
|
||||
{
|
||||
if (handler.panel != null)
|
||||
{
|
||||
handler.panel.dispatcher.TakeCapture(handler);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600321D RID: 12829 RVA: 0x0004A868 File Offset: 0x00048A68
|
||||
public static bool HasCapture(this IEventHandler handler)
|
||||
{
|
||||
return handler.panel != null && handler.panel.dispatcher.capture == handler;
|
||||
}
|
||||
|
||||
// Token: 0x0600321E RID: 12830 RVA: 0x0004A8A4 File Offset: 0x00048AA4
|
||||
public static void ReleaseCapture(this IEventHandler handler)
|
||||
{
|
||||
if (handler.panel != null)
|
||||
{
|
||||
handler.panel.dispatcher.ReleaseCapture(handler);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600321F RID: 12831 RVA: 0x0004A8C8 File Offset: 0x00048AC8
|
||||
public static void RemoveCapture(this IEventHandler handler)
|
||||
{
|
||||
if (handler.panel != null)
|
||||
{
|
||||
handler.panel.dispatcher.RemoveCapture();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003220 RID: 12832 RVA: 0x0004A8E8 File Offset: 0x00048AE8
|
||||
public static ScheduleBuilder Schedule(this IEventHandler handler, Action<TimerState> timerUpdateEvent)
|
||||
{
|
||||
ScheduleBuilder scheduleBuilder;
|
||||
if (handler.panel == null || handler.panel.scheduler == null)
|
||||
{
|
||||
Debug.LogError("Cannot schedule an event without a valid panel");
|
||||
scheduleBuilder = default(ScheduleBuilder);
|
||||
}
|
||||
else
|
||||
{
|
||||
scheduleBuilder = handler.panel.scheduler.Schedule(timerUpdateEvent, handler);
|
||||
}
|
||||
return scheduleBuilder;
|
||||
}
|
||||
|
||||
// Token: 0x06003221 RID: 12833 RVA: 0x0004A944 File Offset: 0x00048B44
|
||||
public static void Unschedule(this IEventHandler handler, Action<TimerState> timerUpdateEvent)
|
||||
{
|
||||
if (handler.panel == null || handler.panel.scheduler == null)
|
||||
{
|
||||
Debug.LogError("Cannot unschedule an event without a valid panel");
|
||||
}
|
||||
else
|
||||
{
|
||||
handler.panel.scheduler.Unschedule(timerUpdateEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000312 RID: 786
|
||||
public enum EventPhase
|
||||
{
|
||||
// Token: 0x04000A21 RID: 2593
|
||||
Capture,
|
||||
// Token: 0x04000A22 RID: 2594
|
||||
BubbleUp
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000311 RID: 785
|
||||
public enum EventPropagation
|
||||
{
|
||||
// Token: 0x04000A1E RID: 2590
|
||||
Continue,
|
||||
// Token: 0x04000A1F RID: 2591
|
||||
Stop
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000317 RID: 791
|
||||
public interface IDataWatchHandle : IDisposable
|
||||
{
|
||||
// Token: 0x17000B63 RID: 2915
|
||||
// (get) Token: 0x06003233 RID: 12851
|
||||
Object watched { get; }
|
||||
|
||||
// Token: 0x17000B64 RID: 2916
|
||||
// (get) Token: 0x06003234 RID: 12852
|
||||
bool disposed { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000318 RID: 792
|
||||
public interface IDataWatchService
|
||||
{
|
||||
// Token: 0x06003235 RID: 12853
|
||||
IDataWatchHandle AddWatch(VisualElement watcher, Object watched, Action OnDataChanged);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000315 RID: 789
|
||||
public interface IDispatcher
|
||||
{
|
||||
// Token: 0x17000B60 RID: 2912
|
||||
// (get) Token: 0x06003222 RID: 12834
|
||||
IEventHandler capture { get; }
|
||||
|
||||
// Token: 0x06003223 RID: 12835
|
||||
void ReleaseCapture(IEventHandler handler);
|
||||
|
||||
// Token: 0x06003224 RID: 12836
|
||||
void RemoveCapture();
|
||||
|
||||
// Token: 0x06003225 RID: 12837
|
||||
void TakeCapture(IEventHandler handler);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000313 RID: 787
|
||||
public interface IEventHandler
|
||||
{
|
||||
// Token: 0x06003216 RID: 12822
|
||||
EventPropagation HandleEvent(Event evt, VisualElement finalTarget);
|
||||
|
||||
// Token: 0x17000B5E RID: 2910
|
||||
// (get) Token: 0x06003217 RID: 12823
|
||||
IPanel panel { get; }
|
||||
|
||||
// Token: 0x17000B5F RID: 2911
|
||||
// (get) Token: 0x06003218 RID: 12824
|
||||
// (set) Token: 0x06003219 RID: 12825
|
||||
EventPhase phaseInterest { get; set; }
|
||||
|
||||
// Token: 0x0600321A RID: 12826
|
||||
void OnLostCapture();
|
||||
|
||||
// Token: 0x0600321B RID: 12827
|
||||
void OnLostKeyboardFocus();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200031A RID: 794
|
||||
internal class IMBox : IMElement
|
||||
{
|
||||
// Token: 0x0600323D RID: 12861 RVA: 0x0004B250 File Offset: 0x00049450
|
||||
protected override int DoGenerateControlID()
|
||||
{
|
||||
return GUIUtility.GetControlID("IMBox".GetHashCode(), FocusType.Passive);
|
||||
}
|
||||
|
||||
// Token: 0x0600323E RID: 12862 RVA: 0x0004B278 File Offset: 0x00049478
|
||||
internal override void DoRepaint(IStylePainter args)
|
||||
{
|
||||
base.style.Draw(base.position, GUIContent.Temp(base.text), base.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200031B RID: 795
|
||||
internal class IMButton : IMElement
|
||||
{
|
||||
// Token: 0x17000B67 RID: 2919
|
||||
// (get) Token: 0x06003240 RID: 12864 RVA: 0x0004B2A8 File Offset: 0x000494A8
|
||||
// (set) Token: 0x06003241 RID: 12865 RVA: 0x0004B2C4 File Offset: 0x000494C4
|
||||
public bool wasPressed { get; private set; }
|
||||
|
||||
// Token: 0x06003242 RID: 12866 RVA: 0x0004B2D0 File Offset: 0x000494D0
|
||||
public override bool OnGUI(Event evt)
|
||||
{
|
||||
this.wasPressed = false;
|
||||
return base.OnGUI(evt);
|
||||
}
|
||||
|
||||
// Token: 0x06003243 RID: 12867 RVA: 0x0004B2F4 File Offset: 0x000494F4
|
||||
protected override int DoGenerateControlID()
|
||||
{
|
||||
return GUIUtility.GetControlID("IMButton".GetHashCode(), base.focusType, base.position);
|
||||
}
|
||||
|
||||
// Token: 0x06003244 RID: 12868 RVA: 0x0004B324 File Offset: 0x00049524
|
||||
internal override void DoRepaint(IStylePainter args)
|
||||
{
|
||||
base.style.Draw(base.position, GUIContent.Temp(base.text), base.id, false);
|
||||
}
|
||||
|
||||
// Token: 0x06003245 RID: 12869 RVA: 0x0004B34C File Offset: 0x0004954C
|
||||
protected override bool DoMouseDown(MouseEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (base.position.Contains(args.mousePosition))
|
||||
{
|
||||
GUIUtility.hotControl = base.id;
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06003246 RID: 12870 RVA: 0x0004B390 File Offset: 0x00049590
|
||||
protected override bool DoMouseMove(MouseEventArgs args)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x06003247 RID: 12871 RVA: 0x0004B3A8 File Offset: 0x000495A8
|
||||
protected override bool DoMouseUp(MouseEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (GUIUtility.hotControl == base.id)
|
||||
{
|
||||
GUIUtility.hotControl = 0;
|
||||
if (base.position.Contains(args.mousePosition))
|
||||
{
|
||||
GUIUtility.SetChanged(true);
|
||||
this.wasPressed = true;
|
||||
}
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06003248 RID: 12872 RVA: 0x0004B408 File Offset: 0x00049608
|
||||
protected override bool DoKeyDown(KeyboardEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (args.character == ' ' && GUIUtility.keyboardControl == base.id)
|
||||
{
|
||||
GUIUtility.SetChanged(true);
|
||||
this.wasPressed = true;
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06003249 RID: 12873 RVA: 0x0004B454 File Offset: 0x00049654
|
||||
protected override bool DoMouseDrag(MouseEventArgs args)
|
||||
{
|
||||
return GUIUtility.hotControl == base.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,334 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200031C RID: 796
|
||||
internal class IMButtonGrid : IMElement
|
||||
{
|
||||
// Token: 0x17000B68 RID: 2920
|
||||
// (get) Token: 0x0600324B RID: 12875 RVA: 0x0004B4BC File Offset: 0x000496BC
|
||||
// (set) Token: 0x0600324C RID: 12876 RVA: 0x0004B4D8 File Offset: 0x000496D8
|
||||
public GUIContent[] contents
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Contents;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Contents = value ?? this.s_EmptyContents;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000B69 RID: 2921
|
||||
// (get) Token: 0x0600324D RID: 12877 RVA: 0x0004B4F0 File Offset: 0x000496F0
|
||||
// (set) Token: 0x0600324E RID: 12878 RVA: 0x0004B50C File Offset: 0x0004970C
|
||||
public int xCount { get; set; }
|
||||
|
||||
// Token: 0x17000B6A RID: 2922
|
||||
// (get) Token: 0x0600324F RID: 12879 RVA: 0x0004B518 File Offset: 0x00049718
|
||||
// (set) Token: 0x06003250 RID: 12880 RVA: 0x0004B534 File Offset: 0x00049734
|
||||
public int selected { get; set; }
|
||||
|
||||
// Token: 0x17000B6B RID: 2923
|
||||
// (get) Token: 0x06003251 RID: 12881 RVA: 0x0004B540 File Offset: 0x00049740
|
||||
// (set) Token: 0x06003252 RID: 12882 RVA: 0x0004B55C File Offset: 0x0004975C
|
||||
public GUIStyle firstStyle
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_FirstStyle;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_FirstStyle = value ?? GUIStyle.none;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000B6C RID: 2924
|
||||
// (get) Token: 0x06003253 RID: 12883 RVA: 0x0004B574 File Offset: 0x00049774
|
||||
// (set) Token: 0x06003254 RID: 12884 RVA: 0x0004B590 File Offset: 0x00049790
|
||||
public GUIStyle midStyle
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_MidStyle;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_MidStyle = value ?? GUIStyle.none;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000B6D RID: 2925
|
||||
// (get) Token: 0x06003255 RID: 12885 RVA: 0x0004B5A8 File Offset: 0x000497A8
|
||||
// (set) Token: 0x06003256 RID: 12886 RVA: 0x0004B5C4 File Offset: 0x000497C4
|
||||
public GUIStyle lastStyle
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_LastStyle;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_LastStyle = value ?? GUIStyle.none;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003257 RID: 12887 RVA: 0x0004B5DC File Offset: 0x000497DC
|
||||
protected override int DoGenerateControlID()
|
||||
{
|
||||
return GUIUtility.GetControlID("IMButtonGrid".GetHashCode(), base.focusType, base.position);
|
||||
}
|
||||
|
||||
// Token: 0x06003258 RID: 12888 RVA: 0x0004B60C File Offset: 0x0004980C
|
||||
protected override bool DoMouseDown(MouseEventArgs args)
|
||||
{
|
||||
if (base.position.Contains(args.mousePosition))
|
||||
{
|
||||
int num;
|
||||
float num2;
|
||||
float num3;
|
||||
if (this.ComputeElemDimensions(out num, out num2, out num3))
|
||||
{
|
||||
Rect[] array = IMButtonGrid.CalcMouseRects(base.position, num, this.xCount, num2, num3, base.style, this.firstStyle, this.midStyle, this.lastStyle, false);
|
||||
if (this.GetButtonGridMouseSelection(array, args.mousePosition, true) != -1)
|
||||
{
|
||||
GUIUtility.hotControl = base.id;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x06003259 RID: 12889 RVA: 0x0004B6AC File Offset: 0x000498AC
|
||||
protected override bool DoMouseDrag(MouseEventArgs args)
|
||||
{
|
||||
return GUIUtility.hotControl == base.id;
|
||||
}
|
||||
|
||||
// Token: 0x0600325A RID: 12890 RVA: 0x0004B6DC File Offset: 0x000498DC
|
||||
protected override bool DoMouseUp(MouseEventArgs args)
|
||||
{
|
||||
if (GUIUtility.hotControl == base.id)
|
||||
{
|
||||
int num;
|
||||
float num2;
|
||||
float num3;
|
||||
if (this.ComputeElemDimensions(out num, out num2, out num3))
|
||||
{
|
||||
GUIUtility.hotControl = 0;
|
||||
Rect[] array = IMButtonGrid.CalcMouseRects(base.position, num, this.xCount, num2, num3, base.style, this.firstStyle, this.midStyle, this.lastStyle, false);
|
||||
int buttonGridMouseSelection = this.GetButtonGridMouseSelection(array, args.mousePosition, true);
|
||||
GUI.changed = true;
|
||||
this.selected = buttonGridMouseSelection;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x0600325B RID: 12891 RVA: 0x0004B774 File Offset: 0x00049974
|
||||
internal override void DoRepaint(IStylePainter args)
|
||||
{
|
||||
int num;
|
||||
float num2;
|
||||
float num3;
|
||||
if (this.ComputeElemDimensions(out num, out num2, out num3))
|
||||
{
|
||||
GUIStyle guistyle = GUIStyle.none;
|
||||
GUIClip.Internal_Push(base.position, Vector2.zero, Vector2.zero, false);
|
||||
Rect rect = new Rect(0f, 0f, base.position.width, base.position.height);
|
||||
Rect[] array = IMButtonGrid.CalcMouseRects(rect, num, this.xCount, num2, num3, base.style, this.firstStyle, this.midStyle, this.lastStyle, false);
|
||||
Vector2 vector = args.mousePosition - base.position.position;
|
||||
int buttonGridMouseSelection = this.GetButtonGridMouseSelection(array, vector, base.id == GUIUtility.hotControl);
|
||||
bool flag = rect.Contains(args.mousePosition);
|
||||
GUIUtility.mouseUsed = GUIUtility.mouseUsed || flag;
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
GUIStyle guistyle2;
|
||||
if (i != 0)
|
||||
{
|
||||
guistyle2 = this.midStyle;
|
||||
}
|
||||
else
|
||||
{
|
||||
guistyle2 = this.firstStyle;
|
||||
}
|
||||
if (i == num - 1)
|
||||
{
|
||||
guistyle2 = this.lastStyle;
|
||||
}
|
||||
if (num == 1)
|
||||
{
|
||||
guistyle2 = base.style;
|
||||
}
|
||||
if (i != this.selected)
|
||||
{
|
||||
guistyle2.Draw(array[i], this.contents[i], i == buttonGridMouseSelection && (this.enabled || base.id == GUIUtility.hotControl) && (base.id == GUIUtility.hotControl || GUIUtility.hotControl == 0), base.id == GUIUtility.hotControl && this.enabled, false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
guistyle = guistyle2;
|
||||
}
|
||||
}
|
||||
if (this.selected < num && this.selected > -1)
|
||||
{
|
||||
guistyle.Draw(array[this.selected], this.contents[this.selected], this.selected == buttonGridMouseSelection && (this.enabled || base.id == GUIUtility.hotControl) && (base.id == GUIUtility.hotControl || GUIUtility.hotControl == 0), base.id == GUIUtility.hotControl, true, false);
|
||||
}
|
||||
if (buttonGridMouseSelection >= 0)
|
||||
{
|
||||
GUI.tooltip = this.contents[buttonGridMouseSelection].tooltip;
|
||||
}
|
||||
GUIClip.Internal_Pop();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600325C RID: 12892 RVA: 0x0004B9FC File Offset: 0x00049BFC
|
||||
private static Rect[] CalcMouseRects(Rect position, int count, int xCount, float elemWidth, float elemHeight, GUIStyle style, GUIStyle firstStyle, GUIStyle midStyle, GUIStyle lastStyle, bool addBorders)
|
||||
{
|
||||
int num = 0;
|
||||
float num2 = position.xMin;
|
||||
float num3 = position.yMin;
|
||||
GUIStyle guistyle = style;
|
||||
Rect[] array = new Rect[count];
|
||||
if (count > 1)
|
||||
{
|
||||
guistyle = firstStyle;
|
||||
}
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (!addBorders)
|
||||
{
|
||||
array[i] = new Rect(num2, num3, elemWidth, elemHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
array[i] = guistyle.margin.Add(new Rect(num2, num3, elemWidth, elemHeight));
|
||||
}
|
||||
array[i].width = Mathf.Round(array[i].xMax) - Mathf.Round(array[i].x);
|
||||
array[i].x = Mathf.Round(array[i].x);
|
||||
GUIStyle guistyle2 = midStyle;
|
||||
if (i == count - 2)
|
||||
{
|
||||
guistyle2 = lastStyle;
|
||||
}
|
||||
num2 += elemWidth + (float)Mathf.Max(guistyle.margin.right, guistyle2.margin.left);
|
||||
num++;
|
||||
if (num >= xCount)
|
||||
{
|
||||
num = 0;
|
||||
num3 += elemHeight + (float)Mathf.Max(style.margin.top, style.margin.bottom);
|
||||
num2 = position.xMin;
|
||||
}
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
// Token: 0x0600325D RID: 12893 RVA: 0x0004BB60 File Offset: 0x00049D60
|
||||
private int GetButtonGridMouseSelection(Rect[] buttonRects, Vector2 mousePos, bool findNearest)
|
||||
{
|
||||
for (int i = 0; i < buttonRects.Length; i++)
|
||||
{
|
||||
if (buttonRects[i].Contains(mousePos))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
if (!findNearest)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
float num = float.MaxValue;
|
||||
int num2 = -1;
|
||||
for (int j = 0; j < buttonRects.Length; j++)
|
||||
{
|
||||
Rect rect = buttonRects[j];
|
||||
Vector2 vector = new Vector2(Mathf.Clamp(mousePos.x, rect.xMin, rect.xMax), Mathf.Clamp(mousePos.y, rect.yMin, rect.yMax));
|
||||
float sqrMagnitude = (mousePos - vector).sqrMagnitude;
|
||||
if (sqrMagnitude < num)
|
||||
{
|
||||
num2 = j;
|
||||
num = sqrMagnitude;
|
||||
}
|
||||
}
|
||||
return num2;
|
||||
}
|
||||
|
||||
// Token: 0x0600325E RID: 12894 RVA: 0x0004BC44 File Offset: 0x00049E44
|
||||
private int CalcTotalHorizSpacing()
|
||||
{
|
||||
int num;
|
||||
if (this.xCount < 2)
|
||||
{
|
||||
num = 0;
|
||||
}
|
||||
else if (this.xCount == 2)
|
||||
{
|
||||
num = Mathf.Max(this.firstStyle.margin.right, this.lastStyle.margin.left);
|
||||
}
|
||||
else
|
||||
{
|
||||
int num2 = Mathf.Max(this.midStyle.margin.left, this.midStyle.margin.right);
|
||||
num = Mathf.Max(this.firstStyle.margin.right, this.midStyle.margin.left) + Mathf.Max(this.midStyle.margin.right, this.lastStyle.margin.left) + num2 * (this.xCount - 3);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x0600325F RID: 12895 RVA: 0x0004BD20 File Offset: 0x00049F20
|
||||
private bool ComputeElemDimensions(out int count, out float elemWidth, out float elemHeight)
|
||||
{
|
||||
count = this.contents.Length;
|
||||
elemWidth = 0f;
|
||||
elemHeight = 0f;
|
||||
bool flag;
|
||||
if (count == 0)
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
else if (this.xCount <= 0)
|
||||
{
|
||||
Debug.LogWarning("You are trying to create a SelectionGrid with zero or less elements to be displayed in the horizontal direction. Set xCount to a positive value.");
|
||||
flag = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int num = count / this.xCount;
|
||||
if (count % this.xCount != 0)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
float num2 = (float)this.CalcTotalHorizSpacing();
|
||||
float num3 = (float)(Mathf.Max(base.style.margin.top, base.style.margin.bottom) * (num - 1));
|
||||
elemWidth = (base.position.width - num2) / (float)this.xCount;
|
||||
elemHeight = (base.position.height - num3) / (float)num;
|
||||
if (base.style.fixedWidth != 0f)
|
||||
{
|
||||
elemWidth = base.style.fixedWidth;
|
||||
}
|
||||
if (base.style.fixedHeight != 0f)
|
||||
{
|
||||
elemHeight = base.style.fixedHeight;
|
||||
}
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x04000A28 RID: 2600
|
||||
private GUIContent[] s_EmptyContents = new GUIContent[0];
|
||||
|
||||
// Token: 0x04000A29 RID: 2601
|
||||
private GUIContent[] m_Contents;
|
||||
|
||||
// Token: 0x04000A2C RID: 2604
|
||||
private GUIStyle m_FirstStyle = GUIStyle.none;
|
||||
|
||||
// Token: 0x04000A2D RID: 2605
|
||||
private GUIStyle m_MidStyle = GUIStyle.none;
|
||||
|
||||
// Token: 0x04000A2E RID: 2606
|
||||
private GUIStyle m_LastStyle = GUIStyle.none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200031D RID: 797
|
||||
internal class IMContainer : VisualContainer, IOnGUIHandler, IRecyclable
|
||||
{
|
||||
// Token: 0x06003260 RID: 12896 RVA: 0x0004BE40 File Offset: 0x0004A040
|
||||
public IMContainer()
|
||||
{
|
||||
this.style = GUIStyle.none;
|
||||
base.clipChildren = true;
|
||||
}
|
||||
|
||||
// Token: 0x17000B6E RID: 2926
|
||||
// (get) Token: 0x06003261 RID: 12897 RVA: 0x0004BE5C File Offset: 0x0004A05C
|
||||
// (set) Token: 0x06003262 RID: 12898 RVA: 0x0004BE94 File Offset: 0x0004A094
|
||||
public Vector2 translation
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Vector2(base.transform.m03, base.transform.m13);
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Transform.m03 = value.x;
|
||||
this.m_Transform.m13 = value.y;
|
||||
base.Dirty(ChangeType.Repaint);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000B6F RID: 2927
|
||||
// (get) Token: 0x06003263 RID: 12899 RVA: 0x0004BEC4 File Offset: 0x0004A0C4
|
||||
// (set) Token: 0x06003264 RID: 12900 RVA: 0x0004BEE0 File Offset: 0x0004A0E0
|
||||
public int id { get; set; }
|
||||
|
||||
// Token: 0x17000B70 RID: 2928
|
||||
// (get) Token: 0x06003265 RID: 12901 RVA: 0x0004BEEC File Offset: 0x0004A0EC
|
||||
// (set) Token: 0x06003266 RID: 12902 RVA: 0x0004BF08 File Offset: 0x0004A108
|
||||
public bool isTrashed { get; set; }
|
||||
|
||||
// Token: 0x17000B71 RID: 2929
|
||||
// (get) Token: 0x06003267 RID: 12903 RVA: 0x0004BF14 File Offset: 0x0004A114
|
||||
// (set) Token: 0x06003268 RID: 12904 RVA: 0x0004BF30 File Offset: 0x0004A130
|
||||
internal GUIStyle style
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_GUIStyle;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_GUIStyle = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003269 RID: 12905 RVA: 0x0004BF3C File Offset: 0x0004A13C
|
||||
public virtual void OnTrash()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600326A RID: 12906 RVA: 0x0004BF40 File Offset: 0x0004A140
|
||||
public virtual void OnReuse()
|
||||
{
|
||||
this.style = GUIStyle.none;
|
||||
this.translation = Vector2.zero;
|
||||
base.position = new Rect(0f, 0f, 0f, 0f);
|
||||
}
|
||||
|
||||
// Token: 0x0600326B RID: 12907 RVA: 0x0004BF78 File Offset: 0x0004A178
|
||||
public virtual bool OnGUI(Event evt)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x0600326C RID: 12908 RVA: 0x0004BF90 File Offset: 0x0004A190
|
||||
public virtual void GenerateControlID()
|
||||
{
|
||||
this.id = 0;
|
||||
}
|
||||
|
||||
// Token: 0x04000A31 RID: 2609
|
||||
private GUIStyle m_GUIStyle;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000321 RID: 801
|
||||
internal abstract class IMElement : VisualElement, IOnGUIHandler, IRecyclable
|
||||
{
|
||||
// Token: 0x06003282 RID: 12930 RVA: 0x0004C510 File Offset: 0x0004A710
|
||||
protected IMElement()
|
||||
{
|
||||
this.style = GUIStyle.none;
|
||||
this.focusType = FocusType.Passive;
|
||||
this.id = 0;
|
||||
}
|
||||
|
||||
// Token: 0x17000B78 RID: 2936
|
||||
// (get) Token: 0x06003283 RID: 12931 RVA: 0x0004C534 File Offset: 0x0004A734
|
||||
// (set) Token: 0x06003284 RID: 12932 RVA: 0x0004C550 File Offset: 0x0004A750
|
||||
public FocusType focusType { get; set; }
|
||||
|
||||
// Token: 0x17000B79 RID: 2937
|
||||
// (get) Token: 0x06003285 RID: 12933 RVA: 0x0004C55C File Offset: 0x0004A75C
|
||||
// (set) Token: 0x06003286 RID: 12934 RVA: 0x0004C578 File Offset: 0x0004A778
|
||||
public int id { get; protected set; }
|
||||
|
||||
// Token: 0x17000B7A RID: 2938
|
||||
// (get) Token: 0x06003287 RID: 12935 RVA: 0x0004C584 File Offset: 0x0004A784
|
||||
// (set) Token: 0x06003288 RID: 12936 RVA: 0x0004C5A0 File Offset: 0x0004A7A0
|
||||
public GUIStyle style
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_GUIStyle;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_GUIStyle = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000B7B RID: 2939
|
||||
// (get) Token: 0x06003289 RID: 12937 RVA: 0x0004C5AC File Offset: 0x0004A7AC
|
||||
// (set) Token: 0x0600328A RID: 12938 RVA: 0x0004C5C8 File Offset: 0x0004A7C8
|
||||
public new Rect position { get; set; }
|
||||
|
||||
// Token: 0x17000B7C RID: 2940
|
||||
// (get) Token: 0x0600328B RID: 12939 RVA: 0x0004C5D4 File Offset: 0x0004A7D4
|
||||
// (set) Token: 0x0600328C RID: 12940 RVA: 0x0004C5F0 File Offset: 0x0004A7F0
|
||||
public bool isTrashed { get; set; }
|
||||
|
||||
// Token: 0x0600328D RID: 12941 RVA: 0x0004C5FC File Offset: 0x0004A7FC
|
||||
public virtual void OnTrash()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600328E RID: 12942 RVA: 0x0004C600 File Offset: 0x0004A800
|
||||
public virtual void OnReuse()
|
||||
{
|
||||
this.style = GUIStyle.none;
|
||||
this.position = new Rect(0f, 0f, 0f, 0f);
|
||||
this.enabled = true;
|
||||
this.id = 0;
|
||||
}
|
||||
|
||||
// Token: 0x0600328F RID: 12943 RVA: 0x0004C63C File Offset: 0x0004A83C
|
||||
public virtual bool OnGUI(Event evt)
|
||||
{
|
||||
bool flag = false;
|
||||
switch (evt.GetTypeForControl(this.id))
|
||||
{
|
||||
case EventType.MouseDown:
|
||||
flag = this.DoMouseDown(new MouseEventArgs(evt.mousePosition, evt.clickCount, evt.modifiers));
|
||||
break;
|
||||
case EventType.MouseUp:
|
||||
flag = this.DoMouseUp(new MouseEventArgs(evt.mousePosition, evt.clickCount, evt.modifiers));
|
||||
break;
|
||||
case EventType.MouseMove:
|
||||
flag = this.DoMouseMove(new MouseEventArgs(evt.mousePosition, evt.clickCount, evt.modifiers));
|
||||
break;
|
||||
case EventType.MouseDrag:
|
||||
flag = this.DoMouseDrag(new MouseEventArgs(evt.mousePosition, evt.clickCount, evt.modifiers));
|
||||
break;
|
||||
case EventType.KeyDown:
|
||||
flag = this.DoKeyDown(new KeyboardEventArgs(evt.character, evt.keyCode, evt.modifiers));
|
||||
break;
|
||||
case EventType.KeyUp:
|
||||
flag = this.DoKeyUp(new KeyboardEventArgs(evt.character, evt.keyCode, evt.modifiers));
|
||||
break;
|
||||
case EventType.Repaint:
|
||||
this.DoRepaint(new StylePainter(evt.mousePosition));
|
||||
break;
|
||||
case EventType.DragUpdated:
|
||||
flag = this.DoDragUpdated(new MouseEventArgs(evt.mousePosition, evt.clickCount, evt.modifiers));
|
||||
break;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
evt.Use();
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06003290 RID: 12944 RVA: 0x0004C7B0 File Offset: 0x0004A9B0
|
||||
public void AssignControlID(int id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
// Token: 0x06003291 RID: 12945 RVA: 0x0004C7BC File Offset: 0x0004A9BC
|
||||
public void GenerateControlID()
|
||||
{
|
||||
this.id = this.DoGenerateControlID();
|
||||
}
|
||||
|
||||
// Token: 0x06003292 RID: 12946
|
||||
protected abstract int DoGenerateControlID();
|
||||
|
||||
// Token: 0x06003293 RID: 12947 RVA: 0x0004C7CC File Offset: 0x0004A9CC
|
||||
protected virtual bool DoMouseDown(MouseEventArgs args)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x06003294 RID: 12948 RVA: 0x0004C7E4 File Offset: 0x0004A9E4
|
||||
protected virtual bool DoMouseMove(MouseEventArgs args)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x06003295 RID: 12949 RVA: 0x0004C7FC File Offset: 0x0004A9FC
|
||||
protected virtual bool DoMouseUp(MouseEventArgs args)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x06003296 RID: 12950 RVA: 0x0004C814 File Offset: 0x0004AA14
|
||||
protected virtual bool DoKeyDown(KeyboardEventArgs args)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x06003297 RID: 12951 RVA: 0x0004C82C File Offset: 0x0004AA2C
|
||||
protected virtual bool DoKeyUp(KeyboardEventArgs args)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x06003298 RID: 12952 RVA: 0x0004C844 File Offset: 0x0004AA44
|
||||
protected virtual bool DoMouseDrag(MouseEventArgs args)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x06003299 RID: 12953 RVA: 0x0004C85C File Offset: 0x0004AA5C
|
||||
protected virtual bool DoDragUpdated(MouseEventArgs args)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x04000A42 RID: 2626
|
||||
private GUIStyle m_GUIStyle;
|
||||
|
||||
// Token: 0x04000A44 RID: 2628
|
||||
public const int NonInteractiveControlID = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200031E RID: 798
|
||||
public class IMGUIContainer : VisualElement
|
||||
{
|
||||
// Token: 0x0600326D RID: 12909 RVA: 0x0004BF9C File Offset: 0x0004A19C
|
||||
public IMGUIContainer(Action onGUIHandler)
|
||||
{
|
||||
this.m_OnGUIHandler = onGUIHandler;
|
||||
this.contextType = ContextType.Editor;
|
||||
}
|
||||
|
||||
// Token: 0x17000B72 RID: 2930
|
||||
// (get) Token: 0x0600326E RID: 12910 RVA: 0x0004BFBC File Offset: 0x0004A1BC
|
||||
// (set) Token: 0x0600326F RID: 12911 RVA: 0x0004BFD8 File Offset: 0x0004A1D8
|
||||
public int executionContext { get; set; }
|
||||
|
||||
// Token: 0x17000B73 RID: 2931
|
||||
// (get) Token: 0x06003270 RID: 12912 RVA: 0x0004BFE4 File Offset: 0x0004A1E4
|
||||
// (set) Token: 0x06003271 RID: 12913 RVA: 0x0004C000 File Offset: 0x0004A200
|
||||
internal Rect lastWorldClip { get; set; }
|
||||
|
||||
// Token: 0x17000B74 RID: 2932
|
||||
// (get) Token: 0x06003272 RID: 12914 RVA: 0x0004C00C File Offset: 0x0004A20C
|
||||
private GUILayoutUtility.LayoutCache cache
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.m_Cache == null)
|
||||
{
|
||||
this.m_Cache = new GUILayoutUtility.LayoutCache();
|
||||
}
|
||||
return this.m_Cache;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000B75 RID: 2933
|
||||
// (get) Token: 0x06003273 RID: 12915 RVA: 0x0004C040 File Offset: 0x0004A240
|
||||
// (set) Token: 0x06003274 RID: 12916 RVA: 0x0004C05C File Offset: 0x0004A25C
|
||||
public ContextType contextType { get; set; }
|
||||
|
||||
// Token: 0x17000B76 RID: 2934
|
||||
// (get) Token: 0x06003275 RID: 12917 RVA: 0x0004C068 File Offset: 0x0004A268
|
||||
// (set) Token: 0x06003276 RID: 12918 RVA: 0x0004C084 File Offset: 0x0004A284
|
||||
internal int GUIDepth { get; private set; }
|
||||
|
||||
// Token: 0x06003277 RID: 12919 RVA: 0x0004C090 File Offset: 0x0004A290
|
||||
internal override void DoRepaint(IStylePainter painter)
|
||||
{
|
||||
base.DoRepaint(painter);
|
||||
this.lastWorldClip = painter.currentWorldClip;
|
||||
this.HandleEvent(painter.repaintEvent, this);
|
||||
}
|
||||
|
||||
// Token: 0x06003278 RID: 12920 RVA: 0x0004C0B4 File Offset: 0x0004A2B4
|
||||
internal override void ChangePanel(BaseVisualElementPanel p)
|
||||
{
|
||||
if (base.elementPanel != null)
|
||||
{
|
||||
base.elementPanel.IMGUIContainersCount--;
|
||||
}
|
||||
base.ChangePanel(p);
|
||||
if (base.elementPanel != null)
|
||||
{
|
||||
base.elementPanel.IMGUIContainersCount++;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003279 RID: 12921 RVA: 0x0004C10C File Offset: 0x0004A30C
|
||||
private void SaveGlobals()
|
||||
{
|
||||
this.m_GUIGlobals.matrix = GUI.matrix;
|
||||
this.m_GUIGlobals.color = GUI.color;
|
||||
this.m_GUIGlobals.contentColor = GUI.contentColor;
|
||||
this.m_GUIGlobals.backgroundColor = GUI.backgroundColor;
|
||||
this.m_GUIGlobals.enabled = GUI.enabled;
|
||||
this.m_GUIGlobals.changed = GUI.changed;
|
||||
this.m_GUIGlobals.displayIndex = Event.current.displayIndex;
|
||||
}
|
||||
|
||||
// Token: 0x0600327A RID: 12922 RVA: 0x0004C190 File Offset: 0x0004A390
|
||||
private void RestoreGlobals()
|
||||
{
|
||||
GUI.matrix = this.m_GUIGlobals.matrix;
|
||||
GUI.color = this.m_GUIGlobals.color;
|
||||
GUI.contentColor = this.m_GUIGlobals.contentColor;
|
||||
GUI.backgroundColor = this.m_GUIGlobals.backgroundColor;
|
||||
GUI.enabled = this.m_GUIGlobals.enabled;
|
||||
GUI.changed = this.m_GUIGlobals.changed;
|
||||
Event.current.displayIndex = this.m_GUIGlobals.displayIndex;
|
||||
}
|
||||
|
||||
// Token: 0x0600327B RID: 12923 RVA: 0x0004C214 File Offset: 0x0004A414
|
||||
private bool DoOnGUI(Event evt)
|
||||
{
|
||||
bool flag;
|
||||
if (this.m_OnGUIHandler == null || base.panel == null)
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int num = GUIClip.Internal_GetCount();
|
||||
this.SaveGlobals();
|
||||
int num2 = ((this.executionContext == 0) ? base.elementPanel.instanceID : this.executionContext);
|
||||
UIElementsUtility.BeginContainerGUI(this.cache, num2, evt, this);
|
||||
this.GUIDepth = GUIUtility.Internal_GetGUIDepth();
|
||||
EventType type = Event.current.type;
|
||||
bool flag2 = false;
|
||||
try
|
||||
{
|
||||
this.m_OnGUIHandler();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (type != EventType.Layout)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
flag2 = GUIUtility.IsExitGUIException(ex);
|
||||
if (!flag2)
|
||||
{
|
||||
Debug.LogException(ex);
|
||||
}
|
||||
}
|
||||
GUIUtility.CheckForTabEvent(evt);
|
||||
EventType type2 = Event.current.type;
|
||||
UIElementsUtility.EndContainerGUI();
|
||||
this.RestoreGlobals();
|
||||
if (!flag2)
|
||||
{
|
||||
if (type2 != EventType.Ignore && type2 != EventType.Used)
|
||||
{
|
||||
int num3 = GUIClip.Internal_GetCount();
|
||||
if (num3 > num)
|
||||
{
|
||||
Debug.LogError("GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced)");
|
||||
}
|
||||
else if (num3 < num)
|
||||
{
|
||||
Debug.LogError("GUI Error: You are popping more GUIClips than you are pushing. Make sure they are balanced)");
|
||||
}
|
||||
}
|
||||
}
|
||||
while (GUIClip.Internal_GetCount() > num)
|
||||
{
|
||||
GUIClip.Internal_Pop();
|
||||
}
|
||||
if (type2 == EventType.Used)
|
||||
{
|
||||
base.Dirty(ChangeType.Repaint);
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x0600327C RID: 12924 RVA: 0x0004C38C File Offset: 0x0004A58C
|
||||
public override void OnLostKeyboardFocus()
|
||||
{
|
||||
GUIUtility.keyboardControl = 0;
|
||||
}
|
||||
|
||||
// Token: 0x0600327D RID: 12925 RVA: 0x0004C398 File Offset: 0x0004A598
|
||||
public override EventPropagation HandleEvent(Event evt, VisualElement finalTarget)
|
||||
{
|
||||
EventPropagation eventPropagation;
|
||||
if (this.m_OnGUIHandler == null || base.elementPanel == null || !base.elementPanel.IMGUIEventInterests.WantsEvent(evt.type))
|
||||
{
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
EventType type = evt.type;
|
||||
evt.type = EventType.Layout;
|
||||
bool flag = this.DoOnGUI(evt);
|
||||
evt.type = type;
|
||||
flag |= this.DoOnGUI(evt);
|
||||
if (flag)
|
||||
{
|
||||
eventPropagation = EventPropagation.Stop;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (evt.type == EventType.MouseUp && this.HasCapture())
|
||||
{
|
||||
GUIUtility.hotControl = 0;
|
||||
}
|
||||
if (base.elementPanel == null)
|
||||
{
|
||||
GUIUtility.ExitGUI();
|
||||
}
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
}
|
||||
return eventPropagation;
|
||||
}
|
||||
|
||||
// Token: 0x0600327E RID: 12926 RVA: 0x0004C450 File Offset: 0x0004A650
|
||||
protected internal override Vector2 DoMeasure(float desiredWidth, VisualElement.MeasureMode widthMode, float desiredHeight, VisualElement.MeasureMode heightMode)
|
||||
{
|
||||
float num = float.NaN;
|
||||
float num2 = float.NaN;
|
||||
if (widthMode != VisualElement.MeasureMode.Exactly || heightMode != VisualElement.MeasureMode.Exactly)
|
||||
{
|
||||
this.DoOnGUI(new Event
|
||||
{
|
||||
type = EventType.Layout
|
||||
});
|
||||
num = this.m_Cache.topLevel.minWidth;
|
||||
num2 = this.m_Cache.topLevel.minHeight;
|
||||
}
|
||||
if (widthMode != VisualElement.MeasureMode.Exactly)
|
||||
{
|
||||
if (widthMode == VisualElement.MeasureMode.AtMost)
|
||||
{
|
||||
num = Mathf.Min(num, desiredWidth);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
num = desiredWidth;
|
||||
}
|
||||
if (heightMode != VisualElement.MeasureMode.Exactly)
|
||||
{
|
||||
if (heightMode == VisualElement.MeasureMode.AtMost)
|
||||
{
|
||||
num2 = Mathf.Min(num2, desiredHeight);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
num2 = desiredHeight;
|
||||
}
|
||||
return new Vector2(num, num2);
|
||||
}
|
||||
|
||||
// Token: 0x04000A32 RID: 2610
|
||||
private readonly Action m_OnGUIHandler;
|
||||
|
||||
// Token: 0x04000A35 RID: 2613
|
||||
private GUILayoutUtility.LayoutCache m_Cache = null;
|
||||
|
||||
// Token: 0x04000A38 RID: 2616
|
||||
private IMGUIContainer.GUIGlobals m_GUIGlobals;
|
||||
|
||||
// Token: 0x0200031F RID: 799
|
||||
private struct GUIGlobals
|
||||
{
|
||||
// Token: 0x04000A39 RID: 2617
|
||||
public Matrix4x4 matrix;
|
||||
|
||||
// Token: 0x04000A3A RID: 2618
|
||||
public Color color;
|
||||
|
||||
// Token: 0x04000A3B RID: 2619
|
||||
public Color contentColor;
|
||||
|
||||
// Token: 0x04000A3C RID: 2620
|
||||
public Color backgroundColor;
|
||||
|
||||
// Token: 0x04000A3D RID: 2621
|
||||
public bool enabled;
|
||||
|
||||
// Token: 0x04000A3E RID: 2622
|
||||
public bool changed;
|
||||
|
||||
// Token: 0x04000A3F RID: 2623
|
||||
public int displayIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000322 RID: 802
|
||||
internal class IMGroup : IMContainer
|
||||
{
|
||||
// Token: 0x0600329B RID: 12955 RVA: 0x0004C87C File Offset: 0x0004AA7C
|
||||
public override bool OnGUI(Event evt)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(base.text) || base.style != GUIStyle.none)
|
||||
{
|
||||
EventType type = evt.type;
|
||||
if (type != EventType.Repaint)
|
||||
{
|
||||
if (base.position.Contains(evt.mousePosition))
|
||||
{
|
||||
GUIUtility.mouseUsed = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.DoRepaint(new StylePainter(evt.mousePosition));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x0600329C RID: 12956 RVA: 0x0004C904 File Offset: 0x0004AB04
|
||||
public override void GenerateControlID()
|
||||
{
|
||||
base.id = GUIUtility.GetControlID("IMGroup".GetHashCode(), FocusType.Passive);
|
||||
}
|
||||
|
||||
// Token: 0x0600329D RID: 12957 RVA: 0x0004C920 File Offset: 0x0004AB20
|
||||
internal override void DoRepaint(IStylePainter args)
|
||||
{
|
||||
base.style.Draw(base.position, GUIContent.Temp(base.text), base.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000323 RID: 803
|
||||
internal class IMImage : IMElement
|
||||
{
|
||||
// Token: 0x0600329E RID: 12958 RVA: 0x0004C948 File Offset: 0x0004AB48
|
||||
public IMImage()
|
||||
{
|
||||
this.scaleMode = ScaleMode.ScaleAndCrop;
|
||||
}
|
||||
|
||||
// Token: 0x17000B7D RID: 2941
|
||||
// (get) Token: 0x0600329F RID: 12959 RVA: 0x0004C958 File Offset: 0x0004AB58
|
||||
// (set) Token: 0x060032A0 RID: 12960 RVA: 0x0004C974 File Offset: 0x0004AB74
|
||||
public Texture image { get; set; }
|
||||
|
||||
// Token: 0x17000B7E RID: 2942
|
||||
// (get) Token: 0x060032A1 RID: 12961 RVA: 0x0004C980 File Offset: 0x0004AB80
|
||||
// (set) Token: 0x060032A2 RID: 12962 RVA: 0x0004C99C File Offset: 0x0004AB9C
|
||||
public ScaleMode scaleMode { get; set; }
|
||||
|
||||
// Token: 0x17000B7F RID: 2943
|
||||
// (get) Token: 0x060032A3 RID: 12963 RVA: 0x0004C9A8 File Offset: 0x0004ABA8
|
||||
// (set) Token: 0x060032A4 RID: 12964 RVA: 0x0004C9C4 File Offset: 0x0004ABC4
|
||||
public float imageAspect { get; set; }
|
||||
|
||||
// Token: 0x17000B80 RID: 2944
|
||||
// (get) Token: 0x060032A5 RID: 12965 RVA: 0x0004C9D0 File Offset: 0x0004ABD0
|
||||
// (set) Token: 0x060032A6 RID: 12966 RVA: 0x0004C9EC File Offset: 0x0004ABEC
|
||||
public bool alphaBlend { get; set; }
|
||||
|
||||
// Token: 0x060032A7 RID: 12967 RVA: 0x0004C9F8 File Offset: 0x0004ABF8
|
||||
protected override int DoGenerateControlID()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Token: 0x060032A8 RID: 12968 RVA: 0x0004CA10 File Offset: 0x0004AC10
|
||||
internal override void DoRepaint(IStylePainter args)
|
||||
{
|
||||
if (this.image == null)
|
||||
{
|
||||
Debug.LogWarning("null texture passed to GUI.DrawTexture");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.imageAspect == 0f)
|
||||
{
|
||||
this.imageAspect = (float)this.image.width / (float)this.image.height;
|
||||
}
|
||||
Material material = ((!this.alphaBlend) ? GUI.blitMaterial : GUI.blendMaterial);
|
||||
float num = base.position.width / base.position.height;
|
||||
Internal_DrawTextureArguments internal_DrawTextureArguments = new Internal_DrawTextureArguments
|
||||
{
|
||||
leftBorder = 0,
|
||||
rightBorder = 0,
|
||||
topBorder = 0,
|
||||
bottomBorder = 0,
|
||||
color = GUI.color,
|
||||
texture = this.image,
|
||||
mat = material
|
||||
};
|
||||
ScaleMode scaleMode = this.scaleMode;
|
||||
if (scaleMode != ScaleMode.StretchToFill)
|
||||
{
|
||||
if (scaleMode != ScaleMode.ScaleAndCrop)
|
||||
{
|
||||
if (scaleMode == ScaleMode.ScaleToFit)
|
||||
{
|
||||
if (num > this.imageAspect)
|
||||
{
|
||||
float num2 = this.imageAspect / num;
|
||||
internal_DrawTextureArguments.screenRect = new Rect(base.position.xMin + base.position.width * (1f - num2) * 0.5f, base.position.yMin, num2 * base.position.width, base.position.height);
|
||||
internal_DrawTextureArguments.sourceRect = new Rect(0f, 0f, 1f, 1f);
|
||||
Graphics.Internal_DrawTexture(ref internal_DrawTextureArguments);
|
||||
}
|
||||
else
|
||||
{
|
||||
float num3 = num / this.imageAspect;
|
||||
internal_DrawTextureArguments.screenRect = new Rect(base.position.xMin, base.position.yMin + base.position.height * (1f - num3) * 0.5f, base.position.width, num3 * base.position.height);
|
||||
internal_DrawTextureArguments.sourceRect = new Rect(0f, 0f, 1f, 1f);
|
||||
Graphics.Internal_DrawTexture(ref internal_DrawTextureArguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (num > this.imageAspect)
|
||||
{
|
||||
float num4 = this.imageAspect / num;
|
||||
internal_DrawTextureArguments.screenRect = base.position;
|
||||
internal_DrawTextureArguments.sourceRect = new Rect(0f, (1f - num4) * 0.5f, 1f, num4);
|
||||
Graphics.Internal_DrawTexture(ref internal_DrawTextureArguments);
|
||||
}
|
||||
else
|
||||
{
|
||||
float num5 = num / this.imageAspect;
|
||||
internal_DrawTextureArguments.screenRect = base.position;
|
||||
internal_DrawTextureArguments.sourceRect = new Rect(0.5f - num5 * 0.5f, 0f, num5, 1f);
|
||||
Graphics.Internal_DrawTexture(ref internal_DrawTextureArguments);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
internal_DrawTextureArguments.screenRect = base.position;
|
||||
internal_DrawTextureArguments.sourceRect = new Rect(0f, 0f, 1f, 1f);
|
||||
Graphics.Internal_DrawTexture(ref internal_DrawTextureArguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200032A RID: 810
|
||||
internal class IMKeyboardTextField : IMTextField
|
||||
{
|
||||
// Token: 0x060032FD RID: 13053 RVA: 0x0004ED34 File Offset: 0x0004CF34
|
||||
public override bool OnGUI(Event evt)
|
||||
{
|
||||
base.SyncTextEditor();
|
||||
this.m_Changed = false;
|
||||
bool flag = false;
|
||||
switch (evt.type)
|
||||
{
|
||||
case EventType.MouseDown:
|
||||
flag = this.DoMouseDown(new MouseEventArgs(evt.mousePosition, evt.clickCount, evt.modifiers));
|
||||
break;
|
||||
case EventType.MouseUp:
|
||||
flag = this.DoMouseUp(new MouseEventArgs(evt.mousePosition, evt.clickCount, evt.modifiers));
|
||||
break;
|
||||
case EventType.MouseDrag:
|
||||
flag = this.DoMouseDrag(new MouseEventArgs(evt.mousePosition, evt.clickCount, evt.modifiers));
|
||||
break;
|
||||
case EventType.KeyDown:
|
||||
flag = this.DoKeyDown(new KeyboardEventArgs(evt.character, evt.keyCode, evt.modifiers));
|
||||
break;
|
||||
case EventType.Repaint:
|
||||
this.DoRepaint(new StylePainter(evt.mousePosition));
|
||||
break;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
evt.Use();
|
||||
}
|
||||
if (GUIUtility.keyboardControl == base.id)
|
||||
{
|
||||
GUIUtility.textFieldInput = true;
|
||||
}
|
||||
if (this.m_Changed)
|
||||
{
|
||||
GUI.changed = true;
|
||||
base.text = base.editor.text;
|
||||
if (base.maxLength >= 0 && base.text.Length > base.maxLength)
|
||||
{
|
||||
base.text = base.text.Substring(0, base.maxLength);
|
||||
}
|
||||
evt.Use();
|
||||
}
|
||||
base.editor.UpdateScrollOffsetIfNeeded(evt);
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x060032FE RID: 13054 RVA: 0x0004EEC4 File Offset: 0x0004D0C4
|
||||
internal override void DoRepaint(IStylePainter args)
|
||||
{
|
||||
if (GUIUtility.keyboardControl != base.id)
|
||||
{
|
||||
base.style.Draw(base.position, GUIContent.Temp(base.text), base.id, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.editor.DrawCursor(base.text);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060032FF RID: 13055 RVA: 0x0004EF20 File Offset: 0x0004D120
|
||||
protected override bool DoMouseDown(MouseEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (base.position.Contains(args.mousePosition))
|
||||
{
|
||||
GUIUtility.hotControl = base.id;
|
||||
GUIUtility.keyboardControl = base.id;
|
||||
base.editor.m_HasFocus = true;
|
||||
base.editor.MoveCursorToPosition(args.mousePosition);
|
||||
if (args.clickCount == 2 && GUI.skin.settings.doubleClickSelectsWord)
|
||||
{
|
||||
base.editor.SelectCurrentWord();
|
||||
base.editor.DblClickSnap(TextEditor.DblClickSnapping.WORDS);
|
||||
base.editor.MouseDragSelectsWholeWords(true);
|
||||
}
|
||||
else if (args.clickCount == 3 && GUI.skin.settings.tripleClickSelectsLine)
|
||||
{
|
||||
base.editor.SelectCurrentParagraph();
|
||||
base.editor.MouseDragSelectsWholeWords(true);
|
||||
base.editor.DblClickSnap(TextEditor.DblClickSnapping.PARAGRAPHS);
|
||||
}
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06003300 RID: 13056 RVA: 0x0004F020 File Offset: 0x0004D220
|
||||
protected override bool DoMouseUp(MouseEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (GUIUtility.hotControl == base.id)
|
||||
{
|
||||
base.editor.MouseDragSelectsWholeWords(false);
|
||||
GUIUtility.hotControl = 0;
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06003301 RID: 13057 RVA: 0x0004F060 File Offset: 0x0004D260
|
||||
protected override bool DoMouseDrag(MouseEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (GUIUtility.hotControl == base.id)
|
||||
{
|
||||
if (args.shift)
|
||||
{
|
||||
base.editor.MoveCursorToPosition(args.mousePosition);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.editor.SelectToPosition(args.mousePosition);
|
||||
}
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06003302 RID: 13058 RVA: 0x0004F0C4 File Offset: 0x0004D2C4
|
||||
protected override bool DoKeyDown(KeyboardEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (GUIUtility.keyboardControl != base.id)
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
else if (base.editor.HandleKeyEvent(args.ToEvent()))
|
||||
{
|
||||
this.m_Changed = true;
|
||||
base.text = base.editor.text;
|
||||
flag = true;
|
||||
}
|
||||
else if (args.keyCode == KeyCode.Tab || args.character == '\t')
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
char character = args.character;
|
||||
if (character == '\n' && !base.multiline && !args.alt)
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Font font = base.style.font;
|
||||
if (font == null)
|
||||
{
|
||||
font = GUI.skin.font;
|
||||
}
|
||||
if (font.HasCharacter(character) || character == '\n')
|
||||
{
|
||||
base.editor.Insert(character);
|
||||
this.m_Changed = true;
|
||||
flag = character == '\n';
|
||||
}
|
||||
else if (character == '\0')
|
||||
{
|
||||
if (Input.compositionString.Length > 0)
|
||||
{
|
||||
base.editor.ReplaceSelection("");
|
||||
this.m_Changed = true;
|
||||
}
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x04000A6C RID: 2668
|
||||
private bool m_Changed;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000324 RID: 804
|
||||
internal class IMLabel : IMElement
|
||||
{
|
||||
// Token: 0x060032AA RID: 12970 RVA: 0x0004CD50 File Offset: 0x0004AF50
|
||||
public void ShowTooltip(Vector2 tooltipPos)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(base.tooltip))
|
||||
{
|
||||
if (base.position.Contains(tooltipPos))
|
||||
{
|
||||
GUIStyle.SetMouseTooltip(base.tooltip, base.position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060032AB RID: 12971 RVA: 0x0004CD98 File Offset: 0x0004AF98
|
||||
protected override int DoGenerateControlID()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Token: 0x060032AC RID: 12972 RVA: 0x0004CDB0 File Offset: 0x0004AFB0
|
||||
internal override void DoRepaint(IStylePainter args)
|
||||
{
|
||||
base.style.Draw(base.position, GUIContent.Temp(base.text), false, false, false, false);
|
||||
this.ShowTooltip(args.mousePosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000325 RID: 805
|
||||
internal class IMRepeatButton : IMElement
|
||||
{
|
||||
// Token: 0x060032AD RID: 12973 RVA: 0x0004CDE0 File Offset: 0x0004AFE0
|
||||
public IMRepeatButton()
|
||||
{
|
||||
base.focusType = FocusType.Keyboard;
|
||||
}
|
||||
|
||||
// Token: 0x17000B81 RID: 2945
|
||||
// (get) Token: 0x060032AE RID: 12974 RVA: 0x0004CDF0 File Offset: 0x0004AFF0
|
||||
// (set) Token: 0x060032AF RID: 12975 RVA: 0x0004CE0C File Offset: 0x0004B00C
|
||||
public bool isPressed { get; private set; }
|
||||
|
||||
// Token: 0x060032B0 RID: 12976 RVA: 0x0004CE18 File Offset: 0x0004B018
|
||||
public override bool OnGUI(Event evt)
|
||||
{
|
||||
this.isPressed = false;
|
||||
return base.OnGUI(evt);
|
||||
}
|
||||
|
||||
// Token: 0x060032B1 RID: 12977 RVA: 0x0004CE3C File Offset: 0x0004B03C
|
||||
protected override int DoGenerateControlID()
|
||||
{
|
||||
return GUIUtility.GetControlID("IMRepeatButton".GetHashCode(), base.focusType, base.position);
|
||||
}
|
||||
|
||||
// Token: 0x060032B2 RID: 12978 RVA: 0x0004CE6C File Offset: 0x0004B06C
|
||||
internal override void DoRepaint(IStylePainter args)
|
||||
{
|
||||
base.style.Draw(base.position, GUIContent.Temp(base.text), base.id);
|
||||
if (GUIUtility.hotControl == base.id)
|
||||
{
|
||||
this.isPressed = base.position.Contains(args.mousePosition);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060032B3 RID: 12979 RVA: 0x0004CEC8 File Offset: 0x0004B0C8
|
||||
protected override bool DoMouseDown(MouseEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (base.position.Contains(args.mousePosition))
|
||||
{
|
||||
GUIUtility.hotControl = base.id;
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x060032B4 RID: 12980 RVA: 0x0004CF0C File Offset: 0x0004B10C
|
||||
protected override bool DoMouseUp(MouseEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (GUIUtility.hotControl == base.id)
|
||||
{
|
||||
GUIUtility.hotControl = 0;
|
||||
this.isPressed = base.position.Contains(args.mousePosition);
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x060032B5 RID: 12981 RVA: 0x0004CF5C File Offset: 0x0004B15C
|
||||
protected override bool DoMouseDrag(MouseEventArgs args)
|
||||
{
|
||||
return GUIUtility.hotControl == base.id;
|
||||
}
|
||||
|
||||
// Token: 0x060032B6 RID: 12982 RVA: 0x0004CF8C File Offset: 0x0004B18C
|
||||
protected override bool DoKeyDown(KeyboardEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (args.character == ' ' && GUIUtility.keyboardControl == base.id)
|
||||
{
|
||||
GUIUtility.SetChanged(true);
|
||||
this.isPressed = true;
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x060032B7 RID: 12983 RVA: 0x0004CFD8 File Offset: 0x0004B1D8
|
||||
protected override bool DoKeyUp(KeyboardEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (args.character == ' ' && GUIUtility.keyboardControl == base.id)
|
||||
{
|
||||
this.isPressed = false;
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000327 RID: 807
|
||||
internal class IMScrollView : IMContainer
|
||||
{
|
||||
// Token: 0x060032C2 RID: 12994 RVA: 0x0004D524 File Offset: 0x0004B724
|
||||
public IMScrollView()
|
||||
{
|
||||
this.m_HorizontalScrollbar = GUIStyle.none;
|
||||
this.m_VerticalScrollbar = GUIStyle.none;
|
||||
this.m_Background = GUIStyle.none;
|
||||
this.m_HorizontalScroller = new IMScroller();
|
||||
this.m_VerticalScroller = new IMScroller();
|
||||
}
|
||||
|
||||
// Token: 0x17000B83 RID: 2947
|
||||
// (get) Token: 0x060032C3 RID: 12995 RVA: 0x0004D564 File Offset: 0x0004B764
|
||||
// (set) Token: 0x060032C4 RID: 12996 RVA: 0x0004D580 File Offset: 0x0004B780
|
||||
public Vector2 scrollPosition
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_ScrollPosition;
|
||||
}
|
||||
private set
|
||||
{
|
||||
this.m_ScrollPosition = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000B84 RID: 2948
|
||||
// (get) Token: 0x060032C5 RID: 12997 RVA: 0x0004D58C File Offset: 0x0004B78C
|
||||
// (set) Token: 0x060032C6 RID: 12998 RVA: 0x0004D5AC File Offset: 0x0004B7AC
|
||||
public float scrollPositionHorizontal
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_ScrollPosition.x;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_ScrollPosition.x = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000B85 RID: 2949
|
||||
// (get) Token: 0x060032C7 RID: 12999 RVA: 0x0004D5BC File Offset: 0x0004B7BC
|
||||
// (set) Token: 0x060032C8 RID: 13000 RVA: 0x0004D5DC File Offset: 0x0004B7DC
|
||||
public float scrollPositionVertical
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_ScrollPosition.y;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_ScrollPosition.y = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060032C9 RID: 13001 RVA: 0x0004D5EC File Offset: 0x0004B7EC
|
||||
public void SetProperties(Rect pos, Vector2 scrollPos, Rect viewRect, bool alwaysShowHorizontal, bool alwaysShowVertical, GUIStyle horizontalScrollbar, GUIStyle verticalScrollbar, GUIStyle background)
|
||||
{
|
||||
base.position = pos;
|
||||
this.scrollPosition = scrollPos;
|
||||
this.viewRect = viewRect;
|
||||
this.m_HorizontalScrollbar = horizontalScrollbar;
|
||||
this.m_VerticalScrollbar = verticalScrollbar;
|
||||
this.m_Background = background;
|
||||
this.m_NeedsVertical = alwaysShowVertical;
|
||||
this.m_NeedsHorizontal = alwaysShowHorizontal;
|
||||
this.CheckState();
|
||||
GUIStyle guistyle = ((this.m_HorizontalScrollbar == GUIStyle.none) ? GUIStyle.none : GUI.skin.GetStyle(this.m_HorizontalScrollbar.name + "thumb"));
|
||||
GUIStyle guistyle2 = ((this.m_HorizontalScrollbar == GUIStyle.none) ? GUIStyle.none : GUI.skin.GetStyle(this.m_HorizontalScrollbar.name + "leftbutton"));
|
||||
GUIStyle guistyle3 = ((this.m_HorizontalScrollbar == GUIStyle.none) ? GUIStyle.none : GUI.skin.GetStyle(this.m_HorizontalScrollbar.name + "rightbutton"));
|
||||
this.m_HorizontalScroller.SetProperties(new Rect(base.position.x, base.position.yMax - this.m_HorizontalScrollbar.fixedHeight, this.m_ClipRect.width, this.m_HorizontalScrollbar.fixedHeight), this.scrollPosition.x, Mathf.Min(this.m_ClipRect.width, this.viewRect.width), 0f, this.viewRect.width, this.m_HorizontalScrollbar, guistyle, guistyle2, guistyle3, true);
|
||||
GUIStyle guistyle4 = ((this.m_VerticalScrollbar == GUIStyle.none) ? GUIStyle.none : GUI.skin.GetStyle(this.m_VerticalScrollbar.name + "thumb"));
|
||||
GUIStyle guistyle5 = ((this.m_VerticalScrollbar == GUIStyle.none) ? GUIStyle.none : GUI.skin.GetStyle(this.m_VerticalScrollbar.name + "upbutton"));
|
||||
GUIStyle guistyle6 = ((this.m_VerticalScrollbar == GUIStyle.none) ? GUIStyle.none : GUI.skin.GetStyle(this.m_VerticalScrollbar.name + "downbutton"));
|
||||
this.m_VerticalScroller.SetProperties(new Rect(this.m_ClipRect.xMax + (float)this.m_VerticalScrollbar.margin.left, this.m_ClipRect.y, this.m_VerticalScrollbar.fixedWidth, this.m_ClipRect.height), this.scrollPosition.y, Mathf.Min(this.m_ClipRect.height, this.viewRect.height), 0f, this.viewRect.height, this.m_VerticalScrollbar, guistyle4, guistyle5, guistyle6, false);
|
||||
}
|
||||
|
||||
// Token: 0x060032CA RID: 13002 RVA: 0x0004D8C4 File Offset: 0x0004BAC4
|
||||
public override void OnReuse()
|
||||
{
|
||||
base.OnReuse();
|
||||
this.m_HorizontalScroller.OnReuse();
|
||||
this.m_VerticalScroller.OnReuse();
|
||||
}
|
||||
|
||||
// Token: 0x060032CB RID: 13003 RVA: 0x0004D8E4 File Offset: 0x0004BAE4
|
||||
public void HandleScrollWheel(Event evt)
|
||||
{
|
||||
if (this.m_State.position.Contains(evt.mousePosition))
|
||||
{
|
||||
this.m_State.scrollPosition.x = Mathf.Clamp(this.m_State.scrollPosition.x + evt.delta.x * 20f, 0f, this.m_State.viewRect.width - this.m_State.visibleRect.width);
|
||||
this.m_State.scrollPosition.y = Mathf.Clamp(this.m_State.scrollPosition.y + evt.delta.y * 20f, 0f, this.m_State.viewRect.height - this.m_State.visibleRect.height);
|
||||
this.m_State.apply = true;
|
||||
evt.Use();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060032CC RID: 13004 RVA: 0x0004D9E4 File Offset: 0x0004BBE4
|
||||
public override bool OnGUI(Event evt)
|
||||
{
|
||||
bool flag = false;
|
||||
switch (evt.GetTypeForControl(base.id))
|
||||
{
|
||||
case EventType.Layout:
|
||||
case EventType.Used:
|
||||
goto IL_1F0;
|
||||
case EventType.DragUpdated:
|
||||
flag = this.DoDragUpdated(new MouseEventArgs(evt.mousePosition, evt.clickCount, evt.modifiers));
|
||||
goto IL_1F0;
|
||||
}
|
||||
if (evt.type == EventType.Repaint && this.m_Background != GUIStyle.none)
|
||||
{
|
||||
this.m_Background.Draw(base.position, base.position.Contains(evt.mousePosition), false, this.m_NeedsHorizontal && this.m_NeedsVertical, false);
|
||||
}
|
||||
if (this.m_NeedsHorizontal && this.m_HorizontalScrollbar != GUIStyle.none)
|
||||
{
|
||||
flag = this.m_HorizontalScroller.OnGUI(evt);
|
||||
this.scrollPositionHorizontal = this.m_HorizontalScroller.value;
|
||||
}
|
||||
else if (this.m_HorizontalScrollbar != GUIStyle.none)
|
||||
{
|
||||
this.scrollPositionHorizontal = 0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.scrollPositionHorizontal = Mathf.Clamp(this.scrollPositionHorizontal, 0f, Mathf.Max(this.viewRect.width - base.position.width, 0f));
|
||||
}
|
||||
if (this.m_NeedsVertical && this.m_VerticalScrollbar != GUIStyle.none)
|
||||
{
|
||||
flag = this.m_VerticalScroller.OnGUI(evt);
|
||||
this.scrollPositionVertical = this.m_VerticalScroller.value;
|
||||
}
|
||||
else if (this.m_VerticalScrollbar != GUIStyle.none)
|
||||
{
|
||||
this.scrollPositionVertical = 0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.scrollPositionVertical = Mathf.Clamp(this.scrollPositionVertical, 0f, Mathf.Max(this.viewRect.height - base.position.height, 0f));
|
||||
}
|
||||
IL_1F0:
|
||||
if (flag)
|
||||
{
|
||||
evt.Use();
|
||||
}
|
||||
GUIClip.Internal_Push(this.m_ClipRect, new Vector2(Mathf.Round(-this.scrollPosition.x - this.viewRect.x), Mathf.Round(-this.scrollPosition.y - this.viewRect.y)), Vector2.zero, false);
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x060032CD RID: 13005 RVA: 0x0004DC54 File Offset: 0x0004BE54
|
||||
public void ScrollTo(Rect pos)
|
||||
{
|
||||
this.m_State.ScrollTo(pos);
|
||||
}
|
||||
|
||||
// Token: 0x060032CE RID: 13006 RVA: 0x0004DC64 File Offset: 0x0004BE64
|
||||
public bool ScrollTowards(Rect pos, float maxDelta)
|
||||
{
|
||||
return this.m_State.ScrollTowards(pos, maxDelta);
|
||||
}
|
||||
|
||||
// Token: 0x060032CF RID: 13007 RVA: 0x0004DC88 File Offset: 0x0004BE88
|
||||
public override void GenerateControlID()
|
||||
{
|
||||
this.m_HorizontalScroller.GenerateControlID();
|
||||
this.m_VerticalScroller.GenerateControlID();
|
||||
base.id = GUIUtility.GetControlID("ScrollView".GetHashCode(), FocusType.Passive);
|
||||
}
|
||||
|
||||
// Token: 0x060032D0 RID: 13008 RVA: 0x0004DCB8 File Offset: 0x0004BEB8
|
||||
private void CheckState()
|
||||
{
|
||||
Debug.Assert(base.id != 0, "Invalid zero control ID");
|
||||
this.m_State = (ScrollViewState)GUIUtility.GetStateObject(typeof(ScrollViewState), base.id);
|
||||
if (this.m_State.apply)
|
||||
{
|
||||
this.scrollPosition = this.m_State.scrollPosition;
|
||||
this.m_State.apply = false;
|
||||
}
|
||||
this.m_State.position = base.position;
|
||||
this.m_State.scrollPosition = this.scrollPosition;
|
||||
this.m_State.viewRect = this.viewRect;
|
||||
this.m_State.visibleRect = this.viewRect;
|
||||
this.m_State.visibleRect.width = base.position.width;
|
||||
this.m_State.visibleRect.height = base.position.height;
|
||||
this.m_ClipRect = new Rect(base.position);
|
||||
if (this.m_NeedsHorizontal || this.viewRect.width > this.m_ClipRect.width)
|
||||
{
|
||||
this.m_State.visibleRect.height = base.position.height - this.m_HorizontalScrollbar.fixedHeight + (float)this.m_HorizontalScrollbar.margin.top;
|
||||
this.m_ClipRect.height = this.m_ClipRect.height - (this.m_HorizontalScrollbar.fixedHeight + (float)this.m_HorizontalScrollbar.margin.top);
|
||||
this.m_NeedsHorizontal = true;
|
||||
}
|
||||
if (this.m_NeedsVertical || this.viewRect.height > this.m_ClipRect.height)
|
||||
{
|
||||
this.m_State.visibleRect.width = base.position.width - this.m_VerticalScrollbar.fixedWidth + (float)this.m_VerticalScrollbar.margin.left;
|
||||
this.m_ClipRect.width = this.m_ClipRect.width - (this.m_VerticalScrollbar.fixedWidth + (float)this.m_VerticalScrollbar.margin.left);
|
||||
this.m_NeedsVertical = true;
|
||||
if (!this.m_NeedsHorizontal && this.viewRect.width > this.m_ClipRect.width)
|
||||
{
|
||||
this.m_State.visibleRect.height = base.position.height - this.m_HorizontalScrollbar.fixedHeight + (float)this.m_HorizontalScrollbar.margin.top;
|
||||
this.m_ClipRect.height = this.m_ClipRect.height - (this.m_HorizontalScrollbar.fixedHeight + (float)this.m_HorizontalScrollbar.margin.top);
|
||||
this.m_NeedsHorizontal = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060032D1 RID: 13009 RVA: 0x0004DF8C File Offset: 0x0004C18C
|
||||
private bool DoDragUpdated(MouseEventArgs args)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x04000A55 RID: 2645
|
||||
private ScrollViewState m_State;
|
||||
|
||||
// Token: 0x04000A56 RID: 2646
|
||||
private Vector2 m_ScrollPosition;
|
||||
|
||||
// Token: 0x04000A57 RID: 2647
|
||||
private GUIStyle m_HorizontalScrollbar;
|
||||
|
||||
// Token: 0x04000A58 RID: 2648
|
||||
private GUIStyle m_VerticalScrollbar;
|
||||
|
||||
// Token: 0x04000A59 RID: 2649
|
||||
private GUIStyle m_Background;
|
||||
|
||||
// Token: 0x04000A5A RID: 2650
|
||||
public Rect viewRect;
|
||||
|
||||
// Token: 0x04000A5B RID: 2651
|
||||
private bool m_NeedsVertical;
|
||||
|
||||
// Token: 0x04000A5C RID: 2652
|
||||
private bool m_NeedsHorizontal;
|
||||
|
||||
// Token: 0x04000A5D RID: 2653
|
||||
private Rect m_ClipRect;
|
||||
|
||||
// Token: 0x04000A5E RID: 2654
|
||||
private readonly IMScroller m_HorizontalScroller;
|
||||
|
||||
// Token: 0x04000A5F RID: 2655
|
||||
private readonly IMScroller m_VerticalScroller;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000326 RID: 806
|
||||
internal class IMScroller : IMElement
|
||||
{
|
||||
// Token: 0x060032B8 RID: 12984 RVA: 0x0004D01C File Offset: 0x0004B21C
|
||||
public IMScroller()
|
||||
{
|
||||
this.m_NextScrollStepTime = DateTime.Now;
|
||||
this.m_Slider = new IMSlider();
|
||||
this.m_LeftButton = new IMRepeatButton();
|
||||
this.m_RightButton = new IMRepeatButton();
|
||||
}
|
||||
|
||||
// Token: 0x17000B82 RID: 2946
|
||||
// (get) Token: 0x060032B9 RID: 12985 RVA: 0x0004D05C File Offset: 0x0004B25C
|
||||
// (set) Token: 0x060032BA RID: 12986 RVA: 0x0004D078 File Offset: 0x0004B278
|
||||
public float value { get; private set; }
|
||||
|
||||
// Token: 0x060032BB RID: 12987 RVA: 0x0004D084 File Offset: 0x0004B284
|
||||
public void SetProperties(Rect pos, float val, float size, float leftValue, float rightValue, GUIStyle slider, GUIStyle thumb, GUIStyle leftButton, GUIStyle rightButton, bool horiz)
|
||||
{
|
||||
base.position = pos;
|
||||
this.m_PageSize = size;
|
||||
this.m_LeftValue = leftValue;
|
||||
this.m_RightValue = rightValue;
|
||||
this.value = val;
|
||||
Rect rect;
|
||||
Rect rect2;
|
||||
Rect rect3;
|
||||
this.GetRects(horiz, base.position, leftButton, rightButton, out rect, out rect2, out rect3);
|
||||
this.m_Slider.SetProperties(rect, this.value, size, leftValue, rightValue, slider, thumb, horiz);
|
||||
this.m_LeftButton.position = rect2;
|
||||
this.m_LeftButton.style = leftButton;
|
||||
this.m_RightButton.position = rect3;
|
||||
this.m_RightButton.style = rightButton;
|
||||
}
|
||||
|
||||
// Token: 0x060032BC RID: 12988 RVA: 0x0004D120 File Offset: 0x0004B320
|
||||
public override void OnReuse()
|
||||
{
|
||||
base.OnReuse();
|
||||
this.m_Slider.OnReuse();
|
||||
this.m_LeftButton.OnReuse();
|
||||
this.m_RightButton.OnReuse();
|
||||
}
|
||||
|
||||
// Token: 0x060032BD RID: 12989 RVA: 0x0004D14C File Offset: 0x0004B34C
|
||||
public override bool OnGUI(Event evt)
|
||||
{
|
||||
bool flag = this.m_Slider.OnGUI(evt);
|
||||
this.value = this.m_Slider.value;
|
||||
bool flag2 = evt.type == EventType.MouseUp;
|
||||
flag |= this.m_LeftButton.OnGUI(evt);
|
||||
if (this.m_LeftButton.isPressed && this.OnScrollerButton(evt))
|
||||
{
|
||||
this.value -= 10f * ((this.m_LeftValue >= this.m_RightValue) ? (-1f) : 1f);
|
||||
}
|
||||
flag |= this.m_RightButton.OnGUI(evt);
|
||||
if (this.m_RightButton.isPressed && this.OnScrollerButton(evt))
|
||||
{
|
||||
this.value += 10f * ((this.m_LeftValue >= this.m_RightValue) ? (-1f) : 1f);
|
||||
}
|
||||
if (flag2 && evt.type == EventType.Used)
|
||||
{
|
||||
IMScroller.s_ScrollControlId = 0;
|
||||
}
|
||||
if (this.m_LeftValue < this.m_RightValue)
|
||||
{
|
||||
this.value = Mathf.Clamp(this.value, this.m_LeftValue, this.m_RightValue - this.m_PageSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.value = Mathf.Clamp(this.value, this.m_RightValue, this.m_LeftValue - this.m_PageSize);
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
evt.Use();
|
||||
}
|
||||
this.m_Slider.value = this.value;
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x060032BE RID: 12990 RVA: 0x0004D2E4 File Offset: 0x0004B4E4
|
||||
protected override int DoGenerateControlID()
|
||||
{
|
||||
this.m_Slider.GenerateControlID();
|
||||
this.m_LeftButton.GenerateControlID();
|
||||
this.m_RightButton.GenerateControlID();
|
||||
return GUIUtility.GetControlID("IMScroller".GetHashCode(), base.focusType, base.position);
|
||||
}
|
||||
|
||||
// Token: 0x060032BF RID: 12991 RVA: 0x0004D338 File Offset: 0x0004B538
|
||||
private void GetRects(bool horiz, Rect pos, GUIStyle leftButton, GUIStyle rightButton, out Rect sliderRect, out Rect minRect, out Rect maxRect)
|
||||
{
|
||||
if (horiz)
|
||||
{
|
||||
sliderRect = new Rect(pos.x + leftButton.fixedWidth, pos.y, pos.width - leftButton.fixedWidth - rightButton.fixedWidth, pos.height);
|
||||
minRect = new Rect(pos.x, pos.y, leftButton.fixedWidth, pos.height);
|
||||
maxRect = new Rect(pos.xMax - rightButton.fixedWidth, pos.y, rightButton.fixedWidth, pos.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
sliderRect = new Rect(pos.x, pos.y + leftButton.fixedHeight, pos.width, pos.height - leftButton.fixedHeight - rightButton.fixedHeight);
|
||||
minRect = new Rect(pos.x, pos.y, pos.width, leftButton.fixedHeight);
|
||||
maxRect = new Rect(pos.x, pos.yMax - rightButton.fixedHeight, pos.width, rightButton.fixedHeight);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060032C0 RID: 12992 RVA: 0x0004D464 File Offset: 0x0004B664
|
||||
private bool OnScrollerButton(Event evt)
|
||||
{
|
||||
bool flag = IMScroller.s_ScrollControlId != this.m_Slider.id;
|
||||
IMScroller.s_ScrollControlId = this.m_Slider.id;
|
||||
bool flag2 = false;
|
||||
if (flag)
|
||||
{
|
||||
flag2 = true;
|
||||
this.m_NextScrollStepTime = DateTime.Now.AddMilliseconds(250.0);
|
||||
}
|
||||
else if (DateTime.Now >= this.m_NextScrollStepTime)
|
||||
{
|
||||
flag2 = true;
|
||||
this.m_NextScrollStepTime = DateTime.Now.AddMilliseconds(30.0);
|
||||
}
|
||||
if (evt.type == EventType.Repaint)
|
||||
{
|
||||
GUI.InternalRepaintEditorWindow();
|
||||
}
|
||||
return flag2;
|
||||
}
|
||||
|
||||
// Token: 0x04000A4B RID: 2635
|
||||
private const float ScrollStepSize = 10f;
|
||||
|
||||
// Token: 0x04000A4C RID: 2636
|
||||
private readonly IMSlider m_Slider;
|
||||
|
||||
// Token: 0x04000A4D RID: 2637
|
||||
private readonly IMRepeatButton m_LeftButton;
|
||||
|
||||
// Token: 0x04000A4E RID: 2638
|
||||
private readonly IMRepeatButton m_RightButton;
|
||||
|
||||
// Token: 0x04000A4F RID: 2639
|
||||
private float m_PageSize;
|
||||
|
||||
// Token: 0x04000A50 RID: 2640
|
||||
private float m_LeftValue;
|
||||
|
||||
// Token: 0x04000A51 RID: 2641
|
||||
private float m_RightValue;
|
||||
|
||||
// Token: 0x04000A52 RID: 2642
|
||||
public DateTime m_NextScrollStepTime = DateTime.Now;
|
||||
|
||||
// Token: 0x04000A53 RID: 2643
|
||||
private static int s_ScrollControlId = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,391 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000328 RID: 808
|
||||
internal class IMSlider : IMElement
|
||||
{
|
||||
// Token: 0x060032D2 RID: 13010 RVA: 0x0004DFA4 File Offset: 0x0004C1A4
|
||||
public IMSlider()
|
||||
{
|
||||
this.nextScrollStepTime = DateTime.Now;
|
||||
this.scrollTroughSide = 0;
|
||||
}
|
||||
|
||||
// Token: 0x17000B86 RID: 2950
|
||||
// (get) Token: 0x060032D3 RID: 13011 RVA: 0x0004DFD8 File Offset: 0x0004C1D8
|
||||
// (set) Token: 0x060032D4 RID: 13012 RVA: 0x0004DFF4 File Offset: 0x0004C1F4
|
||||
public float value { get; set; }
|
||||
|
||||
// Token: 0x17000B87 RID: 2951
|
||||
// (get) Token: 0x060032D5 RID: 13013 RVA: 0x0004E000 File Offset: 0x0004C200
|
||||
// (set) Token: 0x060032D6 RID: 13014 RVA: 0x0004E01C File Offset: 0x0004C21C
|
||||
public DateTime nextScrollStepTime { get; set; }
|
||||
|
||||
// Token: 0x17000B88 RID: 2952
|
||||
// (get) Token: 0x060032D7 RID: 13015 RVA: 0x0004E028 File Offset: 0x0004C228
|
||||
// (set) Token: 0x060032D8 RID: 13016 RVA: 0x0004E044 File Offset: 0x0004C244
|
||||
private int scrollTroughSide { get; set; }
|
||||
|
||||
// Token: 0x060032D9 RID: 13017 RVA: 0x0004E050 File Offset: 0x0004C250
|
||||
public void SetProperties(Rect pos, float val, float pageSize, float start, float end, GUIStyle sliderStyle, GUIStyle thumbStyle, bool horiz)
|
||||
{
|
||||
base.position = pos;
|
||||
this.value = val;
|
||||
this.m_PageSize = pageSize;
|
||||
this.m_Start = start;
|
||||
this.m_End = end;
|
||||
this.m_SliderStyle = sliderStyle;
|
||||
this.m_ThumbStyle = thumbStyle;
|
||||
this.m_Horiz = horiz;
|
||||
}
|
||||
|
||||
// Token: 0x060032DA RID: 13018 RVA: 0x0004E090 File Offset: 0x0004C290
|
||||
public override bool OnGUI(Event evt)
|
||||
{
|
||||
return this.m_SliderStyle != null && this.m_ThumbStyle != null && base.OnGUI(evt);
|
||||
}
|
||||
|
||||
// Token: 0x060032DB RID: 13019 RVA: 0x0004E0CC File Offset: 0x0004C2CC
|
||||
protected override int DoGenerateControlID()
|
||||
{
|
||||
return GUIUtility.GetControlID("IMSlider".GetHashCode(), base.focusType, base.position);
|
||||
}
|
||||
|
||||
// Token: 0x060032DC RID: 13020 RVA: 0x0004E0FC File Offset: 0x0004C2FC
|
||||
protected override bool DoMouseDown(MouseEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (!base.position.Contains(args.mousePosition) || this.IsEmptySlider())
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.scrollTroughSide = 0;
|
||||
GUIUtility.hotControl = base.id;
|
||||
if (this.ThumbSelectionRect().Contains(args.mousePosition))
|
||||
{
|
||||
this.StartDraggingWithValue(this.Clampedvalue(), args.mousePosition);
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
GUI.changed = true;
|
||||
if (this.SupportsPageMovements())
|
||||
{
|
||||
this.SliderState().isDragging = false;
|
||||
this.nextScrollStepTime = SystemClock.now.AddMilliseconds(250.0);
|
||||
this.scrollTroughSide = this.CurrentScrollTroughSide(args.mousePosition);
|
||||
this.value = this.PageMovementValue(args.mousePosition);
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
float num = this.ValueForCurrentMousePosition(args.mousePosition);
|
||||
this.StartDraggingWithValue(num, args.mousePosition);
|
||||
this.value = this.Clamp(num);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x060032DD RID: 13021 RVA: 0x0004E218 File Offset: 0x0004C418
|
||||
protected override bool DoMouseDrag(MouseEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (GUIUtility.hotControl != base.id)
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
SliderState sliderState = this.SliderState();
|
||||
if (!sliderState.isDragging)
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
GUI.changed = true;
|
||||
float num = this.MousePosition(args.mousePosition) - sliderState.dragStartPos;
|
||||
float num2 = sliderState.dragStartValue + num / this.ValuesPerPixel();
|
||||
this.value = this.Clamp(num2);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x060032DE RID: 13022 RVA: 0x0004E298 File Offset: 0x0004C498
|
||||
protected override bool DoMouseUp(MouseEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (GUIUtility.hotControl == base.id)
|
||||
{
|
||||
GUIUtility.hotControl = 0;
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x060032DF RID: 13023 RVA: 0x0004E2CC File Offset: 0x0004C4CC
|
||||
internal override void DoRepaint(IStylePainter args)
|
||||
{
|
||||
this.m_SliderStyle.Draw(base.position, GUIContent.none, base.id);
|
||||
if (!this.IsEmptySlider())
|
||||
{
|
||||
this.m_ThumbStyle.Draw(this.ThumbRect(), GUIContent.none, base.id);
|
||||
}
|
||||
if (GUIUtility.hotControl == base.id && base.position.Contains(args.mousePosition) && !this.IsEmptySlider())
|
||||
{
|
||||
if (this.ThumbRect().Contains(args.mousePosition))
|
||||
{
|
||||
if (this.scrollTroughSide != 0)
|
||||
{
|
||||
GUIUtility.hotControl = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GUI.InternalRepaintEditorWindow();
|
||||
if (!(SystemClock.now < this.nextScrollStepTime))
|
||||
{
|
||||
if (this.CurrentScrollTroughSide(args.mousePosition) == this.scrollTroughSide)
|
||||
{
|
||||
this.nextScrollStepTime = SystemClock.now.AddMilliseconds(30.0);
|
||||
if (this.SupportsPageMovements())
|
||||
{
|
||||
this.SliderState().isDragging = false;
|
||||
GUI.changed = true;
|
||||
this.value = this.PageMovementValue(args.mousePosition);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.value = this.Clampedvalue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060032E0 RID: 13024 RVA: 0x0004E420 File Offset: 0x0004C620
|
||||
private int CurrentScrollTroughSide(Vector2 mousePosition)
|
||||
{
|
||||
float num = ((!this.m_Horiz) ? mousePosition.y : mousePosition.x);
|
||||
float num2 = ((!this.m_Horiz) ? this.ThumbRect().y : this.ThumbRect().x);
|
||||
return (num <= num2) ? (-1) : 1;
|
||||
}
|
||||
|
||||
// Token: 0x060032E1 RID: 13025 RVA: 0x0004E494 File Offset: 0x0004C694
|
||||
private bool IsEmptySlider()
|
||||
{
|
||||
return this.m_Start == this.m_End;
|
||||
}
|
||||
|
||||
// Token: 0x060032E2 RID: 13026 RVA: 0x0004E4B8 File Offset: 0x0004C6B8
|
||||
private bool SupportsPageMovements()
|
||||
{
|
||||
return this.m_PageSize != 0f && GUI.usePageScrollbars;
|
||||
}
|
||||
|
||||
// Token: 0x060032E3 RID: 13027 RVA: 0x0004E4E8 File Offset: 0x0004C6E8
|
||||
private float PageMovementValue(Vector2 currentMousePos)
|
||||
{
|
||||
float num = this.value;
|
||||
int num2 = ((this.m_Start <= this.m_End) ? 1 : (-1));
|
||||
if (this.MousePosition(currentMousePos) > this.PageUpMovementBound())
|
||||
{
|
||||
num += this.m_PageSize * (float)num2 * 0.9f;
|
||||
}
|
||||
else
|
||||
{
|
||||
num -= this.m_PageSize * (float)num2 * 0.9f;
|
||||
}
|
||||
return this.Clamp(num);
|
||||
}
|
||||
|
||||
// Token: 0x060032E4 RID: 13028 RVA: 0x0004E560 File Offset: 0x0004C760
|
||||
private float PageUpMovementBound()
|
||||
{
|
||||
float num;
|
||||
if (this.m_Horiz)
|
||||
{
|
||||
num = this.ThumbRect().xMax - base.position.x;
|
||||
}
|
||||
else
|
||||
{
|
||||
num = this.ThumbRect().yMax - base.position.y;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x060032E5 RID: 13029 RVA: 0x0004E5C4 File Offset: 0x0004C7C4
|
||||
private float ValueForCurrentMousePosition(Vector2 currentMousePos)
|
||||
{
|
||||
float num;
|
||||
if (this.m_Horiz)
|
||||
{
|
||||
num = (this.MousePosition(currentMousePos) - this.ThumbRect().width * 0.5f) / this.ValuesPerPixel() + this.m_Start - this.m_PageSize * 0.5f;
|
||||
}
|
||||
else
|
||||
{
|
||||
num = (this.MousePosition(currentMousePos) - this.ThumbRect().height * 0.5f) / this.ValuesPerPixel() + this.m_Start - this.m_PageSize * 0.5f;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x060032E6 RID: 13030 RVA: 0x0004E658 File Offset: 0x0004C858
|
||||
private float Clamp(float val)
|
||||
{
|
||||
return Mathf.Clamp(val, this.MinValue(), this.MaxValue());
|
||||
}
|
||||
|
||||
// Token: 0x060032E7 RID: 13031 RVA: 0x0004E680 File Offset: 0x0004C880
|
||||
private Rect ThumbSelectionRect()
|
||||
{
|
||||
return this.ThumbRect();
|
||||
}
|
||||
|
||||
// Token: 0x060032E8 RID: 13032 RVA: 0x0004E6A0 File Offset: 0x0004C8A0
|
||||
private void StartDraggingWithValue(float dragStartValue, Vector2 currentMousePos)
|
||||
{
|
||||
SliderState sliderState = this.SliderState();
|
||||
sliderState.dragStartPos = this.MousePosition(currentMousePos);
|
||||
sliderState.dragStartValue = dragStartValue;
|
||||
sliderState.isDragging = true;
|
||||
}
|
||||
|
||||
// Token: 0x060032E9 RID: 13033 RVA: 0x0004E6D0 File Offset: 0x0004C8D0
|
||||
private SliderState SliderState()
|
||||
{
|
||||
return (SliderState)GUIUtility.GetStateObject(typeof(SliderState), base.id);
|
||||
}
|
||||
|
||||
// Token: 0x060032EA RID: 13034 RVA: 0x0004E700 File Offset: 0x0004C900
|
||||
private Rect ThumbRect()
|
||||
{
|
||||
return (!this.m_Horiz) ? this.VerticalThumbRect() : this.HorizontalThumbRect();
|
||||
}
|
||||
|
||||
// Token: 0x060032EB RID: 13035 RVA: 0x0004E734 File Offset: 0x0004C934
|
||||
private Rect VerticalThumbRect()
|
||||
{
|
||||
float num = this.ValuesPerPixel();
|
||||
Rect rect;
|
||||
if (this.m_Start < this.m_End)
|
||||
{
|
||||
rect = new Rect(base.position.x + (float)this.m_SliderStyle.padding.left, (this.Clampedvalue() - this.m_Start) * num + base.position.y + (float)this.m_SliderStyle.padding.top, base.position.width - (float)this.m_SliderStyle.padding.horizontal, this.m_PageSize * num + this.ThumbSize());
|
||||
}
|
||||
else
|
||||
{
|
||||
rect = new Rect(base.position.x + (float)this.m_SliderStyle.padding.left, (this.Clampedvalue() + this.m_PageSize - this.m_Start) * num + base.position.y + (float)this.m_SliderStyle.padding.top, base.position.width - (float)this.m_SliderStyle.padding.horizontal, this.m_PageSize * -num + this.ThumbSize());
|
||||
}
|
||||
return rect;
|
||||
}
|
||||
|
||||
// Token: 0x060032EC RID: 13036 RVA: 0x0004E880 File Offset: 0x0004CA80
|
||||
private Rect HorizontalThumbRect()
|
||||
{
|
||||
float num = this.ValuesPerPixel();
|
||||
Rect rect;
|
||||
if (this.m_Start < this.m_End)
|
||||
{
|
||||
rect = new Rect((this.Clampedvalue() - this.m_Start) * num + base.position.x + (float)this.m_SliderStyle.padding.left, base.position.y + (float)this.m_SliderStyle.padding.top, this.m_PageSize * num + this.ThumbSize(), base.position.height - (float)this.m_SliderStyle.padding.vertical);
|
||||
}
|
||||
else
|
||||
{
|
||||
rect = new Rect((this.Clampedvalue() + this.m_PageSize - this.m_Start) * num + base.position.x + (float)this.m_SliderStyle.padding.left, base.position.y, this.m_PageSize * -num + this.ThumbSize(), base.position.height);
|
||||
}
|
||||
return rect;
|
||||
}
|
||||
|
||||
// Token: 0x060032ED RID: 13037 RVA: 0x0004E9A8 File Offset: 0x0004CBA8
|
||||
private float Clampedvalue()
|
||||
{
|
||||
return this.Clamp(this.value);
|
||||
}
|
||||
|
||||
// Token: 0x060032EE RID: 13038 RVA: 0x0004E9CC File Offset: 0x0004CBCC
|
||||
private float MousePosition(Vector2 currentMousePos)
|
||||
{
|
||||
float num;
|
||||
if (this.m_Horiz)
|
||||
{
|
||||
num = currentMousePos.x - base.position.x;
|
||||
}
|
||||
else
|
||||
{
|
||||
num = currentMousePos.y - base.position.y;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x060032EF RID: 13039 RVA: 0x0004EA20 File Offset: 0x0004CC20
|
||||
private float ValuesPerPixel()
|
||||
{
|
||||
float num;
|
||||
if (this.m_Horiz)
|
||||
{
|
||||
num = (base.position.width - (float)this.m_SliderStyle.padding.horizontal - this.ThumbSize()) / (this.m_End - this.m_Start);
|
||||
}
|
||||
else
|
||||
{
|
||||
num = (base.position.height - (float)this.m_SliderStyle.padding.vertical - this.ThumbSize()) / (this.m_End - this.m_Start);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x060032F0 RID: 13040 RVA: 0x0004EAB0 File Offset: 0x0004CCB0
|
||||
private float ThumbSize()
|
||||
{
|
||||
float num;
|
||||
if (this.m_Horiz)
|
||||
{
|
||||
num = ((this.m_ThumbStyle.fixedWidth == 0f) ? ((float)this.m_ThumbStyle.padding.horizontal) : this.m_ThumbStyle.fixedWidth);
|
||||
}
|
||||
else
|
||||
{
|
||||
num = ((this.m_ThumbStyle.fixedHeight == 0f) ? ((float)this.m_ThumbStyle.padding.vertical) : this.m_ThumbStyle.fixedHeight);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x060032F1 RID: 13041 RVA: 0x0004EB44 File Offset: 0x0004CD44
|
||||
private float MaxValue()
|
||||
{
|
||||
return Mathf.Max(this.m_Start, this.m_End) - this.m_PageSize;
|
||||
}
|
||||
|
||||
// Token: 0x060032F2 RID: 13042 RVA: 0x0004EB74 File Offset: 0x0004CD74
|
||||
private float MinValue()
|
||||
{
|
||||
return Mathf.Min(this.m_Start, this.m_End);
|
||||
}
|
||||
|
||||
// Token: 0x04000A61 RID: 2657
|
||||
private float m_PageSize;
|
||||
|
||||
// Token: 0x04000A62 RID: 2658
|
||||
private float m_Start;
|
||||
|
||||
// Token: 0x04000A63 RID: 2659
|
||||
private float m_End;
|
||||
|
||||
// Token: 0x04000A64 RID: 2660
|
||||
private GUIStyle m_SliderStyle = GUIStyle.none;
|
||||
|
||||
// Token: 0x04000A65 RID: 2661
|
||||
private GUIStyle m_ThumbStyle = GUIStyle.none;
|
||||
|
||||
// Token: 0x04000A66 RID: 2662
|
||||
private bool m_Horiz;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000329 RID: 809
|
||||
internal abstract class IMTextField : IMElement
|
||||
{
|
||||
// Token: 0x17000B89 RID: 2953
|
||||
// (get) Token: 0x060032F4 RID: 13044 RVA: 0x0004EBA4 File Offset: 0x0004CDA4
|
||||
// (set) Token: 0x060032F5 RID: 13045 RVA: 0x0004EBC0 File Offset: 0x0004CDC0
|
||||
public TextEditor editor { get; protected set; }
|
||||
|
||||
// Token: 0x17000B8A RID: 2954
|
||||
// (get) Token: 0x060032F6 RID: 13046 RVA: 0x0004EBCC File Offset: 0x0004CDCC
|
||||
// (set) Token: 0x060032F7 RID: 13047 RVA: 0x0004EBE8 File Offset: 0x0004CDE8
|
||||
public int maxLength { get; set; }
|
||||
|
||||
// Token: 0x17000B8B RID: 2955
|
||||
// (get) Token: 0x060032F8 RID: 13048 RVA: 0x0004EBF4 File Offset: 0x0004CDF4
|
||||
// (set) Token: 0x060032F9 RID: 13049 RVA: 0x0004EC10 File Offset: 0x0004CE10
|
||||
public bool multiline { get; set; }
|
||||
|
||||
// Token: 0x060032FA RID: 13050 RVA: 0x0004EC1C File Offset: 0x0004CE1C
|
||||
protected override int DoGenerateControlID()
|
||||
{
|
||||
return GUIUtility.GetControlID("IMTextField".GetHashCode(), base.focusType, base.position);
|
||||
}
|
||||
|
||||
// Token: 0x060032FB RID: 13051 RVA: 0x0004EC4C File Offset: 0x0004CE4C
|
||||
protected void SyncTextEditor()
|
||||
{
|
||||
if (this.maxLength >= 0 && base.text != null && base.text.Length > this.maxLength)
|
||||
{
|
||||
base.text = base.text.Substring(0, this.maxLength);
|
||||
}
|
||||
this.editor = (TextEditor)GUIUtility.GetStateObject(typeof(TextEditor), base.id);
|
||||
this.editor.text = base.text;
|
||||
this.editor.SaveBackup();
|
||||
this.editor.position = base.position;
|
||||
this.editor.style = base.style;
|
||||
this.editor.multiline = this.multiline;
|
||||
this.editor.controlID = base.id;
|
||||
this.editor.DetectFocusChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200032C RID: 812
|
||||
internal class IMToggle : IMElement
|
||||
{
|
||||
// Token: 0x0600330D RID: 13069 RVA: 0x0004F558 File Offset: 0x0004D758
|
||||
public IMToggle()
|
||||
{
|
||||
base.focusType = FocusType.Passive;
|
||||
}
|
||||
|
||||
// Token: 0x17000B8E RID: 2958
|
||||
// (get) Token: 0x0600330E RID: 13070 RVA: 0x0004F568 File Offset: 0x0004D768
|
||||
// (set) Token: 0x0600330F RID: 13071 RVA: 0x0004F584 File Offset: 0x0004D784
|
||||
public bool value { get; set; }
|
||||
|
||||
// Token: 0x06003310 RID: 13072 RVA: 0x0004F590 File Offset: 0x0004D790
|
||||
public void ForceIdValue(int newId)
|
||||
{
|
||||
base.id = newId;
|
||||
}
|
||||
|
||||
// Token: 0x06003311 RID: 13073 RVA: 0x0004F59C File Offset: 0x0004D79C
|
||||
protected override int DoGenerateControlID()
|
||||
{
|
||||
return GUIUtility.GetControlID("IMToggle".GetHashCode(), base.focusType, base.position);
|
||||
}
|
||||
|
||||
// Token: 0x06003312 RID: 13074 RVA: 0x0004F5CC File Offset: 0x0004D7CC
|
||||
internal override void DoRepaint(IStylePainter args)
|
||||
{
|
||||
base.style.Draw(base.position, GUIContent.Temp(base.text), base.id, this.value);
|
||||
}
|
||||
|
||||
// Token: 0x06003313 RID: 13075 RVA: 0x0004F5F8 File Offset: 0x0004D7F8
|
||||
protected override bool DoMouseDown(MouseEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (base.position.Contains(args.mousePosition))
|
||||
{
|
||||
GUIUtility.hotControl = base.id;
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06003314 RID: 13076 RVA: 0x0004F63C File Offset: 0x0004D83C
|
||||
protected override bool DoMouseUp(MouseEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (GUIUtility.hotControl == base.id)
|
||||
{
|
||||
GUIUtility.hotControl = 0;
|
||||
if (base.position.Contains(args.mousePosition))
|
||||
{
|
||||
GUIUtility.SetChanged(true);
|
||||
this.value = !this.value;
|
||||
}
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06003315 RID: 13077 RVA: 0x0004F6A4 File Offset: 0x0004D8A4
|
||||
protected override bool DoKeyDown(KeyboardEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (args.character == ' ' && GUIUtility.keyboardControl == base.id)
|
||||
{
|
||||
GUIUtility.SetChanged(true);
|
||||
this.value = !this.value;
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06003316 RID: 13078 RVA: 0x0004F6F8 File Offset: 0x0004D8F8
|
||||
protected override bool DoMouseDrag(MouseEventArgs args)
|
||||
{
|
||||
return GUIUtility.hotControl == base.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200032B RID: 811
|
||||
internal class IMTouchScreenTextField : IMTextField
|
||||
{
|
||||
// Token: 0x06003303 RID: 13059 RVA: 0x0004F208 File Offset: 0x0004D408
|
||||
public IMTouchScreenTextField()
|
||||
{
|
||||
this.secureText = string.Empty;
|
||||
this.maskChar = '\0';
|
||||
}
|
||||
|
||||
// Token: 0x17000B8C RID: 2956
|
||||
// (get) Token: 0x06003304 RID: 13060 RVA: 0x0004F224 File Offset: 0x0004D424
|
||||
// (set) Token: 0x06003305 RID: 13061 RVA: 0x0004F240 File Offset: 0x0004D440
|
||||
public string secureText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_SecureText;
|
||||
}
|
||||
set
|
||||
{
|
||||
string text = value ?? string.Empty;
|
||||
if (text != this.m_SecureText)
|
||||
{
|
||||
this.m_SecureText = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000B8D RID: 2957
|
||||
// (get) Token: 0x06003306 RID: 13062 RVA: 0x0004F278 File Offset: 0x0004D478
|
||||
// (set) Token: 0x06003307 RID: 13063 RVA: 0x0004F294 File Offset: 0x0004D494
|
||||
public char maskChar
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_MaskChar;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this.m_MaskChar != value)
|
||||
{
|
||||
this.m_MaskChar = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003308 RID: 13064 RVA: 0x0004F2AC File Offset: 0x0004D4AC
|
||||
public override bool OnGUI(Event evt)
|
||||
{
|
||||
base.SyncTextEditor();
|
||||
bool flag = false;
|
||||
EventType type = evt.type;
|
||||
if (type != EventType.MouseDown)
|
||||
{
|
||||
if (type == EventType.Repaint)
|
||||
{
|
||||
this.DoRepaint(new StylePainter(evt.mousePosition));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = this.DoMouseDown(new MouseEventArgs(evt.mousePosition, evt.clickCount, evt.modifiers));
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
evt.Use();
|
||||
}
|
||||
base.editor.UpdateScrollOffsetIfNeeded(evt);
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06003309 RID: 13065 RVA: 0x0004F338 File Offset: 0x0004D538
|
||||
protected override int DoGenerateControlID()
|
||||
{
|
||||
return GUIUtility.GetControlID("TouchScreenTextField".GetHashCode(), base.focusType, base.position);
|
||||
}
|
||||
|
||||
// Token: 0x0600330A RID: 13066 RVA: 0x0004F368 File Offset: 0x0004D568
|
||||
internal override void DoRepaint(IStylePainter args)
|
||||
{
|
||||
if (base.editor.keyboardOnScreen != null)
|
||||
{
|
||||
base.text = base.editor.keyboardOnScreen.text;
|
||||
if (base.maxLength >= 0 && base.text != null && base.text.Length > base.maxLength)
|
||||
{
|
||||
base.text = base.text.Substring(0, base.maxLength);
|
||||
}
|
||||
if (base.editor.keyboardOnScreen.done)
|
||||
{
|
||||
base.editor.keyboardOnScreen = null;
|
||||
GUI.changed = true;
|
||||
}
|
||||
}
|
||||
string text = base.text;
|
||||
if (!string.IsNullOrEmpty(this.secureText))
|
||||
{
|
||||
base.text = GUI.PasswordFieldGetStrToShow(text, this.maskChar);
|
||||
}
|
||||
base.style.Draw(base.position, GUIContent.Temp(base.text), base.id, false);
|
||||
base.text = text;
|
||||
}
|
||||
|
||||
// Token: 0x0600330B RID: 13067 RVA: 0x0004F460 File Offset: 0x0004D660
|
||||
protected override bool DoMouseDown(MouseEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (base.position.Contains(args.mousePosition))
|
||||
{
|
||||
GUIUtility.hotControl = base.id;
|
||||
if (IMTouchScreenTextField.s_HotTextField != -1 && IMTouchScreenTextField.s_HotTextField != base.id)
|
||||
{
|
||||
TextEditor textEditor = (TextEditor)GUIUtility.GetStateObject(typeof(TextEditor), IMTouchScreenTextField.s_HotTextField);
|
||||
textEditor.keyboardOnScreen = null;
|
||||
}
|
||||
IMTouchScreenTextField.s_HotTextField = base.id;
|
||||
if (GUIUtility.keyboardControl != base.id)
|
||||
{
|
||||
GUIUtility.keyboardControl = base.id;
|
||||
}
|
||||
base.editor.keyboardOnScreen = TouchScreenKeyboard.Open(string.IsNullOrEmpty(this.secureText) ? base.text : this.secureText, TouchScreenKeyboardType.Default, true, base.multiline, !string.IsNullOrEmpty(this.secureText));
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x04000A6D RID: 2669
|
||||
private static int s_HotTextField = -1;
|
||||
|
||||
// Token: 0x04000A6E RID: 2670
|
||||
private string m_SecureText;
|
||||
|
||||
// Token: 0x04000A6F RID: 2671
|
||||
private char m_MaskChar;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200032F RID: 815
|
||||
public interface IManipulator : IEventHandler
|
||||
{
|
||||
// Token: 0x17000B8F RID: 2959
|
||||
// (get) Token: 0x0600331B RID: 13083
|
||||
// (set) Token: 0x0600331C RID: 13084
|
||||
VisualElement target { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000320 RID: 800
|
||||
internal interface IOnGUIHandler : IRecyclable
|
||||
{
|
||||
// Token: 0x17000B77 RID: 2935
|
||||
// (get) Token: 0x0600327F RID: 12927
|
||||
int id { get; }
|
||||
|
||||
// Token: 0x06003280 RID: 12928
|
||||
bool OnGUI(Event evt);
|
||||
|
||||
// Token: 0x06003281 RID: 12929
|
||||
void GenerateControlID();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000335 RID: 821
|
||||
public interface IPanel
|
||||
{
|
||||
// Token: 0x17000B94 RID: 2964
|
||||
// (get) Token: 0x0600332B RID: 13099
|
||||
VisualContainer visualTree { get; }
|
||||
|
||||
// Token: 0x17000B95 RID: 2965
|
||||
// (get) Token: 0x0600332C RID: 13100
|
||||
IDispatcher dispatcher { get; }
|
||||
|
||||
// Token: 0x17000B96 RID: 2966
|
||||
// (get) Token: 0x0600332D RID: 13101
|
||||
IScheduler scheduler { get; }
|
||||
|
||||
// Token: 0x17000B97 RID: 2967
|
||||
// (get) Token: 0x0600332E RID: 13102
|
||||
IDataWatchService dataWatch { get; }
|
||||
|
||||
// Token: 0x17000B98 RID: 2968
|
||||
// (get) Token: 0x0600332F RID: 13103
|
||||
ContextType contextType { get; }
|
||||
|
||||
// Token: 0x06003330 RID: 13104
|
||||
VisualElement Pick(Vector2 point);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200033A RID: 826
|
||||
internal interface IRecyclable
|
||||
{
|
||||
// Token: 0x17000BB1 RID: 2993
|
||||
// (get) Token: 0x0600336D RID: 13165
|
||||
// (set) Token: 0x0600336E RID: 13166
|
||||
bool isTrashed { get; set; }
|
||||
|
||||
// Token: 0x0600336F RID: 13167
|
||||
void OnTrash();
|
||||
|
||||
// Token: 0x06003370 RID: 13168
|
||||
void OnReuse();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000340 RID: 832
|
||||
public interface IScheduler
|
||||
{
|
||||
// Token: 0x0600338C RID: 13196
|
||||
ScheduleBuilder Schedule(Action<TimerState> timerUpdateEvent, IEventHandler hanlder);
|
||||
|
||||
// Token: 0x0600338D RID: 13197
|
||||
void Unschedule(Action<TimerState> timerUpdateEvent);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000319 RID: 793
|
||||
public class Image : VisualElement
|
||||
{
|
||||
// Token: 0x06003236 RID: 12854 RVA: 0x0004B18C File Offset: 0x0004938C
|
||||
public Image()
|
||||
{
|
||||
this.scaleMode = ScaleMode.ScaleAndCrop;
|
||||
}
|
||||
|
||||
// Token: 0x17000B65 RID: 2917
|
||||
// (get) Token: 0x06003237 RID: 12855 RVA: 0x0004B19C File Offset: 0x0004939C
|
||||
// (set) Token: 0x06003238 RID: 12856 RVA: 0x0004B1B8 File Offset: 0x000493B8
|
||||
public Texture image { get; set; }
|
||||
|
||||
// Token: 0x17000B66 RID: 2918
|
||||
// (get) Token: 0x06003239 RID: 12857 RVA: 0x0004B1C4 File Offset: 0x000493C4
|
||||
// (set) Token: 0x0600323A RID: 12858 RVA: 0x0004B1E0 File Offset: 0x000493E0
|
||||
public ScaleMode scaleMode { get; set; }
|
||||
|
||||
// Token: 0x0600323B RID: 12859 RVA: 0x0004B1EC File Offset: 0x000493EC
|
||||
internal override void DoRepaint(IStylePainter painter)
|
||||
{
|
||||
if (this.image == null)
|
||||
{
|
||||
Debug.LogWarning("null texture passed to GUI.DrawTexture");
|
||||
}
|
||||
else
|
||||
{
|
||||
painter.DrawTexture(base.contentRect, this.image, GUI.color, this.scaleMode, 0f, 0f, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000310 RID: 784
|
||||
internal struct KeyboardEventArgs
|
||||
{
|
||||
// Token: 0x0600320E RID: 12814 RVA: 0x0004A744 File Offset: 0x00048944
|
||||
public KeyboardEventArgs(char character, KeyCode keyCode, EventModifiers modifiers)
|
||||
{
|
||||
this = default(KeyboardEventArgs);
|
||||
this.character = character;
|
||||
this.keyCode = keyCode;
|
||||
this.m_Modifiers = modifiers;
|
||||
}
|
||||
|
||||
// Token: 0x17000B5A RID: 2906
|
||||
// (get) Token: 0x0600320F RID: 12815 RVA: 0x0004A764 File Offset: 0x00048964
|
||||
// (set) Token: 0x06003210 RID: 12816 RVA: 0x0004A780 File Offset: 0x00048980
|
||||
public char character { get; private set; }
|
||||
|
||||
// Token: 0x17000B5B RID: 2907
|
||||
// (get) Token: 0x06003211 RID: 12817 RVA: 0x0004A78C File Offset: 0x0004898C
|
||||
// (set) Token: 0x06003212 RID: 12818 RVA: 0x0004A7A8 File Offset: 0x000489A8
|
||||
public KeyCode keyCode { get; private set; }
|
||||
|
||||
// Token: 0x17000B5C RID: 2908
|
||||
// (get) Token: 0x06003213 RID: 12819 RVA: 0x0004A7B4 File Offset: 0x000489B4
|
||||
public bool shift
|
||||
{
|
||||
get
|
||||
{
|
||||
return (this.m_Modifiers & EventModifiers.Shift) != EventModifiers.None;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000B5D RID: 2909
|
||||
// (get) Token: 0x06003214 RID: 12820 RVA: 0x0004A7D8 File Offset: 0x000489D8
|
||||
public bool alt
|
||||
{
|
||||
get
|
||||
{
|
||||
return (this.m_Modifiers & EventModifiers.Alt) != EventModifiers.None;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003215 RID: 12821 RVA: 0x0004A7FC File Offset: 0x000489FC
|
||||
public Event ToEvent()
|
||||
{
|
||||
return new Event
|
||||
{
|
||||
character = this.character,
|
||||
keyCode = this.keyCode,
|
||||
modifiers = this.m_Modifiers,
|
||||
type = EventType.KeyDown
|
||||
};
|
||||
}
|
||||
|
||||
// Token: 0x04000A1A RID: 2586
|
||||
private readonly EventModifiers m_Modifiers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,372 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000352 RID: 850
|
||||
internal class KeyboardTextEditor : TextEditor
|
||||
{
|
||||
// Token: 0x06003404 RID: 13316 RVA: 0x00052DFC File Offset: 0x00050FFC
|
||||
public KeyboardTextEditor(TextField textField)
|
||||
: base(textField)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06003405 RID: 13317 RVA: 0x00052E14 File Offset: 0x00051014
|
||||
public override EventPropagation HandleEvent(Event evt, VisualElement finalTarget)
|
||||
{
|
||||
base.SyncTextEditor();
|
||||
this.m_Changed = false;
|
||||
EventPropagation eventPropagation = EventPropagation.Continue;
|
||||
EventType type = evt.type;
|
||||
switch (type)
|
||||
{
|
||||
case EventType.MouseDown:
|
||||
eventPropagation = this.DoMouseDown(evt);
|
||||
break;
|
||||
case EventType.MouseUp:
|
||||
eventPropagation = this.DoMouseUp(evt);
|
||||
break;
|
||||
default:
|
||||
if (type != EventType.ValidateCommand)
|
||||
{
|
||||
if (type == EventType.ExecuteCommand)
|
||||
{
|
||||
eventPropagation = this.DoExecuteCommand(evt);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
eventPropagation = this.DoValidateCommand(evt);
|
||||
}
|
||||
break;
|
||||
case EventType.MouseDrag:
|
||||
eventPropagation = this.DoMouseDrag(evt);
|
||||
break;
|
||||
case EventType.KeyDown:
|
||||
eventPropagation = this.DoKeyDown(evt);
|
||||
break;
|
||||
}
|
||||
if (this.m_Changed)
|
||||
{
|
||||
if (base.maxLength >= 0 && base.text != null && base.text.Length > base.maxLength)
|
||||
{
|
||||
base.text = base.text.Substring(0, base.maxLength);
|
||||
}
|
||||
base.textField.text = base.text;
|
||||
eventPropagation = EventPropagation.Stop;
|
||||
}
|
||||
base.UpdateScrollOffset();
|
||||
return eventPropagation;
|
||||
}
|
||||
|
||||
// Token: 0x06003406 RID: 13318 RVA: 0x00052F28 File Offset: 0x00051128
|
||||
private EventPropagation DoMouseDown(Event evt)
|
||||
{
|
||||
this.TakeCapture();
|
||||
EventPropagation eventPropagation;
|
||||
if (!this.m_HasFocus)
|
||||
{
|
||||
this.m_HasFocus = true;
|
||||
base.MoveCursorToPosition_Internal(evt.mousePosition, evt.shift);
|
||||
eventPropagation = EventPropagation.Stop;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (evt.clickCount == 2 && base.doubleClickSelectsWord)
|
||||
{
|
||||
base.SelectCurrentWord();
|
||||
base.DblClickSnap(TextEditor.DblClickSnapping.WORDS);
|
||||
base.MouseDragSelectsWholeWords(true);
|
||||
this.m_DragToPosition = false;
|
||||
}
|
||||
else if (evt.clickCount == 3 && base.tripleClickSelectsLine)
|
||||
{
|
||||
base.SelectCurrentParagraph();
|
||||
base.MouseDragSelectsWholeWords(true);
|
||||
base.DblClickSnap(TextEditor.DblClickSnapping.PARAGRAPHS);
|
||||
this.m_DragToPosition = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
base.MoveCursorToPosition_Internal(evt.mousePosition, evt.shift);
|
||||
this.m_SelectAllOnMouseUp = false;
|
||||
}
|
||||
eventPropagation = EventPropagation.Stop;
|
||||
}
|
||||
return eventPropagation;
|
||||
}
|
||||
|
||||
// Token: 0x06003407 RID: 13319 RVA: 0x00053000 File Offset: 0x00051200
|
||||
private EventPropagation DoMouseUp(Event evt)
|
||||
{
|
||||
EventPropagation eventPropagation;
|
||||
if (!this.HasCapture())
|
||||
{
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.m_Dragged && this.m_DragToPosition)
|
||||
{
|
||||
base.MoveSelectionToAltCursor();
|
||||
}
|
||||
else if (this.m_PostPoneMove)
|
||||
{
|
||||
base.MoveCursorToPosition_Internal(evt.mousePosition, evt.shift);
|
||||
}
|
||||
else if (this.m_SelectAllOnMouseUp)
|
||||
{
|
||||
this.m_SelectAllOnMouseUp = false;
|
||||
}
|
||||
base.MouseDragSelectsWholeWords(false);
|
||||
this.ReleaseCapture();
|
||||
this.m_DragToPosition = true;
|
||||
this.m_Dragged = false;
|
||||
this.m_PostPoneMove = false;
|
||||
eventPropagation = EventPropagation.Stop;
|
||||
}
|
||||
return eventPropagation;
|
||||
}
|
||||
|
||||
// Token: 0x06003408 RID: 13320 RVA: 0x000530A8 File Offset: 0x000512A8
|
||||
private EventPropagation DoMouseDrag(Event evt)
|
||||
{
|
||||
EventPropagation eventPropagation;
|
||||
if (!this.HasCapture())
|
||||
{
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!evt.shift && base.hasSelection && this.m_DragToPosition)
|
||||
{
|
||||
base.MoveAltCursorToPosition(Event.current.mousePosition);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (evt.shift)
|
||||
{
|
||||
base.MoveCursorToPosition_Internal(evt.mousePosition, evt.shift);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.SelectToPosition(evt.mousePosition);
|
||||
}
|
||||
this.m_DragToPosition = false;
|
||||
this.m_SelectAllOnMouseUp = !base.hasSelection;
|
||||
}
|
||||
this.m_Dragged = true;
|
||||
eventPropagation = EventPropagation.Stop;
|
||||
}
|
||||
return eventPropagation;
|
||||
}
|
||||
|
||||
// Token: 0x06003409 RID: 13321 RVA: 0x0005315C File Offset: 0x0005135C
|
||||
private EventPropagation DoKeyDown(Event evt)
|
||||
{
|
||||
EventPropagation eventPropagation;
|
||||
if (!base.textField.hasFocus)
|
||||
{
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
else if (base.HandleKeyEvent(evt))
|
||||
{
|
||||
this.m_Changed = true;
|
||||
base.textField.text = base.text;
|
||||
eventPropagation = EventPropagation.Stop;
|
||||
}
|
||||
else if (evt.keyCode == KeyCode.Tab || evt.character == '\t')
|
||||
{
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
char character = evt.character;
|
||||
if (character == '\n' && !this.multiline && !evt.alt)
|
||||
{
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
else if ((base.textField.font != null && base.textField.font.HasCharacter(character)) || character == '\n')
|
||||
{
|
||||
base.Insert(character);
|
||||
this.m_Changed = true;
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
else if (character == '\0')
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Input.compositionString))
|
||||
{
|
||||
base.ReplaceSelection("");
|
||||
this.m_Changed = true;
|
||||
}
|
||||
eventPropagation = EventPropagation.Stop;
|
||||
}
|
||||
else
|
||||
{
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
}
|
||||
return eventPropagation;
|
||||
}
|
||||
|
||||
// Token: 0x0600340A RID: 13322 RVA: 0x00053280 File Offset: 0x00051480
|
||||
private EventPropagation DoValidateCommand(Event evt)
|
||||
{
|
||||
EventPropagation eventPropagation;
|
||||
if (!base.textField.hasFocus)
|
||||
{
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
string commandName = evt.commandName;
|
||||
if (commandName != null)
|
||||
{
|
||||
if (!(commandName == "Cut") && !(commandName == "Copy"))
|
||||
{
|
||||
if (!(commandName == "Paste"))
|
||||
{
|
||||
if (!(commandName == "SelectAll") && !(commandName == "Delete"))
|
||||
{
|
||||
if (!(commandName == "UndoRedoPerformed"))
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!base.CanPaste())
|
||||
{
|
||||
return EventPropagation.Continue;
|
||||
}
|
||||
}
|
||||
else if (!base.hasSelection)
|
||||
{
|
||||
return EventPropagation.Continue;
|
||||
}
|
||||
}
|
||||
eventPropagation = EventPropagation.Stop;
|
||||
}
|
||||
return eventPropagation;
|
||||
}
|
||||
|
||||
// Token: 0x0600340B RID: 13323 RVA: 0x00053358 File Offset: 0x00051558
|
||||
private EventPropagation DoExecuteCommand(Event evt)
|
||||
{
|
||||
bool flag = false;
|
||||
string text = base.text;
|
||||
EventPropagation eventPropagation;
|
||||
if (!base.textField.hasFocus)
|
||||
{
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
string commandName = evt.commandName;
|
||||
if (commandName != null)
|
||||
{
|
||||
if (commandName == "OnLostFocus")
|
||||
{
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
if (!(commandName == "Cut"))
|
||||
{
|
||||
if (commandName == "Copy")
|
||||
{
|
||||
base.Copy();
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
if (!(commandName == "Paste"))
|
||||
{
|
||||
if (commandName == "SelectAll")
|
||||
{
|
||||
base.SelectAll();
|
||||
return EventPropagation.Stop;
|
||||
}
|
||||
if (commandName == "Delete")
|
||||
{
|
||||
if (SystemInfo.operatingSystemFamily == OperatingSystemFamily.MacOSX)
|
||||
{
|
||||
base.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Cut();
|
||||
}
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Paste();
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Cut();
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
if (text != base.text)
|
||||
{
|
||||
this.m_Changed = true;
|
||||
}
|
||||
eventPropagation = EventPropagation.Stop;
|
||||
}
|
||||
else
|
||||
{
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
}
|
||||
return eventPropagation;
|
||||
}
|
||||
|
||||
// Token: 0x0600340C RID: 13324 RVA: 0x00053488 File Offset: 0x00051688
|
||||
public void PreDrawCursor(string newText)
|
||||
{
|
||||
base.SyncTextEditor();
|
||||
this.m_PreDrawCursorText = base.text;
|
||||
int num = base.cursorIndex;
|
||||
if (!string.IsNullOrEmpty(Input.compositionString))
|
||||
{
|
||||
base.text = newText.Substring(0, base.cursorIndex) + Input.compositionString + newText.Substring(base.selectIndex);
|
||||
num += Input.compositionString.Length;
|
||||
}
|
||||
else
|
||||
{
|
||||
base.text = newText;
|
||||
}
|
||||
if (base.maxLength >= 0 && base.text != null && base.text.Length > base.maxLength)
|
||||
{
|
||||
base.text = base.text.Substring(0, base.maxLength);
|
||||
num = Math.Min(num, base.maxLength - 1);
|
||||
}
|
||||
this.graphicalCursorPos = this.style.GetCursorPixelPosition(this.localPosition, new GUIContent(base.text), num);
|
||||
}
|
||||
|
||||
// Token: 0x0600340D RID: 13325 RVA: 0x00053580 File Offset: 0x00051780
|
||||
public void PostDrawCursor()
|
||||
{
|
||||
base.text = this.m_PreDrawCursorText;
|
||||
}
|
||||
|
||||
// Token: 0x04000AF8 RID: 2808
|
||||
internal bool m_Changed;
|
||||
|
||||
// Token: 0x04000AF9 RID: 2809
|
||||
private bool m_Dragged;
|
||||
|
||||
// Token: 0x04000AFA RID: 2810
|
||||
private bool m_DragToPosition = true;
|
||||
|
||||
// Token: 0x04000AFB RID: 2811
|
||||
private bool m_PostPoneMove;
|
||||
|
||||
// Token: 0x04000AFC RID: 2812
|
||||
private bool m_SelectAllOnMouseUp = true;
|
||||
|
||||
// Token: 0x04000AFD RID: 2813
|
||||
private string m_PreDrawCursorText;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200032D RID: 813
|
||||
public class Label : VisualElement
|
||||
{
|
||||
// Token: 0x06003317 RID: 13079 RVA: 0x0004F728 File Offset: 0x0004D928
|
||||
public Label()
|
||||
: this(string.Empty)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06003318 RID: 13080 RVA: 0x0004F738 File Offset: 0x0004D938
|
||||
public Label(string text)
|
||||
{
|
||||
base.text = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000337 RID: 823
|
||||
// (Invoke) Token: 0x0600334A RID: 13130
|
||||
internal delegate Object LoadResourceFunction(string pathName, Type type);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000330 RID: 816
|
||||
public class Manipulator : IManipulator, IEventHandler
|
||||
{
|
||||
// Token: 0x0600331D RID: 13085 RVA: 0x0004F870 File Offset: 0x0004DA70
|
||||
public Manipulator()
|
||||
{
|
||||
this.phaseInterest = EventPhase.BubbleUp;
|
||||
}
|
||||
|
||||
// Token: 0x17000B90 RID: 2960
|
||||
// (get) Token: 0x0600331E RID: 13086 RVA: 0x0004F880 File Offset: 0x0004DA80
|
||||
// (set) Token: 0x0600331F RID: 13087 RVA: 0x0004F89C File Offset: 0x0004DA9C
|
||||
public VisualElement target { get; set; }
|
||||
|
||||
// Token: 0x17000B91 RID: 2961
|
||||
// (get) Token: 0x06003320 RID: 13088 RVA: 0x0004F8A8 File Offset: 0x0004DAA8
|
||||
// (set) Token: 0x06003321 RID: 13089 RVA: 0x0004F8C4 File Offset: 0x0004DAC4
|
||||
public EventPhase phaseInterest { get; set; }
|
||||
|
||||
// Token: 0x17000B92 RID: 2962
|
||||
// (get) Token: 0x06003322 RID: 13090 RVA: 0x0004F8D0 File Offset: 0x0004DAD0
|
||||
public IPanel panel
|
||||
{
|
||||
get
|
||||
{
|
||||
IPanel panel;
|
||||
if (this.target != null)
|
||||
{
|
||||
panel = this.target.panel;
|
||||
}
|
||||
else
|
||||
{
|
||||
panel = null;
|
||||
}
|
||||
return panel;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003323 RID: 13091 RVA: 0x0004F904 File Offset: 0x0004DB04
|
||||
public virtual EventPropagation HandleEvent(Event evt, VisualElement finalTarget)
|
||||
{
|
||||
return EventPropagation.Continue;
|
||||
}
|
||||
|
||||
// Token: 0x06003324 RID: 13092 RVA: 0x0004F91C File Offset: 0x0004DB1C
|
||||
public virtual void OnLostCapture()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06003325 RID: 13093 RVA: 0x0004F920 File Offset: 0x0004DB20
|
||||
public virtual void OnLostKeyboardFocus()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200032E RID: 814
|
||||
public struct ManipulatorActivationFilter
|
||||
{
|
||||
// Token: 0x06003319 RID: 13081 RVA: 0x0004F748 File Offset: 0x0004D948
|
||||
public bool Matches(Event evt)
|
||||
{
|
||||
return this.button == (MouseButton)evt.button && this.HasModifiers(evt);
|
||||
}
|
||||
|
||||
// Token: 0x0600331A RID: 13082 RVA: 0x0004F778 File Offset: 0x0004D978
|
||||
private bool HasModifiers(Event evt)
|
||||
{
|
||||
return ((this.modifiers & EventModifiers.Alt) == EventModifiers.None || evt.alt) && ((this.modifiers & EventModifiers.Alt) != EventModifiers.None || !evt.alt) && ((this.modifiers & EventModifiers.Control) == EventModifiers.None || evt.control) && ((this.modifiers & EventModifiers.Control) != EventModifiers.None || !evt.control) && ((this.modifiers & EventModifiers.Shift) == EventModifiers.None || evt.shift) && ((this.modifiers & EventModifiers.Shift) != EventModifiers.None || !evt.shift) && ((this.modifiers & EventModifiers.Command) == EventModifiers.None || evt.command) && ((this.modifiers & EventModifiers.Command) != EventModifiers.None || !evt.command);
|
||||
}
|
||||
|
||||
// Token: 0x04000A71 RID: 2673
|
||||
public MouseButton button;
|
||||
|
||||
// Token: 0x04000A72 RID: 2674
|
||||
public EventModifiers modifiers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000331 RID: 817
|
||||
[Flags]
|
||||
public enum MouseButton
|
||||
{
|
||||
// Token: 0x04000A76 RID: 2678
|
||||
LeftMouse = 0,
|
||||
// Token: 0x04000A77 RID: 2679
|
||||
RightMouse = 1,
|
||||
// Token: 0x04000A78 RID: 2680
|
||||
MiddleMouse = 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200030F RID: 783
|
||||
internal struct MouseEventArgs
|
||||
{
|
||||
// Token: 0x06003208 RID: 12808 RVA: 0x0004A6B0 File Offset: 0x000488B0
|
||||
public MouseEventArgs(Vector2 pos, int clickCount, EventModifiers modifiers)
|
||||
{
|
||||
this = default(MouseEventArgs);
|
||||
this.mousePosition = pos;
|
||||
this.clickCount = clickCount;
|
||||
this.m_Modifiers = modifiers;
|
||||
}
|
||||
|
||||
// Token: 0x17000B57 RID: 2903
|
||||
// (get) Token: 0x06003209 RID: 12809 RVA: 0x0004A6D0 File Offset: 0x000488D0
|
||||
// (set) Token: 0x0600320A RID: 12810 RVA: 0x0004A6EC File Offset: 0x000488EC
|
||||
public Vector2 mousePosition { get; private set; }
|
||||
|
||||
// Token: 0x17000B58 RID: 2904
|
||||
// (get) Token: 0x0600320B RID: 12811 RVA: 0x0004A6F8 File Offset: 0x000488F8
|
||||
// (set) Token: 0x0600320C RID: 12812 RVA: 0x0004A714 File Offset: 0x00048914
|
||||
public int clickCount { get; private set; }
|
||||
|
||||
// Token: 0x17000B59 RID: 2905
|
||||
// (get) Token: 0x0600320D RID: 12813 RVA: 0x0004A720 File Offset: 0x00048920
|
||||
public bool shift
|
||||
{
|
||||
get
|
||||
{
|
||||
return (this.m_Modifiers & EventModifiers.Shift) != EventModifiers.None;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000A17 RID: 2583
|
||||
private readonly EventModifiers m_Modifiers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000332 RID: 818
|
||||
public class MouseManipulator : Manipulator
|
||||
{
|
||||
// Token: 0x06003326 RID: 13094 RVA: 0x0004F924 File Offset: 0x0004DB24
|
||||
public MouseManipulator()
|
||||
{
|
||||
this.activators = new List<ManipulatorActivationFilter>();
|
||||
}
|
||||
|
||||
// Token: 0x17000B93 RID: 2963
|
||||
// (get) Token: 0x06003327 RID: 13095 RVA: 0x0004F938 File Offset: 0x0004DB38
|
||||
// (set) Token: 0x06003328 RID: 13096 RVA: 0x0004F954 File Offset: 0x0004DB54
|
||||
public List<ManipulatorActivationFilter> activators { get; private set; }
|
||||
|
||||
// Token: 0x06003329 RID: 13097 RVA: 0x0004F960 File Offset: 0x0004DB60
|
||||
protected bool CanStartManipulation(Event evt)
|
||||
{
|
||||
foreach (ManipulatorActivationFilter manipulatorActivationFilter in this.activators)
|
||||
{
|
||||
if (manipulatorActivationFilter.Matches(evt))
|
||||
{
|
||||
this.m_currentActivator = manipulatorActivationFilter;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x0600332A RID: 13098 RVA: 0x0004F9E0 File Offset: 0x0004DBE0
|
||||
protected bool CanStopManipulation(Event evt)
|
||||
{
|
||||
return evt.button == (int)this.m_currentActivator.button && this.HasCapture();
|
||||
}
|
||||
|
||||
// Token: 0x04000A7A RID: 2682
|
||||
private ManipulatorActivationFilter m_currentActivator;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using UnityEngine.Experimental.UIElements.StyleSheets;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000358 RID: 856
|
||||
// (Invoke) Token: 0x06003452 RID: 13394
|
||||
internal delegate void OnStylesResolved(VisualElementStyles styles);
|
||||
}
|
||||
@@ -0,0 +1,369 @@
|
||||
using System;
|
||||
using UnityEngine.Experimental.UIElements.StyleSheets;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000338 RID: 824
|
||||
internal class Panel : BaseVisualElementPanel
|
||||
{
|
||||
// Token: 0x0600334D RID: 13133 RVA: 0x0004FA6C File Offset: 0x0004DC6C
|
||||
public Panel(int instanceID, ContextType contextType, LoadResourceFunction loadResourceDelegate = null, IDataWatchService dataWatch = null, IDispatcher dispatcher = null)
|
||||
{
|
||||
this.instanceID = instanceID;
|
||||
this.contextType = contextType;
|
||||
LoadResourceFunction loadResourceFunction = loadResourceDelegate;
|
||||
if (loadResourceDelegate == null)
|
||||
{
|
||||
loadResourceFunction = new LoadResourceFunction(Resources.Load);
|
||||
}
|
||||
this.loadResourceFunc = loadResourceFunction;
|
||||
this.dataWatch = dataWatch;
|
||||
this.dispatcher = dispatcher;
|
||||
this.stylePainter = new StylePainter();
|
||||
this.m_RootContainer = new VisualContainer();
|
||||
this.m_RootContainer.name = VisualElementUtils.GetUniqueName("PanelContainer");
|
||||
this.visualTree.ChangePanel(this);
|
||||
this.m_StyleContext = new StyleContext(this.m_RootContainer);
|
||||
this.defaultIMRoot = new IMContainer
|
||||
{
|
||||
name = "DefaultOnGUI",
|
||||
pickingMode = PickingMode.Ignore
|
||||
};
|
||||
this.defaultIMRoot.StretchToParentSize();
|
||||
this.visualTree.InsertChild(0, this.defaultIMRoot);
|
||||
this.allowPixelCaching = true;
|
||||
}
|
||||
|
||||
// Token: 0x17000BA4 RID: 2980
|
||||
// (get) Token: 0x0600334E RID: 13134 RVA: 0x0004FB54 File Offset: 0x0004DD54
|
||||
public override VisualContainer visualTree
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_RootContainer;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000BA5 RID: 2981
|
||||
// (get) Token: 0x0600334F RID: 13135 RVA: 0x0004FB70 File Offset: 0x0004DD70
|
||||
// (set) Token: 0x06003350 RID: 13136 RVA: 0x0004FB8C File Offset: 0x0004DD8C
|
||||
public VisualContainer defaultIMRoot { get; set; }
|
||||
|
||||
// Token: 0x17000BA6 RID: 2982
|
||||
// (get) Token: 0x06003351 RID: 13137 RVA: 0x0004FB98 File Offset: 0x0004DD98
|
||||
// (set) Token: 0x06003352 RID: 13138 RVA: 0x0004FBB4 File Offset: 0x0004DDB4
|
||||
public override IDispatcher dispatcher { get; protected set; }
|
||||
|
||||
// Token: 0x17000BA7 RID: 2983
|
||||
// (get) Token: 0x06003353 RID: 13139 RVA: 0x0004FBC0 File Offset: 0x0004DDC0
|
||||
// (set) Token: 0x06003354 RID: 13140 RVA: 0x0004FBDC File Offset: 0x0004DDDC
|
||||
public override IDataWatchService dataWatch { get; protected set; }
|
||||
|
||||
// Token: 0x17000BA8 RID: 2984
|
||||
// (get) Token: 0x06003355 RID: 13141 RVA: 0x0004FBE8 File Offset: 0x0004DDE8
|
||||
public TimerEventScheduler timerEventScheduler
|
||||
{
|
||||
get
|
||||
{
|
||||
TimerEventScheduler timerEventScheduler;
|
||||
if ((timerEventScheduler = this.m_Scheduler) == null)
|
||||
{
|
||||
timerEventScheduler = (this.m_Scheduler = new TimerEventScheduler());
|
||||
}
|
||||
return timerEventScheduler;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000BA9 RID: 2985
|
||||
// (get) Token: 0x06003356 RID: 13142 RVA: 0x0004FC18 File Offset: 0x0004DE18
|
||||
public override IScheduler scheduler
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.timerEventScheduler;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000BAA RID: 2986
|
||||
// (get) Token: 0x06003357 RID: 13143 RVA: 0x0004FC34 File Offset: 0x0004DE34
|
||||
internal StyleContext styleContext
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_StyleContext;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000BAB RID: 2987
|
||||
// (get) Token: 0x06003358 RID: 13144 RVA: 0x0004FC50 File Offset: 0x0004DE50
|
||||
// (set) Token: 0x06003359 RID: 13145 RVA: 0x0004FC6C File Offset: 0x0004DE6C
|
||||
public override int instanceID { get; protected set; }
|
||||
|
||||
// Token: 0x17000BAC RID: 2988
|
||||
// (get) Token: 0x0600335A RID: 13146 RVA: 0x0004FC78 File Offset: 0x0004DE78
|
||||
// (set) Token: 0x0600335B RID: 13147 RVA: 0x0004FC94 File Offset: 0x0004DE94
|
||||
public bool allowPixelCaching { get; set; }
|
||||
|
||||
// Token: 0x17000BAD RID: 2989
|
||||
// (get) Token: 0x0600335C RID: 13148 RVA: 0x0004FCA0 File Offset: 0x0004DEA0
|
||||
// (set) Token: 0x0600335D RID: 13149 RVA: 0x0004FCBC File Offset: 0x0004DEBC
|
||||
public override ContextType contextType { get; protected set; }
|
||||
|
||||
// Token: 0x17000BAE RID: 2990
|
||||
// (get) Token: 0x0600335E RID: 13150 RVA: 0x0004FCC8 File Offset: 0x0004DEC8
|
||||
// (set) Token: 0x0600335F RID: 13151 RVA: 0x0004FCE4 File Offset: 0x0004DEE4
|
||||
public override EventInterests IMGUIEventInterests { get; set; }
|
||||
|
||||
// Token: 0x17000BAF RID: 2991
|
||||
// (get) Token: 0x06003360 RID: 13152 RVA: 0x0004FCF0 File Offset: 0x0004DEF0
|
||||
// (set) Token: 0x06003361 RID: 13153 RVA: 0x0004FD0C File Offset: 0x0004DF0C
|
||||
public override LoadResourceFunction loadResourceFunc { get; protected set; }
|
||||
|
||||
// Token: 0x17000BB0 RID: 2992
|
||||
// (get) Token: 0x06003362 RID: 13154 RVA: 0x0004FD18 File Offset: 0x0004DF18
|
||||
// (set) Token: 0x06003363 RID: 13155 RVA: 0x0004FD34 File Offset: 0x0004DF34
|
||||
public override int IMGUIContainersCount { get; set; }
|
||||
|
||||
// Token: 0x06003364 RID: 13156 RVA: 0x0004FD40 File Offset: 0x0004DF40
|
||||
private VisualElement Pick(VisualElement root, Vector2 point)
|
||||
{
|
||||
VisualElement visualElement;
|
||||
if ((root.pseudoStates & PseudoStates.Invisible) == PseudoStates.Invisible)
|
||||
{
|
||||
visualElement = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
VisualContainer visualContainer = root as VisualContainer;
|
||||
Vector3 vector = root.transform.inverse.MultiplyPoint3x4(point);
|
||||
bool flag = root.ContainsPoint(vector);
|
||||
if (visualContainer != null)
|
||||
{
|
||||
if (!flag && visualContainer.clipChildren)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
vector -= new Vector3(visualContainer.position.position.x, visualContainer.position.position.y, 0f);
|
||||
for (int i = visualContainer.childrenCount - 1; i >= 0; i--)
|
||||
{
|
||||
VisualElement childAt = visualContainer.GetChildAt(i);
|
||||
VisualElement visualElement2 = this.Pick(childAt, vector);
|
||||
if (visualElement2 != null)
|
||||
{
|
||||
return visualElement2;
|
||||
}
|
||||
}
|
||||
}
|
||||
PickingMode pickingMode = root.pickingMode;
|
||||
if (pickingMode != PickingMode.Position)
|
||||
{
|
||||
if (pickingMode != PickingMode.Ignore)
|
||||
{
|
||||
}
|
||||
}
|
||||
else if (flag)
|
||||
{
|
||||
return root;
|
||||
}
|
||||
visualElement = null;
|
||||
}
|
||||
return visualElement;
|
||||
}
|
||||
|
||||
// Token: 0x06003365 RID: 13157 RVA: 0x0004FE88 File Offset: 0x0004E088
|
||||
public override VisualElement Pick(Vector2 point)
|
||||
{
|
||||
this.ValidateLayout();
|
||||
return this.Pick(this.visualTree, point);
|
||||
}
|
||||
|
||||
// Token: 0x06003366 RID: 13158 RVA: 0x0004FEB0 File Offset: 0x0004E0B0
|
||||
private void ValidateStyling()
|
||||
{
|
||||
if (!Mathf.Approximately(this.m_StyleContext.currentPixelsPerPoint, GUIUtility.pixelsPerPoint))
|
||||
{
|
||||
this.m_RootContainer.Dirty(ChangeType.Styles);
|
||||
this.m_StyleContext.currentPixelsPerPoint = GUIUtility.pixelsPerPoint;
|
||||
}
|
||||
if (this.m_RootContainer.IsDirty(ChangeType.Styles | ChangeType.StylesPath))
|
||||
{
|
||||
this.m_StyleContext.ApplyStyles();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003367 RID: 13159 RVA: 0x0004FF18 File Offset: 0x0004E118
|
||||
public override void ValidateLayout()
|
||||
{
|
||||
this.ValidateStyling();
|
||||
int num = 0;
|
||||
while (this.visualTree.cssNode.IsDirty)
|
||||
{
|
||||
this.visualTree.cssNode.CalculateLayout();
|
||||
this.ValidateSubTree(this.visualTree);
|
||||
if (num++ >= 5)
|
||||
{
|
||||
Debug.LogError("ValidateLayout is struggling to process current layout (consider simplifying to avoid recursive layout): " + this.visualTree);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003368 RID: 13160 RVA: 0x0004FF90 File Offset: 0x0004E190
|
||||
private bool ValidateSubTree(VisualElement root)
|
||||
{
|
||||
if (root.renderData.lastLayout != new Rect(root.cssNode.LayoutX, root.cssNode.LayoutY, root.cssNode.LayoutWidth, root.cssNode.LayoutHeight))
|
||||
{
|
||||
root.Dirty(ChangeType.Transform);
|
||||
root.renderData.lastLayout = new Rect(root.cssNode.LayoutX, root.cssNode.LayoutY, root.cssNode.LayoutWidth, root.cssNode.LayoutHeight);
|
||||
}
|
||||
bool flag = root.cssNode.HasNewLayout;
|
||||
if (flag)
|
||||
{
|
||||
VisualContainer visualContainer = root as VisualContainer;
|
||||
if (visualContainer != null)
|
||||
{
|
||||
foreach (VisualElement visualElement in visualContainer)
|
||||
{
|
||||
flag |= this.ValidateSubTree(visualElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
root.OnPostLayout(flag);
|
||||
root.ClearDirty(ChangeType.Layout);
|
||||
root.cssNode.MarkLayoutSeen();
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06003369 RID: 13161 RVA: 0x000500C0 File Offset: 0x0004E2C0
|
||||
private Rect ComputeAAAlignedBound(Rect position, Matrix4x4 mat)
|
||||
{
|
||||
Rect rect = position;
|
||||
Vector3 vector = mat.MultiplyPoint3x4(new Vector3(rect.x, rect.y, 0f));
|
||||
Vector3 vector2 = mat.MultiplyPoint3x4(new Vector3(rect.x + rect.width, rect.y, 0f));
|
||||
Vector3 vector3 = mat.MultiplyPoint3x4(new Vector3(rect.x, rect.y + rect.height, 0f));
|
||||
Vector3 vector4 = mat.MultiplyPoint3x4(new Vector3(rect.x + rect.width, rect.y + rect.height, 0f));
|
||||
return Rect.MinMaxRect(Mathf.Min(vector.x, Mathf.Min(vector2.x, Mathf.Min(vector3.x, vector4.x))), Mathf.Min(vector.y, Mathf.Min(vector2.y, Mathf.Min(vector3.y, vector4.y))), Mathf.Max(vector.x, Mathf.Max(vector2.x, Mathf.Max(vector3.x, vector4.x))), Mathf.Max(vector.y, Mathf.Max(vector2.y, Mathf.Max(vector3.y, vector4.y))));
|
||||
}
|
||||
|
||||
// Token: 0x0600336A RID: 13162 RVA: 0x0005022C File Offset: 0x0004E42C
|
||||
public void PaintSubTree(Event e, VisualElement root, Matrix4x4 offset, Rect currentGlobalClip)
|
||||
{
|
||||
if ((root.pseudoStates & PseudoStates.Invisible) != PseudoStates.Invisible)
|
||||
{
|
||||
VisualContainer visualContainer = root as VisualContainer;
|
||||
if (visualContainer != null)
|
||||
{
|
||||
if (visualContainer.clipChildren)
|
||||
{
|
||||
Rect rect = this.ComputeAAAlignedBound(root.position, offset * root.globalTransform);
|
||||
if (!rect.Overlaps(currentGlobalClip))
|
||||
{
|
||||
return;
|
||||
}
|
||||
float num = Mathf.Max(rect.x, currentGlobalClip.x);
|
||||
float num2 = Mathf.Min(rect.x + rect.width, currentGlobalClip.x + currentGlobalClip.width);
|
||||
float num3 = Mathf.Max(rect.y, currentGlobalClip.y);
|
||||
float num4 = Mathf.Min(rect.y + rect.height, currentGlobalClip.y + currentGlobalClip.height);
|
||||
currentGlobalClip = new Rect(num, num3, num2 - num, num4 - num3);
|
||||
}
|
||||
}
|
||||
else if (!this.ComputeAAAlignedBound(root.globalBound, offset).Overlaps(currentGlobalClip))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (root.usePixelCaching && this.allowPixelCaching && root.globalBound.size.magnitude > Mathf.Epsilon)
|
||||
{
|
||||
IStylePainter stylePainter = this.stylePainter;
|
||||
Rect globalBound = root.globalBound;
|
||||
int num5 = (int)globalBound.width;
|
||||
int num6 = (int)globalBound.height;
|
||||
int num7 = (int)(globalBound.width * GUIUtility.pixelsPerPoint);
|
||||
int num8 = (int)(globalBound.height * GUIUtility.pixelsPerPoint);
|
||||
RenderTexture renderTexture = root.renderData.pixelCache;
|
||||
if (renderTexture != null && renderTexture.width != num7 && renderTexture.height != num8)
|
||||
{
|
||||
Object.DestroyImmediate(renderTexture);
|
||||
root.renderData.pixelCache = null;
|
||||
}
|
||||
float opacity = this.stylePainter.opacity;
|
||||
if (root.IsDirty(ChangeType.Repaint) || root.renderData.pixelCache == null)
|
||||
{
|
||||
if (renderTexture == null)
|
||||
{
|
||||
renderTexture = (root.renderData.pixelCache = new RenderTexture(num7, num8, 32, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear));
|
||||
}
|
||||
RenderTexture active = RenderTexture.active;
|
||||
RenderTexture.active = renderTexture;
|
||||
GL.Clear(true, true, new Color(0f, 0f, 0f, 0f));
|
||||
offset = Matrix4x4.Translate(new Vector3(-globalBound.x, -globalBound.y, 0f));
|
||||
Rect rect2 = new Rect(0f, 0f, (float)num5, (float)num6);
|
||||
GUIClip.SetTransform(offset * root.globalTransform, rect2);
|
||||
stylePainter.currentWorldClip = currentGlobalClip;
|
||||
root.DoRepaint(stylePainter);
|
||||
root.ClearDirty(ChangeType.Repaint);
|
||||
if (visualContainer != null)
|
||||
{
|
||||
int childrenCount = visualContainer.childrenCount;
|
||||
for (int i = 0; i < childrenCount; i++)
|
||||
{
|
||||
VisualElement childAt = visualContainer.GetChildAt(i);
|
||||
this.PaintSubTree(e, childAt, offset, rect2);
|
||||
if (childrenCount != visualContainer.childrenCount)
|
||||
{
|
||||
throw new NotImplementedException("Visual tree is read-only during repaint");
|
||||
}
|
||||
}
|
||||
}
|
||||
RenderTexture.active = active;
|
||||
}
|
||||
stylePainter.currentWorldClip = currentGlobalClip;
|
||||
GUIClip.SetTransform(root.globalTransform, currentGlobalClip);
|
||||
stylePainter.DrawTexture(root.position, root.renderData.pixelCache, Color.white, ScaleMode.ScaleAndCrop, 0f, 0f, 0, 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
GUIClip.SetTransform(offset * root.globalTransform, currentGlobalClip);
|
||||
this.stylePainter.currentWorldClip = currentGlobalClip;
|
||||
this.stylePainter.mousePosition = root.globalTransform.inverse.MultiplyPoint3x4(e.mousePosition);
|
||||
this.stylePainter.opacity = root.styles.opacity.GetSpecifiedValueOrDefault(1f);
|
||||
root.DoRepaint(this.stylePainter);
|
||||
this.stylePainter.opacity = 1f;
|
||||
root.ClearDirty(ChangeType.Repaint);
|
||||
if (visualContainer != null)
|
||||
{
|
||||
int childrenCount2 = visualContainer.childrenCount;
|
||||
for (int j = 0; j < childrenCount2; j++)
|
||||
{
|
||||
VisualElement childAt2 = visualContainer.GetChildAt(j);
|
||||
this.PaintSubTree(e, childAt2, offset, currentGlobalClip);
|
||||
if (childrenCount2 != visualContainer.childrenCount)
|
||||
{
|
||||
throw new NotImplementedException("Visual tree is read-only during repaint");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600336B RID: 13163 RVA: 0x00050698 File Offset: 0x0004E898
|
||||
public override void Repaint(Event e)
|
||||
{
|
||||
this.ValidateLayout();
|
||||
this.stylePainter.repaintEvent = e;
|
||||
this.PaintSubTree(e, this.visualTree, Matrix4x4.identity, this.visualTree.position);
|
||||
}
|
||||
|
||||
// Token: 0x04000A86 RID: 2694
|
||||
private StyleContext m_StyleContext;
|
||||
|
||||
// Token: 0x04000A87 RID: 2695
|
||||
private VisualContainer m_RootContainer;
|
||||
|
||||
// Token: 0x04000A8B RID: 2699
|
||||
private TimerEventScheduler m_Scheduler;
|
||||
|
||||
// Token: 0x04000A92 RID: 2706
|
||||
private const int kMaxValidateLayoutCount = 5;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200035A RID: 858
|
||||
public enum PickingMode
|
||||
{
|
||||
// Token: 0x04000B15 RID: 2837
|
||||
Position,
|
||||
// Token: 0x04000B16 RID: 2838
|
||||
Ignore
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000359 RID: 857
|
||||
[Flags]
|
||||
internal enum PseudoStates
|
||||
{
|
||||
// Token: 0x04000B0D RID: 2829
|
||||
Active = 1,
|
||||
// Token: 0x04000B0E RID: 2830
|
||||
Hover = 2,
|
||||
// Token: 0x04000B0F RID: 2831
|
||||
Checked = 8,
|
||||
// Token: 0x04000B10 RID: 2832
|
||||
Selected = 16,
|
||||
// Token: 0x04000B11 RID: 2833
|
||||
Disabled = 32,
|
||||
// Token: 0x04000B12 RID: 2834
|
||||
Focus = 64,
|
||||
// Token: 0x04000B13 RID: 2835
|
||||
Invisible = -2147483648
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200033B RID: 827
|
||||
internal class Recycler
|
||||
{
|
||||
// Token: 0x06003372 RID: 13170 RVA: 0x000506F4 File Offset: 0x0004E8F4
|
||||
public void Trash(IRecyclable recyclable)
|
||||
{
|
||||
if (recyclable.isTrashed)
|
||||
{
|
||||
throw new ArgumentException("Trying to add an element to the Recycler more than once");
|
||||
}
|
||||
Type type = recyclable.GetType();
|
||||
Stack<IRecyclable> stack;
|
||||
if (!this.m_ReusableStacks.TryGetValue(type, out stack))
|
||||
{
|
||||
stack = new Stack<IRecyclable>();
|
||||
this.m_ReusableStacks.Add(type, stack);
|
||||
}
|
||||
recyclable.isTrashed = true;
|
||||
recyclable.OnTrash();
|
||||
if (stack.Count < 500)
|
||||
{
|
||||
stack.Push(recyclable);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003373 RID: 13171 RVA: 0x0005076C File Offset: 0x0004E96C
|
||||
public void Clear()
|
||||
{
|
||||
this.m_ReusableStacks.Clear();
|
||||
}
|
||||
|
||||
// Token: 0x17000BB2 RID: 2994
|
||||
// (get) Token: 0x06003374 RID: 13172 RVA: 0x0005077C File Offset: 0x0004E97C
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
int num = 0;
|
||||
foreach (KeyValuePair<Type, Stack<IRecyclable>> keyValuePair in this.m_ReusableStacks)
|
||||
{
|
||||
num += keyValuePair.Value.Count;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003375 RID: 13173 RVA: 0x000507CC File Offset: 0x0004E9CC
|
||||
public TType TryReuse<TType>() where TType : IRecyclable
|
||||
{
|
||||
Type typeFromHandle = typeof(TType);
|
||||
TType ttype = default(TType);
|
||||
Stack<IRecyclable> stack;
|
||||
if (this.m_ReusableStacks.TryGetValue(typeFromHandle, out stack))
|
||||
{
|
||||
if (stack.Count > 0)
|
||||
{
|
||||
ttype = (TType)((object)stack.Pop());
|
||||
ttype.isTrashed = false;
|
||||
ttype.OnReuse();
|
||||
}
|
||||
}
|
||||
return ttype;
|
||||
}
|
||||
|
||||
// Token: 0x04000A97 RID: 2711
|
||||
public const int MaxInstancesPerType = 500;
|
||||
|
||||
// Token: 0x04000A98 RID: 2712
|
||||
private Dictionary<Type, Stack<IRecyclable>> m_ReusableStacks = new Dictionary<Type, Stack<IRecyclable>>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000339 RID: 825
|
||||
internal class RenderData
|
||||
{
|
||||
// Token: 0x04000A94 RID: 2708
|
||||
public RenderTexture pixelCache;
|
||||
|
||||
// Token: 0x04000A95 RID: 2709
|
||||
public Matrix4x4 worldTransForm = Matrix4x4.identity;
|
||||
|
||||
// Token: 0x04000A96 RID: 2710
|
||||
public Rect lastLayout;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200033C RID: 828
|
||||
public class RepeatButton : VisualElement
|
||||
{
|
||||
// Token: 0x06003376 RID: 13174 RVA: 0x00050844 File Offset: 0x0004EA44
|
||||
public RepeatButton(Action clickEvent, long delay, long interval)
|
||||
{
|
||||
base.AddManipulator(new Clickable(clickEvent, delay, interval));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200033F RID: 831
|
||||
public struct ScheduleBuilder
|
||||
{
|
||||
// Token: 0x06003388 RID: 13192 RVA: 0x00050DAC File Offset: 0x0004EFAC
|
||||
internal ScheduleBuilder(ScheduledItem scheduledItem)
|
||||
{
|
||||
this.m_ScheduledItem = scheduledItem;
|
||||
}
|
||||
|
||||
// Token: 0x06003389 RID: 13193 RVA: 0x00050DB8 File Offset: 0x0004EFB8
|
||||
public ScheduleBuilder StartingIn(long delay)
|
||||
{
|
||||
if (this.m_ScheduledItem != null)
|
||||
{
|
||||
this.m_ScheduledItem.delay = delay;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// Token: 0x0600338A RID: 13194 RVA: 0x00050DEC File Offset: 0x0004EFEC
|
||||
public ScheduleBuilder Every(long interval)
|
||||
{
|
||||
if (this.m_ScheduledItem != null)
|
||||
{
|
||||
this.m_ScheduledItem.interval = interval;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// Token: 0x0600338B RID: 13195 RVA: 0x00050E20 File Offset: 0x0004F020
|
||||
public ScheduleBuilder Until(Func<bool> condition)
|
||||
{
|
||||
if (this.m_ScheduledItem != null)
|
||||
{
|
||||
ScheduledItem scheduledItem = this.m_ScheduledItem;
|
||||
scheduledItem.timerUpdateStopCondition = (Func<bool>)Delegate.Combine(scheduledItem.timerUpdateStopCondition, condition);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// Token: 0x04000AA4 RID: 2724
|
||||
private readonly ScheduledItem m_ScheduledItem;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000341 RID: 833
|
||||
internal class ScheduledItem
|
||||
{
|
||||
// Token: 0x0600338E RID: 13198 RVA: 0x00050E64 File Offset: 0x0004F064
|
||||
public ScheduledItem(Action<TimerState> timerUpdateEvent, IEventHandler handler)
|
||||
{
|
||||
this.timerUpdateEvent = timerUpdateEvent;
|
||||
this.handler = handler;
|
||||
this.start = (long)(Time.realtimeSinceStartup * 1000f);
|
||||
}
|
||||
|
||||
// Token: 0x17000BB5 RID: 2997
|
||||
// (get) Token: 0x0600338F RID: 13199 RVA: 0x00050E90 File Offset: 0x0004F090
|
||||
// (set) Token: 0x06003390 RID: 13200 RVA: 0x00050EAC File Offset: 0x0004F0AC
|
||||
public long start { get; set; }
|
||||
|
||||
// Token: 0x17000BB6 RID: 2998
|
||||
// (get) Token: 0x06003391 RID: 13201 RVA: 0x00050EB8 File Offset: 0x0004F0B8
|
||||
// (set) Token: 0x06003392 RID: 13202 RVA: 0x00050ED4 File Offset: 0x0004F0D4
|
||||
public long delay { get; set; }
|
||||
|
||||
// Token: 0x17000BB7 RID: 2999
|
||||
// (get) Token: 0x06003393 RID: 13203 RVA: 0x00050EE0 File Offset: 0x0004F0E0
|
||||
// (set) Token: 0x06003394 RID: 13204 RVA: 0x00050EFC File Offset: 0x0004F0FC
|
||||
public long interval { get; set; }
|
||||
|
||||
// Token: 0x06003395 RID: 13205 RVA: 0x00050F08 File Offset: 0x0004F108
|
||||
public bool IsUpdatable()
|
||||
{
|
||||
return this.delay > 0L || this.interval > 0L;
|
||||
}
|
||||
|
||||
// Token: 0x04000AA5 RID: 2725
|
||||
public Action<TimerState> timerUpdateEvent;
|
||||
|
||||
// Token: 0x04000AA6 RID: 2726
|
||||
public Func<bool> timerUpdateStopCondition;
|
||||
|
||||
// Token: 0x04000AA7 RID: 2727
|
||||
public IEventHandler handler;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000346 RID: 838
|
||||
public class ScrollView : VisualContainer
|
||||
{
|
||||
// Token: 0x060033B4 RID: 13236 RVA: 0x000516DC File Offset: 0x0004F8DC
|
||||
public ScrollView()
|
||||
: this(ScrollView.kDefaultScrollerValues, ScrollView.kDefaultScrollerValues)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x060033B5 RID: 13237 RVA: 0x000516F0 File Offset: 0x0004F8F0
|
||||
public ScrollView(Vector2 horizontalScrollerValues, Vector2 verticalScrollerValues)
|
||||
{
|
||||
this.horizontalScrollerValues = horizontalScrollerValues;
|
||||
this.verticalScrollerValues = verticalScrollerValues;
|
||||
this.contentView = new VisualContainer
|
||||
{
|
||||
name = "ContentView"
|
||||
};
|
||||
this.contentViewport = new VisualContainer
|
||||
{
|
||||
name = "ContentViewport"
|
||||
};
|
||||
this.contentViewport.clipChildren = true;
|
||||
this.contentViewport.AddChild(this.contentView);
|
||||
base.AddChild(this.contentViewport);
|
||||
this.horizontalScroller = new Scroller(horizontalScrollerValues.x, horizontalScrollerValues.y, delegate(float value)
|
||||
{
|
||||
this.scrollOffset = new Vector2(value, this.scrollOffset.y);
|
||||
}, Slider.Direction.Horizontal)
|
||||
{
|
||||
name = "HorizontalScroller"
|
||||
};
|
||||
base.AddChild(this.horizontalScroller);
|
||||
this.verticalScroller = new Scroller(verticalScrollerValues.x, verticalScrollerValues.y, delegate(float value)
|
||||
{
|
||||
this.scrollOffset = new Vector2(this.scrollOffset.x, value);
|
||||
}, Slider.Direction.Vertical)
|
||||
{
|
||||
name = "VerticalScroller"
|
||||
};
|
||||
base.AddChild(this.verticalScroller);
|
||||
}
|
||||
|
||||
// Token: 0x17000BC0 RID: 3008
|
||||
// (get) Token: 0x060033B6 RID: 13238 RVA: 0x000517EC File Offset: 0x0004F9EC
|
||||
// (set) Token: 0x060033B7 RID: 13239 RVA: 0x00051808 File Offset: 0x0004FA08
|
||||
public Vector2 horizontalScrollerValues { get; set; }
|
||||
|
||||
// Token: 0x17000BC1 RID: 3009
|
||||
// (get) Token: 0x060033B8 RID: 13240 RVA: 0x00051814 File Offset: 0x0004FA14
|
||||
// (set) Token: 0x060033B9 RID: 13241 RVA: 0x00051830 File Offset: 0x0004FA30
|
||||
public Vector2 verticalScrollerValues { get; set; }
|
||||
|
||||
// Token: 0x17000BC2 RID: 3010
|
||||
// (get) Token: 0x060033BA RID: 13242 RVA: 0x0005183C File Offset: 0x0004FA3C
|
||||
// (set) Token: 0x060033BB RID: 13243 RVA: 0x00051858 File Offset: 0x0004FA58
|
||||
public bool showHorizontal { get; set; }
|
||||
|
||||
// Token: 0x17000BC3 RID: 3011
|
||||
// (get) Token: 0x060033BC RID: 13244 RVA: 0x00051864 File Offset: 0x0004FA64
|
||||
// (set) Token: 0x060033BD RID: 13245 RVA: 0x00051880 File Offset: 0x0004FA80
|
||||
public bool showVertical { get; set; }
|
||||
|
||||
// Token: 0x17000BC4 RID: 3012
|
||||
// (get) Token: 0x060033BE RID: 13246 RVA: 0x0005188C File Offset: 0x0004FA8C
|
||||
public bool needsHorizontal
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.showHorizontal || this.contentView.position.width - base.position.width > 0f;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000BC5 RID: 3013
|
||||
// (get) Token: 0x060033BF RID: 13247 RVA: 0x000518D8 File Offset: 0x0004FAD8
|
||||
public bool needsVertical
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.showVertical || this.contentView.position.height - base.position.height > 0f;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000BC6 RID: 3014
|
||||
// (get) Token: 0x060033C0 RID: 13248 RVA: 0x00051924 File Offset: 0x0004FB24
|
||||
// (set) Token: 0x060033C1 RID: 13249 RVA: 0x00051940 File Offset: 0x0004FB40
|
||||
public Vector2 scrollOffset
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_ScrollOffset;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_ScrollOffset = value;
|
||||
this.UpdateContentViewTransform();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060033C2 RID: 13250 RVA: 0x00051950 File Offset: 0x0004FB50
|
||||
private void UpdateContentViewTransform()
|
||||
{
|
||||
Vector2 scrollOffset = this.m_ScrollOffset;
|
||||
scrollOffset.x -= this.horizontalScroller.lowValue;
|
||||
scrollOffset.x /= this.horizontalScroller.highValue - this.horizontalScroller.lowValue;
|
||||
scrollOffset.y -= this.verticalScroller.lowValue;
|
||||
scrollOffset.y /= this.verticalScroller.highValue - this.verticalScroller.lowValue;
|
||||
float num = this.contentView.position.width - this.contentViewport.position.width;
|
||||
float num2 = this.contentView.position.height - this.contentViewport.position.height;
|
||||
Matrix4x4 transform = this.contentView.transform;
|
||||
transform.m03 = -(scrollOffset.x * num);
|
||||
transform.m13 = -(scrollOffset.y * num2);
|
||||
this.contentView.transform = transform;
|
||||
base.Dirty(ChangeType.Repaint);
|
||||
}
|
||||
|
||||
// Token: 0x17000BC7 RID: 3015
|
||||
// (get) Token: 0x060033C3 RID: 13251 RVA: 0x00051A78 File Offset: 0x0004FC78
|
||||
// (set) Token: 0x060033C4 RID: 13252 RVA: 0x00051A94 File Offset: 0x0004FC94
|
||||
public VisualContainer contentView { get; private set; }
|
||||
|
||||
// Token: 0x17000BC8 RID: 3016
|
||||
// (get) Token: 0x060033C5 RID: 13253 RVA: 0x00051AA0 File Offset: 0x0004FCA0
|
||||
// (set) Token: 0x060033C6 RID: 13254 RVA: 0x00051ABC File Offset: 0x0004FCBC
|
||||
public VisualContainer contentViewport { get; private set; }
|
||||
|
||||
// Token: 0x17000BC9 RID: 3017
|
||||
// (get) Token: 0x060033C7 RID: 13255 RVA: 0x00051AC8 File Offset: 0x0004FCC8
|
||||
// (set) Token: 0x060033C8 RID: 13256 RVA: 0x00051AE4 File Offset: 0x0004FCE4
|
||||
public Scroller horizontalScroller { get; private set; }
|
||||
|
||||
// Token: 0x17000BCA RID: 3018
|
||||
// (get) Token: 0x060033C9 RID: 13257 RVA: 0x00051AF0 File Offset: 0x0004FCF0
|
||||
// (set) Token: 0x060033CA RID: 13258 RVA: 0x00051B0C File Offset: 0x0004FD0C
|
||||
public Scroller verticalScroller { get; private set; }
|
||||
|
||||
// Token: 0x060033CB RID: 13259 RVA: 0x00051B18 File Offset: 0x0004FD18
|
||||
protected internal override void OnPostLayout(bool hasNewLayout)
|
||||
{
|
||||
if (hasNewLayout)
|
||||
{
|
||||
if (this.contentView.position.width > Mathf.Epsilon)
|
||||
{
|
||||
this.horizontalScroller.Adjust(this.contentViewport.position.width / this.contentView.position.width);
|
||||
}
|
||||
if (this.contentView.position.height > Mathf.Epsilon)
|
||||
{
|
||||
this.verticalScroller.Adjust(this.contentViewport.position.height / this.contentView.position.height);
|
||||
}
|
||||
this.horizontalScroller.enabled = this.contentView.position.width - base.position.width > 0f;
|
||||
this.verticalScroller.enabled = this.contentView.position.height - base.position.height > 0f;
|
||||
this.horizontalScroller.visible = this.needsHorizontal;
|
||||
this.verticalScroller.visible = this.needsVertical;
|
||||
this.UpdateContentViewTransform();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060033CC RID: 13260 RVA: 0x00051C68 File Offset: 0x0004FE68
|
||||
public override EventPropagation HandleEvent(Event evt, VisualElement finalTarget)
|
||||
{
|
||||
EventType type = evt.type;
|
||||
EventPropagation eventPropagation;
|
||||
if (type != EventType.ScrollWheel)
|
||||
{
|
||||
eventPropagation = EventPropagation.Continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.contentView.position.height - base.position.height > 0f)
|
||||
{
|
||||
if (evt.delta.y < 0f)
|
||||
{
|
||||
this.verticalScroller.ScrollPageUp();
|
||||
}
|
||||
else if (evt.delta.y > 0f)
|
||||
{
|
||||
this.verticalScroller.ScrollPageDown();
|
||||
}
|
||||
}
|
||||
eventPropagation = EventPropagation.Stop;
|
||||
}
|
||||
return eventPropagation;
|
||||
}
|
||||
|
||||
// Token: 0x04000AB7 RID: 2743
|
||||
public static readonly Vector2 kDefaultScrollerValues = new Vector2(0f, 100f);
|
||||
|
||||
// Token: 0x04000ABA RID: 2746
|
||||
private Vector2 m_ScrollOffset;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using UnityEngine.Experimental.UIElements.StyleEnums;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000345 RID: 837
|
||||
public class Scroller : VisualContainer
|
||||
{
|
||||
// Token: 0x0600339E RID: 13214 RVA: 0x000512B0 File Offset: 0x0004F4B0
|
||||
public Scroller(float lowValue, float highValue, Action<float> valueChanged, Slider.Direction direction = Slider.Direction.Vertical)
|
||||
{
|
||||
base.phaseInterest = EventPhase.BubbleUp;
|
||||
this.direction = direction;
|
||||
this.valueChanged = valueChanged;
|
||||
this.slider = new Slider(lowValue, highValue, new Action<float>(this.OnSliderValueChange), direction, 10f)
|
||||
{
|
||||
name = "Slider"
|
||||
};
|
||||
base.AddChild(this.slider);
|
||||
this.lowButton = new ScrollerButton(new Action(this.ScrollPageUp), 250L, 30L)
|
||||
{
|
||||
name = "LowButton"
|
||||
};
|
||||
base.AddChild(this.lowButton);
|
||||
this.highButton = new ScrollerButton(new Action(this.ScrollPageDown), 250L, 30L)
|
||||
{
|
||||
name = "HighButton"
|
||||
};
|
||||
base.AddChild(this.highButton);
|
||||
}
|
||||
|
||||
// Token: 0x14000027 RID: 39
|
||||
// (add) Token: 0x0600339F RID: 13215 RVA: 0x00051388 File Offset: 0x0004F588
|
||||
// (remove) Token: 0x060033A0 RID: 13216 RVA: 0x000513C0 File Offset: 0x0004F5C0
|
||||
[field: DebuggerBrowsable(DebuggerBrowsableState.Never)]
|
||||
public event Action<float> valueChanged;
|
||||
|
||||
// Token: 0x17000BB8 RID: 3000
|
||||
// (get) Token: 0x060033A1 RID: 13217 RVA: 0x000513F8 File Offset: 0x0004F5F8
|
||||
// (set) Token: 0x060033A2 RID: 13218 RVA: 0x00051414 File Offset: 0x0004F614
|
||||
public Slider slider { get; private set; }
|
||||
|
||||
// Token: 0x17000BB9 RID: 3001
|
||||
// (get) Token: 0x060033A3 RID: 13219 RVA: 0x00051420 File Offset: 0x0004F620
|
||||
// (set) Token: 0x060033A4 RID: 13220 RVA: 0x0005143C File Offset: 0x0004F63C
|
||||
public ScrollerButton lowButton { get; private set; }
|
||||
|
||||
// Token: 0x17000BBA RID: 3002
|
||||
// (get) Token: 0x060033A5 RID: 13221 RVA: 0x00051448 File Offset: 0x0004F648
|
||||
// (set) Token: 0x060033A6 RID: 13222 RVA: 0x00051464 File Offset: 0x0004F664
|
||||
public ScrollerButton highButton { get; private set; }
|
||||
|
||||
// Token: 0x17000BBB RID: 3003
|
||||
// (get) Token: 0x060033A7 RID: 13223 RVA: 0x00051470 File Offset: 0x0004F670
|
||||
// (set) Token: 0x060033A8 RID: 13224 RVA: 0x00051490 File Offset: 0x0004F690
|
||||
public float value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.slider.value;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.slider.value = value;
|
||||
if (this.valueChanged != null)
|
||||
{
|
||||
this.valueChanged(this.slider.value);
|
||||
}
|
||||
base.Dirty(ChangeType.Repaint);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000BBC RID: 3004
|
||||
// (get) Token: 0x060033A9 RID: 13225 RVA: 0x000514C8 File Offset: 0x0004F6C8
|
||||
public float lowValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.slider.lowValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000BBD RID: 3005
|
||||
// (get) Token: 0x060033AA RID: 13226 RVA: 0x000514E8 File Offset: 0x0004F6E8
|
||||
public float highValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.slider.highValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000BBE RID: 3006
|
||||
// (get) Token: 0x060033AB RID: 13227 RVA: 0x00051508 File Offset: 0x0004F708
|
||||
// (set) Token: 0x060033AC RID: 13228 RVA: 0x00051530 File Offset: 0x0004F730
|
||||
public Slider.Direction direction
|
||||
{
|
||||
get
|
||||
{
|
||||
return (base.flexDirection != FlexDirection.Row) ? Slider.Direction.Vertical : Slider.Direction.Horizontal;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == Slider.Direction.Horizontal)
|
||||
{
|
||||
base.flexDirection = FlexDirection.Row;
|
||||
base.AddToClassList("horizontal");
|
||||
}
|
||||
else
|
||||
{
|
||||
base.flexDirection = FlexDirection.Column;
|
||||
base.AddToClassList("vertical");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000BBF RID: 3007
|
||||
// (get) Token: 0x060033AD RID: 13229 RVA: 0x00051568 File Offset: 0x0004F768
|
||||
// (set) Token: 0x060033AE RID: 13230 RVA: 0x00051584 File Offset: 0x0004F784
|
||||
public override bool enabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.enabled;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.enabled = value;
|
||||
this.PropagateEnabled(this, value);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060033AF RID: 13231 RVA: 0x00051598 File Offset: 0x0004F798
|
||||
public void PropagateEnabled(VisualContainer c, bool enabled)
|
||||
{
|
||||
if (c != null)
|
||||
{
|
||||
foreach (VisualElement visualElement in c)
|
||||
{
|
||||
visualElement.enabled = enabled;
|
||||
this.PropagateEnabled(visualElement as VisualContainer, enabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060033B0 RID: 13232 RVA: 0x00051608 File Offset: 0x0004F808
|
||||
public void Adjust(float factor)
|
||||
{
|
||||
this.enabled = factor < 1f;
|
||||
this.slider.AdjustDragElement(factor);
|
||||
}
|
||||
|
||||
// Token: 0x060033B1 RID: 13233 RVA: 0x00051628 File Offset: 0x0004F828
|
||||
private void OnSliderValueChange(float newValue)
|
||||
{
|
||||
this.value = newValue;
|
||||
}
|
||||
|
||||
// Token: 0x060033B2 RID: 13234 RVA: 0x00051634 File Offset: 0x0004F834
|
||||
public void ScrollPageUp()
|
||||
{
|
||||
this.value -= this.slider.pageSize * ((this.slider.lowValue >= this.slider.highValue) ? (-1f) : 1f);
|
||||
}
|
||||
|
||||
// Token: 0x060033B3 RID: 13235 RVA: 0x00051688 File Offset: 0x0004F888
|
||||
public void ScrollPageDown()
|
||||
{
|
||||
this.value += this.slider.pageSize * ((this.slider.lowValue >= this.slider.highValue) ? (-1f) : 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000344 RID: 836
|
||||
public class ScrollerButton : VisualElement
|
||||
{
|
||||
// Token: 0x0600339D RID: 13213 RVA: 0x0005128C File Offset: 0x0004F48C
|
||||
public ScrollerButton(Action clickEvent, long delay, long interval)
|
||||
{
|
||||
this.clickable = new Clickable(clickEvent, delay, interval);
|
||||
base.AddManipulator(this.clickable);
|
||||
}
|
||||
|
||||
// Token: 0x04000AB0 RID: 2736
|
||||
public Clickable clickable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using UnityEngine.Experimental.UIElements.StyleSheets;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000347 RID: 839
|
||||
public class Slider : VisualContainer
|
||||
{
|
||||
// Token: 0x060033D0 RID: 13264 RVA: 0x00051D80 File Offset: 0x0004FF80
|
||||
public Slider(float start, float end, Action<float> valueChanged, Slider.Direction direction = Slider.Direction.Horizontal, float pageSize = 10f)
|
||||
{
|
||||
this.valueChanged = valueChanged;
|
||||
this.direction = direction;
|
||||
this.pageSize = pageSize;
|
||||
this.lowValue = start;
|
||||
this.highValue = end;
|
||||
base.AddChild(new VisualElement
|
||||
{
|
||||
name = "TrackElement"
|
||||
});
|
||||
this.m_Value = this.lowValue;
|
||||
this.dragElement = new VisualElement
|
||||
{
|
||||
name = "DragElement"
|
||||
};
|
||||
base.AddChild(this.dragElement);
|
||||
this.clampedDragger = new ClampedDragger(this, new Action(this.SetSliderValueFromClick), new Action(this.SetSliderValueFromDrag));
|
||||
base.AddManipulator(this.clampedDragger);
|
||||
}
|
||||
|
||||
// Token: 0x17000BCB RID: 3019
|
||||
// (get) Token: 0x060033D1 RID: 13265 RVA: 0x00051E34 File Offset: 0x00050034
|
||||
// (set) Token: 0x060033D2 RID: 13266 RVA: 0x00051E50 File Offset: 0x00050050
|
||||
public VisualElement dragElement { get; private set; }
|
||||
|
||||
// Token: 0x17000BCC RID: 3020
|
||||
// (get) Token: 0x060033D3 RID: 13267 RVA: 0x00051E5C File Offset: 0x0005005C
|
||||
// (set) Token: 0x060033D4 RID: 13268 RVA: 0x00051E78 File Offset: 0x00050078
|
||||
public float lowValue { get; set; }
|
||||
|
||||
// Token: 0x17000BCD RID: 3021
|
||||
// (get) Token: 0x060033D5 RID: 13269 RVA: 0x00051E84 File Offset: 0x00050084
|
||||
// (set) Token: 0x060033D6 RID: 13270 RVA: 0x00051EA0 File Offset: 0x000500A0
|
||||
public float highValue { get; set; }
|
||||
|
||||
// Token: 0x17000BCE RID: 3022
|
||||
// (get) Token: 0x060033D7 RID: 13271 RVA: 0x00051EAC File Offset: 0x000500AC
|
||||
public float range
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.highValue - this.lowValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000BCF RID: 3023
|
||||
// (get) Token: 0x060033D8 RID: 13272 RVA: 0x00051ED0 File Offset: 0x000500D0
|
||||
// (set) Token: 0x060033D9 RID: 13273 RVA: 0x00051EEC File Offset: 0x000500EC
|
||||
public float pageSize { get; set; }
|
||||
|
||||
// Token: 0x14000028 RID: 40
|
||||
// (add) Token: 0x060033DA RID: 13274 RVA: 0x00051EF8 File Offset: 0x000500F8
|
||||
// (remove) Token: 0x060033DB RID: 13275 RVA: 0x00051F30 File Offset: 0x00050130
|
||||
[field: DebuggerBrowsable(DebuggerBrowsableState.Never)]
|
||||
public event Action<float> valueChanged;
|
||||
|
||||
// Token: 0x17000BD0 RID: 3024
|
||||
// (get) Token: 0x060033DC RID: 13276 RVA: 0x00051F68 File Offset: 0x00050168
|
||||
// (set) Token: 0x060033DD RID: 13277 RVA: 0x00051F84 File Offset: 0x00050184
|
||||
internal ClampedDragger clampedDragger { get; private set; }
|
||||
|
||||
// Token: 0x17000BD1 RID: 3025
|
||||
// (get) Token: 0x060033DE RID: 13278 RVA: 0x00051F90 File Offset: 0x00050190
|
||||
// (set) Token: 0x060033DF RID: 13279 RVA: 0x00051FAC File Offset: 0x000501AC
|
||||
public float value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
float num = Mathf.Clamp(value, this.lowValue, this.highValue);
|
||||
if (!Mathf.Approximately(this.m_Value, num))
|
||||
{
|
||||
this.m_Value = num;
|
||||
this.UpdateDragElementPosition();
|
||||
if (this.valueChanged != null)
|
||||
{
|
||||
this.valueChanged(this.m_Value);
|
||||
}
|
||||
base.Dirty(ChangeType.Repaint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000BD2 RID: 3026
|
||||
// (get) Token: 0x060033E0 RID: 13280 RVA: 0x00052014 File Offset: 0x00050214
|
||||
// (set) Token: 0x060033E1 RID: 13281 RVA: 0x00052030 File Offset: 0x00050230
|
||||
public Slider.Direction direction
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Direction;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Direction = value;
|
||||
if (this.m_Direction == Slider.Direction.Horizontal)
|
||||
{
|
||||
base.RemoveFromClassList("vertical");
|
||||
base.AddToClassList("horizontal");
|
||||
}
|
||||
else
|
||||
{
|
||||
base.RemoveFromClassList("horizontal");
|
||||
base.AddToClassList("vertical");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060033E2 RID: 13282 RVA: 0x00052088 File Offset: 0x00050288
|
||||
private void SetSliderValueFromDrag()
|
||||
{
|
||||
if (this.clampedDragger.dragDirection == ClampedDragger.DragDirection.Free)
|
||||
{
|
||||
Vector2 delta = this.clampedDragger.delta;
|
||||
if (this.direction == Slider.Direction.Horizontal)
|
||||
{
|
||||
this.ComputeValueAndDirectionFromDrag(base.position.width, this.dragElement.position.width, this.m_DragElementStartPos.x + delta.x);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ComputeValueAndDirectionFromDrag(base.position.height, this.dragElement.position.height, this.m_DragElementStartPos.y + delta.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060033E3 RID: 13283 RVA: 0x00052140 File Offset: 0x00050340
|
||||
private void ComputeValueAndDirectionFromDrag(float sliderLength, float dragElementLength, float dragElementPos)
|
||||
{
|
||||
float num = sliderLength - dragElementLength;
|
||||
if (Mathf.Abs(num) >= Mathf.Epsilon)
|
||||
{
|
||||
this.value = Mathf.Max(0f, Mathf.Min(dragElementPos, num)) / num * this.range + this.lowValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060033E4 RID: 13284 RVA: 0x00052190 File Offset: 0x00050390
|
||||
private void SetSliderValueFromClick()
|
||||
{
|
||||
if (this.clampedDragger.dragDirection != ClampedDragger.DragDirection.Free)
|
||||
{
|
||||
if (this.clampedDragger.dragDirection == ClampedDragger.DragDirection.None)
|
||||
{
|
||||
if (this.pageSize == 0f)
|
||||
{
|
||||
float num = ((this.direction != Slider.Direction.Horizontal) ? this.dragElement.position.x : (this.clampedDragger.startMousePosition.x - this.dragElement.position.width / 2f));
|
||||
float num2 = ((this.direction != Slider.Direction.Horizontal) ? (this.clampedDragger.startMousePosition.y - this.dragElement.position.height / 2f) : this.dragElement.position.y);
|
||||
Rect rect = new Rect(num, num2, this.dragElement.position.width, this.dragElement.position.height);
|
||||
this.dragElement.position = rect;
|
||||
this.m_DragElementStartPos = rect;
|
||||
this.clampedDragger.dragDirection = ClampedDragger.DragDirection.Free;
|
||||
if (this.direction == Slider.Direction.Horizontal)
|
||||
{
|
||||
this.ComputeValueAndDirectionFromDrag(base.position.width, this.dragElement.position.width, this.m_DragElementStartPos.x);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ComputeValueAndDirectionFromDrag(base.position.height, this.dragElement.position.height, this.m_DragElementStartPos.y);
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.m_DragElementStartPos = this.dragElement.position;
|
||||
}
|
||||
if (this.direction == Slider.Direction.Horizontal)
|
||||
{
|
||||
this.ComputeValueAndDirectionFromClick(base.position.width, this.dragElement.position.width, this.dragElement.position.x, this.clampedDragger.lastMousePosition.x);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ComputeValueAndDirectionFromClick(base.position.height, this.dragElement.position.height, this.dragElement.position.y, this.clampedDragger.lastMousePosition.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060033E5 RID: 13285 RVA: 0x00052410 File Offset: 0x00050610
|
||||
private void ComputeValueAndDirectionFromClick(float sliderLength, float dragElementLength, float dragElementPos, float dragElementLastPos)
|
||||
{
|
||||
float num = sliderLength - dragElementLength;
|
||||
if (Mathf.Abs(num) >= Mathf.Epsilon)
|
||||
{
|
||||
if (dragElementLastPos < dragElementPos && this.clampedDragger.dragDirection != ClampedDragger.DragDirection.LowToHigh)
|
||||
{
|
||||
this.clampedDragger.dragDirection = ClampedDragger.DragDirection.HighToLow;
|
||||
this.value = Mathf.Max(0f, Mathf.Min(dragElementPos - this.pageSize, num)) / num * this.range + this.lowValue;
|
||||
}
|
||||
else if (dragElementLastPos > dragElementPos + dragElementLength && this.clampedDragger.dragDirection != ClampedDragger.DragDirection.HighToLow)
|
||||
{
|
||||
this.clampedDragger.dragDirection = ClampedDragger.DragDirection.LowToHigh;
|
||||
this.value = Mathf.Max(0f, Mathf.Min(dragElementPos + this.pageSize, num)) / num * this.range + this.lowValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060033E6 RID: 13286 RVA: 0x000524E8 File Offset: 0x000506E8
|
||||
public void AdjustDragElement(float factor)
|
||||
{
|
||||
Rect position;
|
||||
if (factor >= 1f)
|
||||
{
|
||||
if (this.direction == Slider.Direction.Horizontal)
|
||||
{
|
||||
position = new Rect(this.dragElement.position.x, this.dragElement.position.y, 0f, this.dragElement.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
position = new Rect(this.dragElement.position.x, this.dragElement.position.y, this.dragElement.width, 0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VisualElementStyles styles = this.dragElement.styles;
|
||||
position = this.dragElement.position;
|
||||
if (this.direction == Slider.Direction.Horizontal)
|
||||
{
|
||||
float specifiedValueOrDefault = styles.minWidth.GetSpecifiedValueOrDefault(0f);
|
||||
position.width = Mathf.Max(base.position.width * factor, specifiedValueOrDefault);
|
||||
}
|
||||
else
|
||||
{
|
||||
float specifiedValueOrDefault2 = styles.minHeight.GetSpecifiedValueOrDefault(0f);
|
||||
position.height = Mathf.Max(base.position.height * factor, specifiedValueOrDefault2);
|
||||
}
|
||||
}
|
||||
this.dragElement.position = position;
|
||||
}
|
||||
|
||||
// Token: 0x060033E7 RID: 13287 RVA: 0x00052634 File Offset: 0x00050834
|
||||
private void UpdateDragElementPosition()
|
||||
{
|
||||
if (base.panel != null)
|
||||
{
|
||||
float num = this.m_Value - this.lowValue;
|
||||
float width = this.dragElement.position.width;
|
||||
float height = this.dragElement.position.height;
|
||||
if (this.direction == Slider.Direction.Horizontal)
|
||||
{
|
||||
float num2 = base.position.width - width;
|
||||
this.dragElement.position = new Rect(num / this.range * num2, this.dragElement.position.y, width, height);
|
||||
}
|
||||
else
|
||||
{
|
||||
float num3 = base.position.height - height;
|
||||
this.dragElement.position = new Rect(this.dragElement.position.x, num / this.range * num3, width, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060033E8 RID: 13288 RVA: 0x00052728 File Offset: 0x00050928
|
||||
protected internal override void OnPostLayout(bool hasNewLayout)
|
||||
{
|
||||
if (hasNewLayout)
|
||||
{
|
||||
this.UpdateDragElementPosition();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000AC5 RID: 2757
|
||||
private Rect m_DragElementStartPos;
|
||||
|
||||
// Token: 0x04000AC6 RID: 2758
|
||||
private float m_Value;
|
||||
|
||||
// Token: 0x04000AC7 RID: 2759
|
||||
private Slider.Direction m_Direction;
|
||||
|
||||
// Token: 0x02000348 RID: 840
|
||||
public enum Direction
|
||||
{
|
||||
// Token: 0x04000AC9 RID: 2761
|
||||
Horizontal,
|
||||
// Token: 0x04000ACA RID: 2762
|
||||
Vertical
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x02000349 RID: 841
|
||||
public struct Spacing
|
||||
{
|
||||
// Token: 0x060033E9 RID: 13289 RVA: 0x0005273C File Offset: 0x0005093C
|
||||
public Spacing(float left, float top, float right, float bottom)
|
||||
{
|
||||
this.left = left;
|
||||
this.top = top;
|
||||
this.right = right;
|
||||
this.bottom = bottom;
|
||||
}
|
||||
|
||||
// Token: 0x17000BD3 RID: 3027
|
||||
// (get) Token: 0x060033EA RID: 13290 RVA: 0x0005275C File Offset: 0x0005095C
|
||||
public float horizontal
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.left + this.right;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000BD4 RID: 3028
|
||||
// (get) Token: 0x060033EB RID: 13291 RVA: 0x00052780 File Offset: 0x00050980
|
||||
public float vertical
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.top + this.bottom;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060033EC RID: 13292 RVA: 0x000527A4 File Offset: 0x000509A4
|
||||
public static Rect operator +(Rect r, Spacing a)
|
||||
{
|
||||
r.x -= a.left;
|
||||
r.y -= a.top;
|
||||
r.width += a.horizontal;
|
||||
r.height += a.vertical;
|
||||
return r;
|
||||
}
|
||||
|
||||
// Token: 0x060033ED RID: 13293 RVA: 0x00052810 File Offset: 0x00050A10
|
||||
public static Rect operator -(Rect r, Spacing a)
|
||||
{
|
||||
r.x += a.left;
|
||||
r.y += a.top;
|
||||
r.width -= a.horizontal;
|
||||
r.height -= a.vertical;
|
||||
return r;
|
||||
}
|
||||
|
||||
// Token: 0x04000ACB RID: 2763
|
||||
public float left;
|
||||
|
||||
// Token: 0x04000ACC RID: 2764
|
||||
public float top;
|
||||
|
||||
// Token: 0x04000ACD RID: 2765
|
||||
public float right;
|
||||
|
||||
// Token: 0x04000ACE RID: 2766
|
||||
public float bottom;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleEnums
|
||||
{
|
||||
// Token: 0x0200034E RID: 846
|
||||
public enum Align
|
||||
{
|
||||
// Token: 0x04000AE0 RID: 2784
|
||||
Auto,
|
||||
// Token: 0x04000AE1 RID: 2785
|
||||
FlexStart,
|
||||
// Token: 0x04000AE2 RID: 2786
|
||||
Center,
|
||||
// Token: 0x04000AE3 RID: 2787
|
||||
FlexEnd,
|
||||
// Token: 0x04000AE4 RID: 2788
|
||||
Stretch
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleEnums
|
||||
{
|
||||
// Token: 0x0200034C RID: 844
|
||||
public enum FlexDirection
|
||||
{
|
||||
// Token: 0x04000AD8 RID: 2776
|
||||
Column,
|
||||
// Token: 0x04000AD9 RID: 2777
|
||||
ColumnReverse,
|
||||
// Token: 0x04000ADA RID: 2778
|
||||
Row,
|
||||
// Token: 0x04000ADB RID: 2779
|
||||
RowReverse
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleEnums
|
||||
{
|
||||
// Token: 0x02000350 RID: 848
|
||||
public enum ImageScaleMode
|
||||
{
|
||||
// Token: 0x04000AEC RID: 2796
|
||||
StretchToFill,
|
||||
// Token: 0x04000AED RID: 2797
|
||||
ScaleAndCrop,
|
||||
// Token: 0x04000AEE RID: 2798
|
||||
ScaleToFit
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleEnums
|
||||
{
|
||||
// Token: 0x0200034F RID: 847
|
||||
public enum Justify
|
||||
{
|
||||
// Token: 0x04000AE6 RID: 2790
|
||||
FlexStart,
|
||||
// Token: 0x04000AE7 RID: 2791
|
||||
Center,
|
||||
// Token: 0x04000AE8 RID: 2792
|
||||
FlexEnd,
|
||||
// Token: 0x04000AE9 RID: 2793
|
||||
SpaceBetween,
|
||||
// Token: 0x04000AEA RID: 2794
|
||||
SpaceAround
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleEnums
|
||||
{
|
||||
// Token: 0x0200034B RID: 843
|
||||
public enum Overflow
|
||||
{
|
||||
// Token: 0x04000AD4 RID: 2772
|
||||
Visible,
|
||||
// Token: 0x04000AD5 RID: 2773
|
||||
Scroll = 2,
|
||||
// Token: 0x04000AD6 RID: 2774
|
||||
Hidden = 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleEnums
|
||||
{
|
||||
// Token: 0x0200034A RID: 842
|
||||
public enum PositionType
|
||||
{
|
||||
// Token: 0x04000AD0 RID: 2768
|
||||
Relative,
|
||||
// Token: 0x04000AD1 RID: 2769
|
||||
Absolute,
|
||||
// Token: 0x04000AD2 RID: 2770
|
||||
Manual
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleEnums
|
||||
{
|
||||
// Token: 0x0200034D RID: 845
|
||||
public enum Wrap
|
||||
{
|
||||
// Token: 0x04000ADD RID: 2781
|
||||
NoWrap,
|
||||
// Token: 0x04000ADE RID: 2782
|
||||
Wrap
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using UnityEngine.StyleSheets;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleSheets
|
||||
{
|
||||
// Token: 0x0200036E RID: 878
|
||||
internal struct CustomProperty
|
||||
{
|
||||
// Token: 0x04000B8F RID: 2959
|
||||
public int specificity;
|
||||
|
||||
// Token: 0x04000B90 RID: 2960
|
||||
public StyleValueHandle handle;
|
||||
|
||||
// Token: 0x04000B91 RID: 2961
|
||||
public StyleSheet data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleSheets
|
||||
{
|
||||
// Token: 0x0200036F RID: 879
|
||||
public interface ICustomStyles
|
||||
{
|
||||
// Token: 0x06003540 RID: 13632
|
||||
void ApplyCustomProperty(string propertyName, ref Style<float> target);
|
||||
|
||||
// Token: 0x06003541 RID: 13633
|
||||
void ApplyCustomProperty(string propertyName, ref Style<int> target);
|
||||
|
||||
// Token: 0x06003542 RID: 13634
|
||||
void ApplyCustomProperty(string propertyName, ref Style<bool> target);
|
||||
|
||||
// Token: 0x06003543 RID: 13635
|
||||
void ApplyCustomProperty(string propertyName, ref Style<Color> target);
|
||||
|
||||
// Token: 0x06003544 RID: 13636
|
||||
void ApplyCustomProperty<T>(string propertyName, ref Style<T> target) where T : Object;
|
||||
|
||||
// Token: 0x06003545 RID: 13637
|
||||
void ApplyCustomProperty(string propertyName, ref Style<string> target);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using UnityEngine.StyleSheets;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleSheets
|
||||
{
|
||||
// Token: 0x02000368 RID: 872
|
||||
internal struct RuleMatcher
|
||||
{
|
||||
// Token: 0x04000B7E RID: 2942
|
||||
public StyleSheet sheet;
|
||||
|
||||
// Token: 0x04000B7F RID: 2943
|
||||
public StyleComplexSelector complexSelector;
|
||||
|
||||
// Token: 0x04000B80 RID: 2944
|
||||
public int simpleSelectorIndex;
|
||||
|
||||
// Token: 0x04000B81 RID: 2945
|
||||
public int depth;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleSheets
|
||||
{
|
||||
// Token: 0x02000365 RID: 869
|
||||
public struct Style<T>
|
||||
{
|
||||
// Token: 0x0600351D RID: 13597 RVA: 0x00057460 File Offset: 0x00055660
|
||||
public Style(T value)
|
||||
{
|
||||
this.value = value;
|
||||
this.specificity = 0;
|
||||
}
|
||||
|
||||
// Token: 0x0600351E RID: 13598 RVA: 0x00057474 File Offset: 0x00055674
|
||||
internal Style(T value, int specifity)
|
||||
{
|
||||
this.value = value;
|
||||
this.specificity = specifity;
|
||||
}
|
||||
|
||||
// Token: 0x17000C37 RID: 3127
|
||||
// (get) Token: 0x0600351F RID: 13599 RVA: 0x00057488 File Offset: 0x00055688
|
||||
public static Style<T> nil
|
||||
{
|
||||
get
|
||||
{
|
||||
return Style<T>.defaultStyle;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003520 RID: 13600 RVA: 0x000574A4 File Offset: 0x000556A4
|
||||
public T GetSpecifiedValueOrDefault(T defaultValue)
|
||||
{
|
||||
if (this.specificity > 0)
|
||||
{
|
||||
defaultValue = this.value;
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
// Token: 0x06003521 RID: 13601 RVA: 0x000574D0 File Offset: 0x000556D0
|
||||
public static implicit operator T(Style<T> sp)
|
||||
{
|
||||
return sp.value;
|
||||
}
|
||||
|
||||
// Token: 0x06003522 RID: 13602 RVA: 0x000574EC File Offset: 0x000556EC
|
||||
internal void Apply(Style<T> other, StylePropertyApplyMode mode)
|
||||
{
|
||||
if (mode != StylePropertyApplyMode.Copy)
|
||||
{
|
||||
if (mode != StylePropertyApplyMode.CopyIfMoreSpecific)
|
||||
{
|
||||
if (mode == StylePropertyApplyMode.CopyIfNotInline)
|
||||
{
|
||||
if (this.specificity < 2147483647)
|
||||
{
|
||||
this.value = other.value;
|
||||
this.specificity = other.specificity;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (other.specificity >= this.specificity)
|
||||
{
|
||||
this.value = other.value;
|
||||
this.specificity = other.specificity;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.value = other.value;
|
||||
this.specificity = other.specificity;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003523 RID: 13603 RVA: 0x00057598 File Offset: 0x00055798
|
||||
public static implicit operator Style<T>(T value)
|
||||
{
|
||||
return new Style<T>(value);
|
||||
}
|
||||
|
||||
// Token: 0x06003524 RID: 13604 RVA: 0x000575B4 File Offset: 0x000557B4
|
||||
public static Style<T> Create(T value)
|
||||
{
|
||||
return new Style<T>(value, int.MaxValue);
|
||||
}
|
||||
|
||||
// Token: 0x06003525 RID: 13605 RVA: 0x000575D4 File Offset: 0x000557D4
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("[StyleProperty<{2}>: specifity={0}, value={1}]", this.specificity, this.value, typeof(T).Name);
|
||||
}
|
||||
|
||||
// Token: 0x04000B78 RID: 2936
|
||||
internal int specificity;
|
||||
|
||||
// Token: 0x04000B79 RID: 2937
|
||||
public T value;
|
||||
|
||||
// Token: 0x04000B7A RID: 2938
|
||||
private static readonly Style<T> defaultStyle = default(Style<T>);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.StyleSheets;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleSheets
|
||||
{
|
||||
// Token: 0x02000366 RID: 870
|
||||
internal static class StyleComplexSelectorExtensions
|
||||
{
|
||||
// Token: 0x06003527 RID: 13607 RVA: 0x00057634 File Offset: 0x00055834
|
||||
public static void CachePseudoStateMasks(this StyleComplexSelector complexSelector)
|
||||
{
|
||||
if (complexSelector.selectors[0].pseudoStateMask == -1)
|
||||
{
|
||||
if (StyleComplexSelectorExtensions.s_PseudoStates == null)
|
||||
{
|
||||
StyleComplexSelectorExtensions.s_PseudoStates = new Dictionary<string, StyleComplexSelectorExtensions.PseudoStateData>();
|
||||
StyleComplexSelectorExtensions.s_PseudoStates["active"] = new StyleComplexSelectorExtensions.PseudoStateData(PseudoStates.Active, false);
|
||||
StyleComplexSelectorExtensions.s_PseudoStates["hover"] = new StyleComplexSelectorExtensions.PseudoStateData(PseudoStates.Hover, false);
|
||||
StyleComplexSelectorExtensions.s_PseudoStates["checked"] = new StyleComplexSelectorExtensions.PseudoStateData(PseudoStates.Checked, false);
|
||||
StyleComplexSelectorExtensions.s_PseudoStates["selected"] = new StyleComplexSelectorExtensions.PseudoStateData(PseudoStates.Selected, false);
|
||||
StyleComplexSelectorExtensions.s_PseudoStates["disabled"] = new StyleComplexSelectorExtensions.PseudoStateData(PseudoStates.Disabled, false);
|
||||
StyleComplexSelectorExtensions.s_PseudoStates["focus"] = new StyleComplexSelectorExtensions.PseudoStateData(PseudoStates.Focus, false);
|
||||
StyleComplexSelectorExtensions.s_PseudoStates["inactive"] = new StyleComplexSelectorExtensions.PseudoStateData(PseudoStates.Active, true);
|
||||
StyleComplexSelectorExtensions.s_PseudoStates["enabled"] = new StyleComplexSelectorExtensions.PseudoStateData(PseudoStates.Disabled, true);
|
||||
}
|
||||
int i = 0;
|
||||
int num = complexSelector.selectors.Length;
|
||||
while (i < num)
|
||||
{
|
||||
StyleSelector styleSelector = complexSelector.selectors[i];
|
||||
StyleSelectorPart[] parts = styleSelector.parts;
|
||||
PseudoStates pseudoStates = (PseudoStates)0;
|
||||
PseudoStates pseudoStates2 = (PseudoStates)0;
|
||||
for (int j = 0; j < styleSelector.parts.Length; j++)
|
||||
{
|
||||
if (styleSelector.parts[j].type == StyleSelectorType.PseudoClass)
|
||||
{
|
||||
StyleComplexSelectorExtensions.PseudoStateData pseudoStateData;
|
||||
if (StyleComplexSelectorExtensions.s_PseudoStates.TryGetValue(parts[j].value, out pseudoStateData))
|
||||
{
|
||||
if (!pseudoStateData.negate)
|
||||
{
|
||||
pseudoStates |= pseudoStateData.state;
|
||||
}
|
||||
else
|
||||
{
|
||||
pseudoStates2 |= pseudoStateData.state;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarningFormat("Unknown pseudo class \"{0}\"", new object[] { parts[j].value });
|
||||
}
|
||||
}
|
||||
}
|
||||
styleSelector.pseudoStateMask = (int)pseudoStates;
|
||||
styleSelector.negatedPseudoStateMask = (int)pseudoStates2;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000B7B RID: 2939
|
||||
private static Dictionary<string, StyleComplexSelectorExtensions.PseudoStateData> s_PseudoStates;
|
||||
|
||||
// Token: 0x02000367 RID: 871
|
||||
private struct PseudoStateData
|
||||
{
|
||||
// Token: 0x06003528 RID: 13608 RVA: 0x00057810 File Offset: 0x00055A10
|
||||
public PseudoStateData(PseudoStates state, bool negate)
|
||||
{
|
||||
this.state = state;
|
||||
this.negate = negate;
|
||||
}
|
||||
|
||||
// Token: 0x04000B7C RID: 2940
|
||||
public readonly PseudoStates state;
|
||||
|
||||
// Token: 0x04000B7D RID: 2941
|
||||
public readonly bool negate;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,297 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.StyleSheets;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleSheets
|
||||
{
|
||||
// Token: 0x02000369 RID: 873
|
||||
internal class StyleContext
|
||||
{
|
||||
// Token: 0x06003529 RID: 13609 RVA: 0x00057824 File Offset: 0x00055A24
|
||||
public StyleContext(VisualContainer tree)
|
||||
{
|
||||
this.m_VisualTree = tree;
|
||||
this.m_Matchers = new List<RuleMatcher>(0);
|
||||
this.m_MatchedRules = new List<StyleContext.RuleRef>(0);
|
||||
}
|
||||
|
||||
// Token: 0x17000C38 RID: 3128
|
||||
// (get) Token: 0x0600352A RID: 13610 RVA: 0x0005784C File Offset: 0x00055A4C
|
||||
// (set) Token: 0x0600352B RID: 13611 RVA: 0x00057868 File Offset: 0x00055A68
|
||||
public float currentPixelsPerPoint { get; set; }
|
||||
|
||||
// Token: 0x0600352C RID: 13612 RVA: 0x00057874 File Offset: 0x00055A74
|
||||
private void AddMatchersFromSheet(IEnumerable<StyleSheet> styleSheets)
|
||||
{
|
||||
foreach (StyleSheet styleSheet in styleSheets)
|
||||
{
|
||||
this.PushStyleSheet(styleSheet);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600352D RID: 13613 RVA: 0x000578CC File Offset: 0x00055ACC
|
||||
internal void GetMatchersFor(VisualElement element, List<RuleMatcher> ruleMatchers, List<StyleSheet> stylesheets)
|
||||
{
|
||||
List<VisualElement> list = new List<VisualElement>();
|
||||
list.Add(element);
|
||||
VisualContainer visualContainer = element as VisualContainer;
|
||||
if (visualContainer == null)
|
||||
{
|
||||
visualContainer = element.parent;
|
||||
}
|
||||
while (visualContainer != null)
|
||||
{
|
||||
if (visualContainer.styleSheets != null)
|
||||
{
|
||||
stylesheets.AddRange(visualContainer.styleSheets);
|
||||
this.AddMatchersFromSheet(visualContainer.styleSheets);
|
||||
}
|
||||
list.Add(visualContainer);
|
||||
visualContainer = visualContainer.parent;
|
||||
}
|
||||
int num = 0;
|
||||
for (int i = list.Count - 1; i >= 0; i--)
|
||||
{
|
||||
this.GetMatchersFor(list, i, num++, ruleMatchers);
|
||||
}
|
||||
this.m_Matchers.Clear();
|
||||
}
|
||||
|
||||
// Token: 0x0600352E RID: 13614 RVA: 0x00057974 File Offset: 0x00055B74
|
||||
private void GetMatchersFor(List<VisualElement> elements, int idx, int depth, List<RuleMatcher> ruleMatchers)
|
||||
{
|
||||
VisualElement visualElement = elements[idx];
|
||||
int count = this.m_Matchers.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
RuleMatcher ruleMatcher = this.m_Matchers[i];
|
||||
if (ruleMatcher.depth >= depth && StyleContext.Match(visualElement, ref ruleMatcher))
|
||||
{
|
||||
StyleSelector[] selectors = ruleMatcher.complexSelector.selectors;
|
||||
int num = ruleMatcher.simpleSelectorIndex + 1;
|
||||
int num2 = selectors.Length;
|
||||
if (num < num2)
|
||||
{
|
||||
RuleMatcher ruleMatcher2 = new RuleMatcher
|
||||
{
|
||||
complexSelector = ruleMatcher.complexSelector,
|
||||
depth = ((selectors[num].previousRelationship != StyleSelectorRelationship.Child) ? int.MaxValue : (depth + 1)),
|
||||
simpleSelectorIndex = num,
|
||||
sheet = ruleMatcher.sheet
|
||||
};
|
||||
this.m_Matchers.Add(ruleMatcher2);
|
||||
}
|
||||
else if (idx == 0)
|
||||
{
|
||||
ruleMatchers.Add(ruleMatcher);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600352F RID: 13615 RVA: 0x00057A78 File Offset: 0x00055C78
|
||||
private void PushStyleSheet(StyleSheet styleSheetData)
|
||||
{
|
||||
StyleComplexSelector[] complexSelectors = styleSheetData.complexSelectors;
|
||||
int num = this.m_Matchers.Count + complexSelectors.Length;
|
||||
this.m_Matchers.Capacity = Math.Max(this.m_Matchers.Capacity, num);
|
||||
foreach (StyleComplexSelector styleComplexSelector in complexSelectors)
|
||||
{
|
||||
this.m_Matchers.Add(new RuleMatcher
|
||||
{
|
||||
sheet = styleSheetData,
|
||||
complexSelector = styleComplexSelector,
|
||||
simpleSelectorIndex = 0,
|
||||
depth = int.MaxValue
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003530 RID: 13616 RVA: 0x00057B0C File Offset: 0x00055D0C
|
||||
public void DirtyStyleSheets()
|
||||
{
|
||||
StyleContext.PropagateDirtyStyleSheets(this.m_VisualTree);
|
||||
}
|
||||
|
||||
// Token: 0x06003531 RID: 13617 RVA: 0x00057B1C File Offset: 0x00055D1C
|
||||
private static void PropagateDirtyStyleSheets(VisualElement e)
|
||||
{
|
||||
VisualContainer visualContainer = e as VisualContainer;
|
||||
if (visualContainer != null)
|
||||
{
|
||||
if (visualContainer.styleSheets != null)
|
||||
{
|
||||
visualContainer.LoadStyleSheetsFromPaths();
|
||||
}
|
||||
foreach (VisualElement visualElement in visualContainer)
|
||||
{
|
||||
StyleContext.PropagateDirtyStyleSheets(visualElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003532 RID: 13618 RVA: 0x00057B98 File Offset: 0x00055D98
|
||||
public void ApplyStyles(VisualContainer subTree)
|
||||
{
|
||||
Debug.Assert(subTree.panel != null);
|
||||
this.UpdateStyles(subTree, 0);
|
||||
this.m_Matchers.Clear();
|
||||
}
|
||||
|
||||
// Token: 0x06003533 RID: 13619 RVA: 0x00057BC0 File Offset: 0x00055DC0
|
||||
public void ApplyStyles()
|
||||
{
|
||||
this.ApplyStyles(this.m_VisualTree);
|
||||
}
|
||||
|
||||
// Token: 0x06003534 RID: 13620 RVA: 0x00057BD0 File Offset: 0x00055DD0
|
||||
private void UpdateStyles(VisualElement element, int depth)
|
||||
{
|
||||
if (element.IsDirty(ChangeType.Styles) || element.IsDirty(ChangeType.StylesPath))
|
||||
{
|
||||
VisualContainer visualContainer = element as VisualContainer;
|
||||
int count = this.m_Matchers.Count;
|
||||
if (visualContainer != null && visualContainer.styleSheets != null)
|
||||
{
|
||||
this.AddMatchersFromSheet(visualContainer.styleSheets);
|
||||
}
|
||||
string fullTypeName = element.fullTypeName;
|
||||
long num = (long)fullTypeName.GetHashCode();
|
||||
num = (num * 397L) ^ (long)this.currentPixelsPerPoint.GetHashCode();
|
||||
this.m_MatchedRules.Clear();
|
||||
int count2 = this.m_Matchers.Count;
|
||||
for (int i = 0; i < count2; i++)
|
||||
{
|
||||
RuleMatcher ruleMatcher = this.m_Matchers[i];
|
||||
if (ruleMatcher.depth >= depth && StyleContext.Match(element, ref ruleMatcher))
|
||||
{
|
||||
StyleSelector[] selectors = ruleMatcher.complexSelector.selectors;
|
||||
int num2 = ruleMatcher.simpleSelectorIndex + 1;
|
||||
int num3 = selectors.Length;
|
||||
if (num2 < num3)
|
||||
{
|
||||
RuleMatcher ruleMatcher2 = new RuleMatcher
|
||||
{
|
||||
complexSelector = ruleMatcher.complexSelector,
|
||||
depth = ((selectors[num2].previousRelationship != StyleSelectorRelationship.Child) ? int.MaxValue : (depth + 1)),
|
||||
simpleSelectorIndex = num2,
|
||||
sheet = ruleMatcher.sheet
|
||||
};
|
||||
this.m_Matchers.Add(ruleMatcher2);
|
||||
}
|
||||
else
|
||||
{
|
||||
StyleRule rule = ruleMatcher.complexSelector.rule;
|
||||
int specificity = ruleMatcher.complexSelector.specificity;
|
||||
num = (num * 397L) ^ (long)rule.GetHashCode();
|
||||
num = (num * 397L) ^ (long)specificity;
|
||||
this.m_MatchedRules.Add(new StyleContext.RuleRef
|
||||
{
|
||||
selector = ruleMatcher.complexSelector,
|
||||
sheet = ruleMatcher.sheet
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
VisualElementStyles visualElementStyles;
|
||||
if (StyleContext.s_StyleCache.TryGetValue(num, out visualElementStyles))
|
||||
{
|
||||
element.SetSharedStyles(visualElementStyles);
|
||||
}
|
||||
else
|
||||
{
|
||||
visualElementStyles = new VisualElementStyles(true);
|
||||
int j = 0;
|
||||
int count3 = this.m_MatchedRules.Count;
|
||||
while (j < count3)
|
||||
{
|
||||
StyleContext.RuleRef ruleRef = this.m_MatchedRules[j];
|
||||
StylePropertyID[] propertyIDs = StyleSheetCache.GetPropertyIDs(ruleRef.sheet, ruleRef.selector.ruleIndex);
|
||||
visualElementStyles.ApplyRule(ruleRef.sheet, ruleRef.selector.specificity, ruleRef.selector.rule, propertyIDs, this.m_VisualTree.elementPanel.loadResourceFunc);
|
||||
j++;
|
||||
}
|
||||
StyleContext.s_StyleCache[num] = visualElementStyles;
|
||||
element.SetSharedStyles(visualElementStyles);
|
||||
}
|
||||
if (visualContainer != null)
|
||||
{
|
||||
for (int k = 0; k < visualContainer.childrenCount; k++)
|
||||
{
|
||||
VisualElement childAt = visualContainer.GetChildAt(k);
|
||||
this.UpdateStyles(childAt, depth + 1);
|
||||
}
|
||||
}
|
||||
if (this.m_Matchers.Count > count)
|
||||
{
|
||||
this.m_Matchers.RemoveRange(count, this.m_Matchers.Count - count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003535 RID: 13621 RVA: 0x00057EF0 File Offset: 0x000560F0
|
||||
private static bool Match(VisualElement element, ref RuleMatcher matcher)
|
||||
{
|
||||
bool flag = true;
|
||||
StyleSelector styleSelector = matcher.complexSelector.selectors[matcher.simpleSelectorIndex];
|
||||
int num = styleSelector.parts.Length;
|
||||
int num2 = 0;
|
||||
while (num2 < num && flag)
|
||||
{
|
||||
switch (styleSelector.parts[num2].type)
|
||||
{
|
||||
case StyleSelectorType.Wildcard:
|
||||
break;
|
||||
case StyleSelectorType.Type:
|
||||
flag = element.typeName == styleSelector.parts[num2].value;
|
||||
break;
|
||||
case StyleSelectorType.Class:
|
||||
flag = element.ClassListContains(styleSelector.parts[num2].value);
|
||||
break;
|
||||
case StyleSelectorType.PseudoClass:
|
||||
{
|
||||
int pseudoStates = (int)element.pseudoStates;
|
||||
flag = (styleSelector.pseudoStateMask & pseudoStates) == styleSelector.pseudoStateMask;
|
||||
flag &= (styleSelector.negatedPseudoStateMask & ~pseudoStates) == styleSelector.negatedPseudoStateMask;
|
||||
break;
|
||||
}
|
||||
case StyleSelectorType.RecursivePseudoClass:
|
||||
goto IL_FA;
|
||||
case StyleSelectorType.ID:
|
||||
flag = element.name == styleSelector.parts[num2].value;
|
||||
break;
|
||||
default:
|
||||
goto IL_FA;
|
||||
}
|
||||
IL_101:
|
||||
num2++;
|
||||
continue;
|
||||
IL_FA:
|
||||
flag = false;
|
||||
goto IL_101;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x04000B83 RID: 2947
|
||||
private List<RuleMatcher> m_Matchers;
|
||||
|
||||
// Token: 0x04000B84 RID: 2948
|
||||
private List<StyleContext.RuleRef> m_MatchedRules;
|
||||
|
||||
// Token: 0x04000B85 RID: 2949
|
||||
private VisualContainer m_VisualTree;
|
||||
|
||||
// Token: 0x04000B86 RID: 2950
|
||||
private static Dictionary<long, VisualElementStyles> s_StyleCache = new Dictionary<long, VisualElementStyles>();
|
||||
|
||||
// Token: 0x0200036A RID: 874
|
||||
private struct RuleRef
|
||||
{
|
||||
// Token: 0x04000B87 RID: 2951
|
||||
public StyleComplexSelector selector;
|
||||
|
||||
// Token: 0x04000B88 RID: 2952
|
||||
public StyleSheet sheet;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleSheets
|
||||
{
|
||||
// Token: 0x02000364 RID: 868
|
||||
internal enum StylePropertyApplyMode
|
||||
{
|
||||
// Token: 0x04000B75 RID: 2933
|
||||
Copy,
|
||||
// Token: 0x04000B76 RID: 2934
|
||||
CopyIfMoreSpecific,
|
||||
// Token: 0x04000B77 RID: 2935
|
||||
CopyIfNotInline
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleSheets
|
||||
{
|
||||
// Token: 0x02000363 RID: 867
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
|
||||
internal class StylePropertyAttribute : Attribute
|
||||
{
|
||||
// Token: 0x0600351A RID: 13594 RVA: 0x0005742C File Offset: 0x0005562C
|
||||
internal StylePropertyAttribute(string propertyName, StylePropertyID propertyID)
|
||||
{
|
||||
this.propertyName = propertyName;
|
||||
this.propertyID = propertyID;
|
||||
}
|
||||
|
||||
// Token: 0x0600351B RID: 13595 RVA: 0x00057444 File Offset: 0x00055644
|
||||
public StylePropertyAttribute(string propertyName)
|
||||
: this(propertyName, StylePropertyID.Custom)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600351C RID: 13596 RVA: 0x00057450 File Offset: 0x00055650
|
||||
public StylePropertyAttribute()
|
||||
: this(string.Empty)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x04000B72 RID: 2930
|
||||
internal string propertyName;
|
||||
|
||||
// Token: 0x04000B73 RID: 2931
|
||||
internal StylePropertyID propertyID;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleSheets
|
||||
{
|
||||
// Token: 0x02000362 RID: 866
|
||||
internal enum StylePropertyID
|
||||
{
|
||||
// Token: 0x04000B3F RID: 2879
|
||||
Unknown = -1,
|
||||
// Token: 0x04000B40 RID: 2880
|
||||
MarginLeft,
|
||||
// Token: 0x04000B41 RID: 2881
|
||||
MarginTop,
|
||||
// Token: 0x04000B42 RID: 2882
|
||||
MarginRight,
|
||||
// Token: 0x04000B43 RID: 2883
|
||||
MarginBottom,
|
||||
// Token: 0x04000B44 RID: 2884
|
||||
PaddingLeft,
|
||||
// Token: 0x04000B45 RID: 2885
|
||||
PaddingTop,
|
||||
// Token: 0x04000B46 RID: 2886
|
||||
PaddingRight,
|
||||
// Token: 0x04000B47 RID: 2887
|
||||
PaddingBottom,
|
||||
// Token: 0x04000B48 RID: 2888
|
||||
BorderLeft,
|
||||
// Token: 0x04000B49 RID: 2889
|
||||
BorderTop,
|
||||
// Token: 0x04000B4A RID: 2890
|
||||
BorderRight,
|
||||
// Token: 0x04000B4B RID: 2891
|
||||
BorderBottom,
|
||||
// Token: 0x04000B4C RID: 2892
|
||||
PositionType,
|
||||
// Token: 0x04000B4D RID: 2893
|
||||
PositionLeft,
|
||||
// Token: 0x04000B4E RID: 2894
|
||||
PositionTop,
|
||||
// Token: 0x04000B4F RID: 2895
|
||||
PositionRight,
|
||||
// Token: 0x04000B50 RID: 2896
|
||||
PositionBottom,
|
||||
// Token: 0x04000B51 RID: 2897
|
||||
Width,
|
||||
// Token: 0x04000B52 RID: 2898
|
||||
Height,
|
||||
// Token: 0x04000B53 RID: 2899
|
||||
MinWidth,
|
||||
// Token: 0x04000B54 RID: 2900
|
||||
MinHeight,
|
||||
// Token: 0x04000B55 RID: 2901
|
||||
MaxWidth,
|
||||
// Token: 0x04000B56 RID: 2902
|
||||
MaxHeight,
|
||||
// Token: 0x04000B57 RID: 2903
|
||||
Flex,
|
||||
// Token: 0x04000B58 RID: 2904
|
||||
BorderWidth,
|
||||
// Token: 0x04000B59 RID: 2905
|
||||
BorderRadius,
|
||||
// Token: 0x04000B5A RID: 2906
|
||||
FlexDirection,
|
||||
// Token: 0x04000B5B RID: 2907
|
||||
FlexWrap,
|
||||
// Token: 0x04000B5C RID: 2908
|
||||
JustifyContent,
|
||||
// Token: 0x04000B5D RID: 2909
|
||||
AlignContent,
|
||||
// Token: 0x04000B5E RID: 2910
|
||||
AlignSelf,
|
||||
// Token: 0x04000B5F RID: 2911
|
||||
AlignItems,
|
||||
// Token: 0x04000B60 RID: 2912
|
||||
TextAlignment,
|
||||
// Token: 0x04000B61 RID: 2913
|
||||
TextClipping,
|
||||
// Token: 0x04000B62 RID: 2914
|
||||
Font,
|
||||
// Token: 0x04000B63 RID: 2915
|
||||
FontSize,
|
||||
// Token: 0x04000B64 RID: 2916
|
||||
FontStyle,
|
||||
// Token: 0x04000B65 RID: 2917
|
||||
BackgroundSize,
|
||||
// Token: 0x04000B66 RID: 2918
|
||||
WordWrap,
|
||||
// Token: 0x04000B67 RID: 2919
|
||||
BackgroundImage,
|
||||
// Token: 0x04000B68 RID: 2920
|
||||
TextColor,
|
||||
// Token: 0x04000B69 RID: 2921
|
||||
BackgroundColor,
|
||||
// Token: 0x04000B6A RID: 2922
|
||||
BorderColor,
|
||||
// Token: 0x04000B6B RID: 2923
|
||||
Overflow,
|
||||
// Token: 0x04000B6C RID: 2924
|
||||
SliceLeft,
|
||||
// Token: 0x04000B6D RID: 2925
|
||||
SliceTop,
|
||||
// Token: 0x04000B6E RID: 2926
|
||||
SliceRight,
|
||||
// Token: 0x04000B6F RID: 2927
|
||||
SliceBottom,
|
||||
// Token: 0x04000B70 RID: 2928
|
||||
Opacity,
|
||||
// Token: 0x04000B71 RID: 2929
|
||||
Custom
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using UnityEngine.StyleSheets;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleSheets
|
||||
{
|
||||
// Token: 0x0200036B RID: 875
|
||||
internal static class StyleSheetCache
|
||||
{
|
||||
// Token: 0x06003537 RID: 13623 RVA: 0x00058028 File Offset: 0x00056228
|
||||
static StyleSheetCache()
|
||||
{
|
||||
FieldInfo[] fields = typeof(VisualElementStyles).GetFields();
|
||||
foreach (FieldInfo fieldInfo in fields)
|
||||
{
|
||||
StylePropertyAttribute stylePropertyAttribute = (StylePropertyAttribute)Attribute.GetCustomAttribute(fieldInfo, typeof(StylePropertyAttribute));
|
||||
if (stylePropertyAttribute != null)
|
||||
{
|
||||
StyleSheetCache.s_NameToIDCache.Add(stylePropertyAttribute.propertyName, stylePropertyAttribute.propertyID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003538 RID: 13624 RVA: 0x000580D0 File Offset: 0x000562D0
|
||||
internal static void ClearCaches()
|
||||
{
|
||||
StyleSheetCache.s_EnumToIntCache.Clear();
|
||||
StyleSheetCache.s_RulePropertyIDsCache.Clear();
|
||||
}
|
||||
|
||||
// Token: 0x06003539 RID: 13625 RVA: 0x000580E8 File Offset: 0x000562E8
|
||||
internal static int GetEnumValue<T>(StyleSheet sheet, StyleValueHandle handle)
|
||||
{
|
||||
Debug.Assert(handle.valueType == StyleValueType.Enum);
|
||||
StyleSheetCache.SheetHandleKey sheetHandleKey = new StyleSheetCache.SheetHandleKey(sheet, handle.valueIndex);
|
||||
int num;
|
||||
if (!StyleSheetCache.s_EnumToIntCache.TryGetValue(sheetHandleKey, out num))
|
||||
{
|
||||
string text = sheet.ReadEnum(handle).Replace("-", string.Empty);
|
||||
object obj = Enum.Parse(typeof(T), text, true);
|
||||
num = (int)obj;
|
||||
StyleSheetCache.s_EnumToIntCache.Add(sheetHandleKey, num);
|
||||
}
|
||||
Debug.Assert(Enum.GetName(typeof(T), num) != null);
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x0600353A RID: 13626 RVA: 0x00058190 File Offset: 0x00056390
|
||||
internal static StylePropertyID[] GetPropertyIDs(StyleSheet sheet, int ruleIndex)
|
||||
{
|
||||
StyleSheetCache.SheetHandleKey sheetHandleKey = new StyleSheetCache.SheetHandleKey(sheet, ruleIndex);
|
||||
StylePropertyID[] array;
|
||||
if (!StyleSheetCache.s_RulePropertyIDsCache.TryGetValue(sheetHandleKey, out array))
|
||||
{
|
||||
StyleRule styleRule = sheet.rules[ruleIndex];
|
||||
array = new StylePropertyID[styleRule.properties.Length];
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
array[i] = StyleSheetCache.GetPropertyID(styleRule.properties[i].name);
|
||||
}
|
||||
StyleSheetCache.s_RulePropertyIDsCache.Add(sheetHandleKey, array);
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
// Token: 0x0600353B RID: 13627 RVA: 0x00058214 File Offset: 0x00056414
|
||||
private static StylePropertyID GetPropertyID(string name)
|
||||
{
|
||||
StylePropertyID stylePropertyID;
|
||||
if (!StyleSheetCache.s_NameToIDCache.TryGetValue(name, out stylePropertyID))
|
||||
{
|
||||
stylePropertyID = StylePropertyID.Custom;
|
||||
}
|
||||
return stylePropertyID;
|
||||
}
|
||||
|
||||
// Token: 0x04000B89 RID: 2953
|
||||
private static StyleSheetCache.SheetHandleKeyComparer s_Comparer = new StyleSheetCache.SheetHandleKeyComparer();
|
||||
|
||||
// Token: 0x04000B8A RID: 2954
|
||||
private static Dictionary<StyleSheetCache.SheetHandleKey, int> s_EnumToIntCache = new Dictionary<StyleSheetCache.SheetHandleKey, int>(StyleSheetCache.s_Comparer);
|
||||
|
||||
// Token: 0x04000B8B RID: 2955
|
||||
private static Dictionary<StyleSheetCache.SheetHandleKey, StylePropertyID[]> s_RulePropertyIDsCache = new Dictionary<StyleSheetCache.SheetHandleKey, StylePropertyID[]>(StyleSheetCache.s_Comparer);
|
||||
|
||||
// Token: 0x04000B8C RID: 2956
|
||||
private static Dictionary<string, StylePropertyID> s_NameToIDCache = new Dictionary<string, StylePropertyID>();
|
||||
|
||||
// Token: 0x0200036C RID: 876
|
||||
private struct SheetHandleKey
|
||||
{
|
||||
// Token: 0x0600353C RID: 13628 RVA: 0x00058244 File Offset: 0x00056444
|
||||
public SheetHandleKey(StyleSheet sheet, int index)
|
||||
{
|
||||
this.sheetInstanceID = sheet.GetInstanceID();
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
// Token: 0x04000B8D RID: 2957
|
||||
public readonly int sheetInstanceID;
|
||||
|
||||
// Token: 0x04000B8E RID: 2958
|
||||
public readonly int index;
|
||||
}
|
||||
|
||||
// Token: 0x0200036D RID: 877
|
||||
private class SheetHandleKeyComparer : IEqualityComparer<StyleSheetCache.SheetHandleKey>
|
||||
{
|
||||
// Token: 0x0600353E RID: 13630 RVA: 0x00058264 File Offset: 0x00056464
|
||||
public bool Equals(StyleSheetCache.SheetHandleKey x, StyleSheetCache.SheetHandleKey y)
|
||||
{
|
||||
return x.sheetInstanceID == y.sheetInstanceID && x.index == y.index;
|
||||
}
|
||||
|
||||
// Token: 0x0600353F RID: 13631 RVA: 0x000582A0 File Offset: 0x000564A0
|
||||
public int GetHashCode(StyleSheetCache.SheetHandleKey key)
|
||||
{
|
||||
return key.sheetInstanceID.GetHashCode() ^ key.index.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
using System;
|
||||
using UnityEngine.StyleSheets;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleSheets
|
||||
{
|
||||
// Token: 0x02000371 RID: 881
|
||||
internal static class StyleSheetExtensions
|
||||
{
|
||||
// Token: 0x06003556 RID: 13654 RVA: 0x0005920C File Offset: 0x0005740C
|
||||
public static void Apply(this StyleSheet sheet, StyleValueHandle handle, int specificity, ref Style<float> property)
|
||||
{
|
||||
if (handle.valueType == StyleValueType.Keyword && handle.valueIndex == 2)
|
||||
{
|
||||
StyleSheetExtensions.Apply<float>(0f, specificity, ref property);
|
||||
}
|
||||
else
|
||||
{
|
||||
StyleSheetExtensions.Apply<float>(sheet.ReadFloat(handle), specificity, ref property);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003557 RID: 13655 RVA: 0x0005924C File Offset: 0x0005744C
|
||||
public static void Apply(this StyleSheet sheet, StyleValueHandle handle, int specificity, ref Style<Color> property)
|
||||
{
|
||||
if (handle.valueType == StyleValueType.Keyword && handle.valueIndex == 2)
|
||||
{
|
||||
StyleSheetExtensions.Apply<Color>(default(Color), specificity, ref property);
|
||||
}
|
||||
else
|
||||
{
|
||||
StyleSheetExtensions.Apply<Color>(sheet.ReadColor(handle), specificity, ref property);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003558 RID: 13656 RVA: 0x0005929C File Offset: 0x0005749C
|
||||
public static void Apply(this StyleSheet sheet, StyleValueHandle handle, int specificity, ref Style<int> property)
|
||||
{
|
||||
if (handle.valueType == StyleValueType.Keyword && handle.valueIndex == 2)
|
||||
{
|
||||
StyleSheetExtensions.Apply<int>(0, specificity, ref property);
|
||||
}
|
||||
else
|
||||
{
|
||||
StyleSheetExtensions.Apply<int>((int)sheet.ReadFloat(handle), specificity, ref property);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003559 RID: 13657 RVA: 0x000592D8 File Offset: 0x000574D8
|
||||
public static void Apply(this StyleSheet sheet, StyleValueHandle handle, int specificity, ref Style<bool> property)
|
||||
{
|
||||
bool flag = sheet.ReadKeyword(handle) == StyleValueKeyword.True;
|
||||
if (handle.valueType == StyleValueType.Keyword && handle.valueIndex == 2)
|
||||
{
|
||||
StyleSheetExtensions.Apply<bool>(false, specificity, ref property);
|
||||
}
|
||||
else
|
||||
{
|
||||
StyleSheetExtensions.Apply<bool>(flag, specificity, ref property);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600355A RID: 13658 RVA: 0x00059324 File Offset: 0x00057524
|
||||
public static void Apply<T>(this StyleSheet sheet, StyleValueHandle handle, int specificity, ref Style<int> property) where T : struct
|
||||
{
|
||||
if (handle.valueType == StyleValueType.Keyword && handle.valueIndex == 2)
|
||||
{
|
||||
StyleSheetExtensions.Apply<int>(0, specificity, ref property);
|
||||
}
|
||||
else
|
||||
{
|
||||
StyleSheetExtensions.Apply<int>(StyleSheetCache.GetEnumValue<T>(sheet, handle), specificity, ref property);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600355B RID: 13659 RVA: 0x00059360 File Offset: 0x00057560
|
||||
public static void Apply<T>(this StyleSheet sheet, StyleValueHandle handle, int specificity, LoadResourceFunction loadResourceFunc, ref Style<T> property) where T : Object
|
||||
{
|
||||
if (handle.valueType == StyleValueType.Keyword && handle.valueIndex == 5)
|
||||
{
|
||||
StyleSheetExtensions.Apply<T>((T)((object)null), specificity, ref property);
|
||||
}
|
||||
else
|
||||
{
|
||||
string text = sheet.ReadResourcePath(handle);
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
T t = loadResourceFunc(text, typeof(T)) as T;
|
||||
if (t != null)
|
||||
{
|
||||
StyleSheetExtensions.Apply<T>(t, specificity, ref property);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning(string.Format("{0} resource not found for path: {1}", typeof(T).Name, text));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600355C RID: 13660 RVA: 0x00059410 File Offset: 0x00057610
|
||||
private static void Apply<T>(T val, int specificity, ref Style<T> property)
|
||||
{
|
||||
property.Apply(new Style<T>(val, specificity), StylePropertyApplyMode.CopyIfMoreSpecific);
|
||||
}
|
||||
|
||||
// Token: 0x0600355D RID: 13661 RVA: 0x00059424 File Offset: 0x00057624
|
||||
public static string ReadAsString(this StyleSheet sheet, StyleValueHandle handle)
|
||||
{
|
||||
string text = string.Empty;
|
||||
switch (handle.valueType)
|
||||
{
|
||||
case StyleValueType.Keyword:
|
||||
text = sheet.ReadKeyword(handle).ToString();
|
||||
break;
|
||||
case StyleValueType.Float:
|
||||
text = sheet.ReadFloat(handle).ToString();
|
||||
break;
|
||||
case StyleValueType.Color:
|
||||
text = sheet.ReadColor(handle).ToString();
|
||||
break;
|
||||
case StyleValueType.ResourcePath:
|
||||
text = sheet.ReadResourcePath(handle);
|
||||
break;
|
||||
case StyleValueType.Enum:
|
||||
text = sheet.ReadEnum(handle);
|
||||
break;
|
||||
case StyleValueType.String:
|
||||
text = sheet.ReadString(handle);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException("Unhandled type " + handle.valueType);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,630 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Experimental.UIElements.StyleEnums;
|
||||
using UnityEngine.StyleSheets;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements.StyleSheets
|
||||
{
|
||||
// Token: 0x02000370 RID: 880
|
||||
internal class VisualElementStyles : ICustomStyles
|
||||
{
|
||||
// Token: 0x06003546 RID: 13638 RVA: 0x000582E4 File Offset: 0x000564E4
|
||||
internal VisualElementStyles(bool isShared)
|
||||
{
|
||||
this.isShared = isShared;
|
||||
}
|
||||
|
||||
// Token: 0x06003547 RID: 13639 RVA: 0x000582F4 File Offset: 0x000564F4
|
||||
public VisualElementStyles(VisualElementStyles other, bool isShared)
|
||||
: this(isShared)
|
||||
{
|
||||
this.Apply(other, StylePropertyApplyMode.Copy);
|
||||
}
|
||||
|
||||
// Token: 0x06003548 RID: 13640 RVA: 0x00058308 File Offset: 0x00056508
|
||||
internal void Apply(VisualElementStyles other, StylePropertyApplyMode mode)
|
||||
{
|
||||
this.m_CustomProperties = other.m_CustomProperties;
|
||||
this.width.Apply(other.width, mode);
|
||||
this.height.Apply(other.height, mode);
|
||||
this.maxWidth.Apply(other.maxWidth, mode);
|
||||
this.maxHeight.Apply(other.maxHeight, mode);
|
||||
this.minWidth.Apply(other.minWidth, mode);
|
||||
this.minHeight.Apply(other.minHeight, mode);
|
||||
this.flex.Apply(other.flex, mode);
|
||||
this.overflow.Apply(other.overflow, mode);
|
||||
this.positionLeft.Apply(other.positionLeft, mode);
|
||||
this.positionTop.Apply(other.positionTop, mode);
|
||||
this.positionRight.Apply(other.positionRight, mode);
|
||||
this.positionBottom.Apply(other.positionBottom, mode);
|
||||
this.marginLeft.Apply(other.marginLeft, mode);
|
||||
this.marginTop.Apply(other.marginTop, mode);
|
||||
this.marginRight.Apply(other.marginRight, mode);
|
||||
this.marginBottom.Apply(other.marginBottom, mode);
|
||||
this.borderLeft.Apply(other.borderLeft, mode);
|
||||
this.borderTop.Apply(other.borderTop, mode);
|
||||
this.borderRight.Apply(other.borderRight, mode);
|
||||
this.borderBottom.Apply(other.borderBottom, mode);
|
||||
this.paddingLeft.Apply(other.paddingLeft, mode);
|
||||
this.paddingTop.Apply(other.paddingTop, mode);
|
||||
this.paddingRight.Apply(other.paddingRight, mode);
|
||||
this.paddingBottom.Apply(other.paddingBottom, mode);
|
||||
this.positionType.Apply(other.positionType, mode);
|
||||
this.alignSelf.Apply(other.alignSelf, mode);
|
||||
this.textAlignment.Apply(other.textAlignment, mode);
|
||||
this.fontStyle.Apply(other.fontStyle, mode);
|
||||
this.textClipping.Apply(other.textClipping, mode);
|
||||
this.fontSize.Apply(other.fontSize, mode);
|
||||
this.font.Apply(other.font, mode);
|
||||
this.wordWrap.Apply(other.wordWrap, mode);
|
||||
this.textColor.Apply(other.textColor, mode);
|
||||
this.flexDirection.Apply(other.flexDirection, mode);
|
||||
this.backgroundColor.Apply(other.backgroundColor, mode);
|
||||
this.borderColor.Apply(other.borderColor, mode);
|
||||
this.backgroundImage.Apply(other.backgroundImage, mode);
|
||||
this.backgroundSize.Apply(other.backgroundSize, mode);
|
||||
this.alignItems.Apply(other.alignItems, mode);
|
||||
this.alignContent.Apply(other.alignContent, mode);
|
||||
this.justifyContent.Apply(other.justifyContent, mode);
|
||||
this.flexWrap.Apply(other.flexWrap, mode);
|
||||
this.borderWidth.Apply(other.borderWidth, mode);
|
||||
this.borderRadius.Apply(other.borderRadius, mode);
|
||||
this.sliceLeft.Apply(other.sliceLeft, mode);
|
||||
this.sliceTop.Apply(other.sliceTop, mode);
|
||||
this.sliceRight.Apply(other.sliceRight, mode);
|
||||
this.sliceBottom.Apply(other.sliceBottom, mode);
|
||||
this.opacity.Apply(other.opacity, mode);
|
||||
}
|
||||
|
||||
// Token: 0x06003549 RID: 13641 RVA: 0x00058694 File Offset: 0x00056894
|
||||
public void WriteToGUIStyle(GUIStyle style)
|
||||
{
|
||||
style.alignment = (TextAnchor)this.textAlignment.GetSpecifiedValueOrDefault((int)style.alignment);
|
||||
style.wordWrap = this.wordWrap.GetSpecifiedValueOrDefault(style.wordWrap);
|
||||
style.clipping = (TextClipping)this.textClipping.GetSpecifiedValueOrDefault((int)style.clipping);
|
||||
if (this.font.value != null)
|
||||
{
|
||||
style.font = this.font.value;
|
||||
}
|
||||
style.fontSize = this.fontSize.GetSpecifiedValueOrDefault(style.fontSize);
|
||||
style.fontStyle = (FontStyle)this.fontStyle.GetSpecifiedValueOrDefault((int)style.fontStyle);
|
||||
this.AssignRect(style.margin, ref this.marginLeft, ref this.marginTop, ref this.marginRight, ref this.marginBottom);
|
||||
this.AssignRect(style.padding, ref this.paddingLeft, ref this.paddingTop, ref this.paddingRight, ref this.paddingBottom);
|
||||
this.AssignRect(style.border, ref this.sliceLeft, ref this.sliceTop, ref this.sliceRight, ref this.sliceBottom);
|
||||
this.AssignState(style.normal);
|
||||
this.AssignState(style.focused);
|
||||
this.AssignState(style.hover);
|
||||
this.AssignState(style.active);
|
||||
this.AssignState(style.onNormal);
|
||||
this.AssignState(style.onFocused);
|
||||
this.AssignState(style.onHover);
|
||||
this.AssignState(style.onActive);
|
||||
}
|
||||
|
||||
// Token: 0x0600354A RID: 13642 RVA: 0x0005880C File Offset: 0x00056A0C
|
||||
private void AssignState(GUIStyleState state)
|
||||
{
|
||||
state.textColor = this.textColor.GetSpecifiedValueOrDefault(state.textColor);
|
||||
if (this.backgroundImage.value != null)
|
||||
{
|
||||
state.background = this.backgroundImage.value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600354B RID: 13643 RVA: 0x0005885C File Offset: 0x00056A5C
|
||||
private void AssignRect(RectOffset rect, ref Style<int> left, ref Style<int> top, ref Style<int> right, ref Style<int> bottom)
|
||||
{
|
||||
rect.left = left.GetSpecifiedValueOrDefault(rect.left);
|
||||
rect.top = top.GetSpecifiedValueOrDefault(rect.top);
|
||||
rect.right = right.GetSpecifiedValueOrDefault(rect.right);
|
||||
rect.bottom = bottom.GetSpecifiedValueOrDefault(rect.bottom);
|
||||
}
|
||||
|
||||
// Token: 0x0600354C RID: 13644 RVA: 0x000588B4 File Offset: 0x00056AB4
|
||||
private void AssignRect(RectOffset rect, ref Style<float> left, ref Style<float> top, ref Style<float> right, ref Style<float> bottom)
|
||||
{
|
||||
rect.left = (int)left.GetSpecifiedValueOrDefault((float)rect.left);
|
||||
rect.top = (int)top.GetSpecifiedValueOrDefault((float)rect.top);
|
||||
rect.right = (int)right.GetSpecifiedValueOrDefault((float)rect.right);
|
||||
rect.bottom = (int)bottom.GetSpecifiedValueOrDefault((float)rect.bottom);
|
||||
}
|
||||
|
||||
// Token: 0x0600354D RID: 13645 RVA: 0x00058914 File Offset: 0x00056B14
|
||||
internal void ApplyRule(StyleSheet registry, int specificity, StyleRule rule, StylePropertyID[] propertyIDs, LoadResourceFunction loadResourceFunc)
|
||||
{
|
||||
for (int i = 0; i < rule.properties.Length; i++)
|
||||
{
|
||||
StyleProperty styleProperty = rule.properties[i];
|
||||
StylePropertyID stylePropertyID = propertyIDs[i];
|
||||
StyleValueHandle styleValueHandle = styleProperty.values[0];
|
||||
switch (stylePropertyID)
|
||||
{
|
||||
case StylePropertyID.MarginLeft:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.marginLeft);
|
||||
break;
|
||||
case StylePropertyID.MarginTop:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.marginTop);
|
||||
break;
|
||||
case StylePropertyID.MarginRight:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.marginRight);
|
||||
break;
|
||||
case StylePropertyID.MarginBottom:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.marginBottom);
|
||||
break;
|
||||
case StylePropertyID.PaddingLeft:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.paddingLeft);
|
||||
break;
|
||||
case StylePropertyID.PaddingTop:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.paddingTop);
|
||||
break;
|
||||
case StylePropertyID.PaddingRight:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.paddingRight);
|
||||
break;
|
||||
case StylePropertyID.PaddingBottom:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.paddingBottom);
|
||||
break;
|
||||
case StylePropertyID.BorderLeft:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.borderLeft);
|
||||
break;
|
||||
case StylePropertyID.BorderTop:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.borderTop);
|
||||
break;
|
||||
case StylePropertyID.BorderRight:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.borderRight);
|
||||
break;
|
||||
case StylePropertyID.BorderBottom:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.borderBottom);
|
||||
break;
|
||||
case StylePropertyID.PositionType:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.positionType);
|
||||
break;
|
||||
case StylePropertyID.PositionLeft:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.positionLeft);
|
||||
break;
|
||||
case StylePropertyID.PositionTop:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.positionTop);
|
||||
break;
|
||||
case StylePropertyID.PositionRight:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.positionRight);
|
||||
break;
|
||||
case StylePropertyID.PositionBottom:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.positionBottom);
|
||||
break;
|
||||
case StylePropertyID.Width:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.width);
|
||||
break;
|
||||
case StylePropertyID.Height:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.height);
|
||||
break;
|
||||
case StylePropertyID.MinWidth:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.minWidth);
|
||||
break;
|
||||
case StylePropertyID.MinHeight:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.minHeight);
|
||||
break;
|
||||
case StylePropertyID.MaxWidth:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.maxWidth);
|
||||
break;
|
||||
case StylePropertyID.MaxHeight:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.maxHeight);
|
||||
break;
|
||||
case StylePropertyID.Flex:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.flex);
|
||||
break;
|
||||
case StylePropertyID.BorderWidth:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.borderWidth);
|
||||
break;
|
||||
case StylePropertyID.BorderRadius:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.borderRadius);
|
||||
break;
|
||||
case StylePropertyID.FlexDirection:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.flexDirection);
|
||||
break;
|
||||
case StylePropertyID.FlexWrap:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.flexWrap);
|
||||
break;
|
||||
case StylePropertyID.JustifyContent:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.justifyContent);
|
||||
break;
|
||||
case StylePropertyID.AlignContent:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.alignContent);
|
||||
break;
|
||||
case StylePropertyID.AlignSelf:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.alignSelf);
|
||||
break;
|
||||
case StylePropertyID.AlignItems:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.alignItems);
|
||||
break;
|
||||
case StylePropertyID.TextAlignment:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.textAlignment);
|
||||
break;
|
||||
case StylePropertyID.TextClipping:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.textClipping);
|
||||
break;
|
||||
case StylePropertyID.Font:
|
||||
registry.Apply(styleValueHandle, specificity, loadResourceFunc, ref this.font);
|
||||
break;
|
||||
case StylePropertyID.FontSize:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.fontSize);
|
||||
break;
|
||||
case StylePropertyID.FontStyle:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.fontStyle);
|
||||
break;
|
||||
case StylePropertyID.BackgroundSize:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.backgroundSize);
|
||||
break;
|
||||
case StylePropertyID.WordWrap:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.wordWrap);
|
||||
break;
|
||||
case StylePropertyID.BackgroundImage:
|
||||
registry.Apply(styleValueHandle, specificity, loadResourceFunc, ref this.backgroundImage);
|
||||
break;
|
||||
case StylePropertyID.TextColor:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.textColor);
|
||||
break;
|
||||
case StylePropertyID.BackgroundColor:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.backgroundColor);
|
||||
break;
|
||||
case StylePropertyID.BorderColor:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.borderColor);
|
||||
break;
|
||||
case StylePropertyID.Overflow:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.overflow);
|
||||
break;
|
||||
case StylePropertyID.SliceLeft:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.sliceLeft);
|
||||
break;
|
||||
case StylePropertyID.SliceTop:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.sliceTop);
|
||||
break;
|
||||
case StylePropertyID.SliceRight:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.sliceRight);
|
||||
break;
|
||||
case StylePropertyID.SliceBottom:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.sliceBottom);
|
||||
break;
|
||||
case StylePropertyID.Opacity:
|
||||
registry.Apply(styleValueHandle, specificity, ref this.opacity);
|
||||
break;
|
||||
case StylePropertyID.Custom:
|
||||
{
|
||||
if (this.m_CustomProperties == null)
|
||||
{
|
||||
this.m_CustomProperties = new Dictionary<string, CustomProperty>();
|
||||
}
|
||||
CustomProperty customProperty = default(CustomProperty);
|
||||
if (!this.m_CustomProperties.TryGetValue(styleProperty.name, out customProperty) || specificity >= customProperty.specificity)
|
||||
{
|
||||
customProperty.handle = styleValueHandle;
|
||||
customProperty.data = registry;
|
||||
customProperty.specificity = specificity;
|
||||
this.m_CustomProperties[styleProperty.name] = customProperty;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new ArgumentException(string.Format("Non exhaustive switch statement (value={0})", stylePropertyID));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600354E RID: 13646 RVA: 0x00058E68 File Offset: 0x00057068
|
||||
public void ApplyCustomProperty(string propertyName, ref Style<float> target)
|
||||
{
|
||||
Style<float> style = new Style<float>(0f);
|
||||
CustomProperty customProperty;
|
||||
if (this.m_CustomProperties != null && this.m_CustomProperties.TryGetValue(propertyName, out customProperty))
|
||||
{
|
||||
if (customProperty.handle.valueType == StyleValueType.Float)
|
||||
{
|
||||
customProperty.data.Apply(customProperty.handle, customProperty.specificity, ref style);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning(string.Format("Trying to read value as float while parsed type is {0}", customProperty.handle.valueType));
|
||||
}
|
||||
}
|
||||
target.Apply(style, StylePropertyApplyMode.CopyIfNotInline);
|
||||
}
|
||||
|
||||
// Token: 0x0600354F RID: 13647 RVA: 0x00058F04 File Offset: 0x00057104
|
||||
public void ApplyCustomProperty(string propertyName, ref Style<int> target)
|
||||
{
|
||||
Style<int> style = new Style<int>(0);
|
||||
CustomProperty customProperty;
|
||||
if (this.m_CustomProperties != null && this.m_CustomProperties.TryGetValue(propertyName, out customProperty))
|
||||
{
|
||||
if (customProperty.handle.valueType == StyleValueType.Float)
|
||||
{
|
||||
customProperty.data.Apply(customProperty.handle, customProperty.specificity, ref style);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning(string.Format("Trying to read value as int while parsed type is {0}", customProperty.handle.valueType));
|
||||
}
|
||||
}
|
||||
target.Apply(style, StylePropertyApplyMode.CopyIfNotInline);
|
||||
}
|
||||
|
||||
// Token: 0x06003550 RID: 13648 RVA: 0x00058F9C File Offset: 0x0005719C
|
||||
public void ApplyCustomProperty(string propertyName, ref Style<bool> target)
|
||||
{
|
||||
Style<bool> style = new Style<bool>(false);
|
||||
CustomProperty customProperty;
|
||||
if (this.m_CustomProperties != null && this.m_CustomProperties.TryGetValue(propertyName, out customProperty))
|
||||
{
|
||||
if (customProperty.handle.valueType == StyleValueType.Keyword)
|
||||
{
|
||||
customProperty.data.Apply(customProperty.handle, customProperty.specificity, ref style);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning(string.Format("Trying to read value as bool while parsed type is {0}", customProperty.handle.valueType));
|
||||
}
|
||||
}
|
||||
target.Apply(style, StylePropertyApplyMode.CopyIfNotInline);
|
||||
}
|
||||
|
||||
// Token: 0x06003551 RID: 13649 RVA: 0x00059030 File Offset: 0x00057230
|
||||
public void ApplyCustomProperty(string propertyName, ref Style<Color> target)
|
||||
{
|
||||
Style<Color> style = new Style<Color>(Color.clear);
|
||||
CustomProperty customProperty;
|
||||
if (this.m_CustomProperties != null && this.m_CustomProperties.TryGetValue(propertyName, out customProperty))
|
||||
{
|
||||
if (customProperty.handle.valueType == StyleValueType.Color)
|
||||
{
|
||||
customProperty.data.Apply(customProperty.handle, customProperty.specificity, ref style);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning(string.Format("Trying to read value as Color while parsed type is {0}", customProperty.handle.valueType));
|
||||
}
|
||||
}
|
||||
target.Apply(style, StylePropertyApplyMode.CopyIfNotInline);
|
||||
}
|
||||
|
||||
// Token: 0x06003552 RID: 13650 RVA: 0x000590CC File Offset: 0x000572CC
|
||||
public void ApplyCustomProperty<T>(string propertyName, ref Style<T> target) where T : Object
|
||||
{
|
||||
this.ApplyCustomProperty<T>(propertyName, new LoadResourceFunction(Resources.Load), ref target);
|
||||
}
|
||||
|
||||
// Token: 0x06003553 RID: 13651 RVA: 0x000590F4 File Offset: 0x000572F4
|
||||
public void ApplyCustomProperty<T>(string propertyName, LoadResourceFunction function, ref Style<T> target) where T : Object
|
||||
{
|
||||
Style<T> style = new Style<T>((T)((object)null));
|
||||
CustomProperty customProperty;
|
||||
if (this.m_CustomProperties != null && this.m_CustomProperties.TryGetValue(propertyName, out customProperty))
|
||||
{
|
||||
if (customProperty.handle.valueType == StyleValueType.ResourcePath)
|
||||
{
|
||||
customProperty.data.Apply(customProperty.handle, customProperty.specificity, function, ref style);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning(string.Format("Trying to read value as Object while parsed type is {0}", customProperty.handle.valueType));
|
||||
}
|
||||
}
|
||||
target.Apply(style, StylePropertyApplyMode.CopyIfNotInline);
|
||||
}
|
||||
|
||||
// Token: 0x06003554 RID: 13652 RVA: 0x00059190 File Offset: 0x00057390
|
||||
public void ApplyCustomProperty(string propertyName, ref Style<string> target)
|
||||
{
|
||||
Style<string> style = new Style<string>(string.Empty);
|
||||
CustomProperty customProperty;
|
||||
if (this.m_CustomProperties != null && this.m_CustomProperties.TryGetValue(propertyName, out customProperty))
|
||||
{
|
||||
style.value = customProperty.data.ReadAsString(customProperty.handle);
|
||||
style.specificity = customProperty.specificity;
|
||||
}
|
||||
target.Apply(style, StylePropertyApplyMode.CopyIfNotInline);
|
||||
}
|
||||
|
||||
// Token: 0x04000B92 RID: 2962
|
||||
public static VisualElementStyles none = new VisualElementStyles(true);
|
||||
|
||||
// Token: 0x04000B93 RID: 2963
|
||||
internal readonly bool isShared;
|
||||
|
||||
// Token: 0x04000B94 RID: 2964
|
||||
private Dictionary<string, CustomProperty> m_CustomProperties;
|
||||
|
||||
// Token: 0x04000B95 RID: 2965
|
||||
[StyleProperty("width", StylePropertyID.Width)]
|
||||
public Style<float> width;
|
||||
|
||||
// Token: 0x04000B96 RID: 2966
|
||||
[StyleProperty("height", StylePropertyID.Height)]
|
||||
public Style<float> height;
|
||||
|
||||
// Token: 0x04000B97 RID: 2967
|
||||
[StyleProperty("max-width", StylePropertyID.MaxWidth)]
|
||||
public Style<float> maxWidth;
|
||||
|
||||
// Token: 0x04000B98 RID: 2968
|
||||
[StyleProperty("max-height", StylePropertyID.MaxHeight)]
|
||||
public Style<float> maxHeight;
|
||||
|
||||
// Token: 0x04000B99 RID: 2969
|
||||
[StyleProperty("min-width", StylePropertyID.MinWidth)]
|
||||
public Style<float> minWidth;
|
||||
|
||||
// Token: 0x04000B9A RID: 2970
|
||||
[StyleProperty("min-height", StylePropertyID.MinHeight)]
|
||||
public Style<float> minHeight;
|
||||
|
||||
// Token: 0x04000B9B RID: 2971
|
||||
[StyleProperty("flex", StylePropertyID.Flex)]
|
||||
public Style<float> flex;
|
||||
|
||||
// Token: 0x04000B9C RID: 2972
|
||||
[StyleProperty("overflow", StylePropertyID.Overflow)]
|
||||
public Style<int> overflow;
|
||||
|
||||
// Token: 0x04000B9D RID: 2973
|
||||
[StyleProperty("position-left", StylePropertyID.PositionLeft)]
|
||||
public Style<float> positionLeft;
|
||||
|
||||
// Token: 0x04000B9E RID: 2974
|
||||
[StyleProperty("position-top", StylePropertyID.PositionTop)]
|
||||
public Style<float> positionTop;
|
||||
|
||||
// Token: 0x04000B9F RID: 2975
|
||||
[StyleProperty("position-right", StylePropertyID.PositionRight)]
|
||||
public Style<float> positionRight;
|
||||
|
||||
// Token: 0x04000BA0 RID: 2976
|
||||
[StyleProperty("position-bottom", StylePropertyID.PositionBottom)]
|
||||
public Style<float> positionBottom;
|
||||
|
||||
// Token: 0x04000BA1 RID: 2977
|
||||
[StyleProperty("margin-left", StylePropertyID.MarginLeft)]
|
||||
public Style<float> marginLeft;
|
||||
|
||||
// Token: 0x04000BA2 RID: 2978
|
||||
[StyleProperty("margin-top", StylePropertyID.MarginTop)]
|
||||
public Style<float> marginTop;
|
||||
|
||||
// Token: 0x04000BA3 RID: 2979
|
||||
[StyleProperty("margin-right", StylePropertyID.MarginRight)]
|
||||
public Style<float> marginRight;
|
||||
|
||||
// Token: 0x04000BA4 RID: 2980
|
||||
[StyleProperty("margin-bottom", StylePropertyID.MarginBottom)]
|
||||
public Style<float> marginBottom;
|
||||
|
||||
// Token: 0x04000BA5 RID: 2981
|
||||
[StyleProperty("border-left", StylePropertyID.BorderLeft)]
|
||||
public Style<float> borderLeft;
|
||||
|
||||
// Token: 0x04000BA6 RID: 2982
|
||||
[StyleProperty("border-top", StylePropertyID.BorderTop)]
|
||||
public Style<float> borderTop;
|
||||
|
||||
// Token: 0x04000BA7 RID: 2983
|
||||
[StyleProperty("border-right", StylePropertyID.BorderRight)]
|
||||
public Style<float> borderRight;
|
||||
|
||||
// Token: 0x04000BA8 RID: 2984
|
||||
[StyleProperty("border-bottom", StylePropertyID.BorderBottom)]
|
||||
public Style<float> borderBottom;
|
||||
|
||||
// Token: 0x04000BA9 RID: 2985
|
||||
[StyleProperty("padding-left", StylePropertyID.PaddingLeft)]
|
||||
public Style<float> paddingLeft;
|
||||
|
||||
// Token: 0x04000BAA RID: 2986
|
||||
[StyleProperty("padding-top", StylePropertyID.PaddingTop)]
|
||||
public Style<float> paddingTop;
|
||||
|
||||
// Token: 0x04000BAB RID: 2987
|
||||
[StyleProperty("padding-right", StylePropertyID.PaddingRight)]
|
||||
public Style<float> paddingRight;
|
||||
|
||||
// Token: 0x04000BAC RID: 2988
|
||||
[StyleProperty("padding-bottom", StylePropertyID.PaddingBottom)]
|
||||
public Style<float> paddingBottom;
|
||||
|
||||
// Token: 0x04000BAD RID: 2989
|
||||
[StyleProperty("position-type", StylePropertyID.PositionType)]
|
||||
public Style<int> positionType;
|
||||
|
||||
// Token: 0x04000BAE RID: 2990
|
||||
[StyleProperty("align-self", StylePropertyID.AlignSelf)]
|
||||
public Style<int> alignSelf;
|
||||
|
||||
// Token: 0x04000BAF RID: 2991
|
||||
[StyleProperty("text-alignment", StylePropertyID.TextAlignment)]
|
||||
public Style<int> textAlignment;
|
||||
|
||||
// Token: 0x04000BB0 RID: 2992
|
||||
[StyleProperty("font-style", StylePropertyID.FontStyle)]
|
||||
public Style<int> fontStyle;
|
||||
|
||||
// Token: 0x04000BB1 RID: 2993
|
||||
[StyleProperty("text-clipping", StylePropertyID.TextClipping)]
|
||||
public Style<int> textClipping;
|
||||
|
||||
// Token: 0x04000BB2 RID: 2994
|
||||
[StyleProperty("font", StylePropertyID.Font)]
|
||||
public Style<Font> font;
|
||||
|
||||
// Token: 0x04000BB3 RID: 2995
|
||||
[StyleProperty("font-size", StylePropertyID.FontSize)]
|
||||
public Style<int> fontSize;
|
||||
|
||||
// Token: 0x04000BB4 RID: 2996
|
||||
[StyleProperty("word-wrap", StylePropertyID.WordWrap)]
|
||||
public Style<bool> wordWrap;
|
||||
|
||||
// Token: 0x04000BB5 RID: 2997
|
||||
[StyleProperty("text-color", StylePropertyID.TextColor)]
|
||||
public Style<Color> textColor;
|
||||
|
||||
// Token: 0x04000BB6 RID: 2998
|
||||
[StyleProperty("flex-direction", StylePropertyID.FlexDirection)]
|
||||
public Style<int> flexDirection;
|
||||
|
||||
// Token: 0x04000BB7 RID: 2999
|
||||
[StyleProperty("background-color", StylePropertyID.BackgroundColor)]
|
||||
public Style<Color> backgroundColor;
|
||||
|
||||
// Token: 0x04000BB8 RID: 3000
|
||||
[StyleProperty("border-color", StylePropertyID.BorderColor)]
|
||||
public Style<Color> borderColor;
|
||||
|
||||
// Token: 0x04000BB9 RID: 3001
|
||||
[StyleProperty("background-image", StylePropertyID.BackgroundImage)]
|
||||
public Style<Texture2D> backgroundImage;
|
||||
|
||||
// Token: 0x04000BBA RID: 3002
|
||||
[StyleProperty("background-size", StylePropertyID.BackgroundSize)]
|
||||
public Style<int> backgroundSize;
|
||||
|
||||
// Token: 0x04000BBB RID: 3003
|
||||
[StyleProperty("align-items", StylePropertyID.AlignItems)]
|
||||
public Style<int> alignItems;
|
||||
|
||||
// Token: 0x04000BBC RID: 3004
|
||||
[StyleProperty("align-content", StylePropertyID.AlignContent)]
|
||||
public Style<int> alignContent;
|
||||
|
||||
// Token: 0x04000BBD RID: 3005
|
||||
[StyleProperty("justify-content", StylePropertyID.JustifyContent)]
|
||||
public Style<int> justifyContent;
|
||||
|
||||
// Token: 0x04000BBE RID: 3006
|
||||
[StyleProperty("flex-wrap", StylePropertyID.FlexWrap)]
|
||||
public Style<int> flexWrap;
|
||||
|
||||
// Token: 0x04000BBF RID: 3007
|
||||
[StyleProperty("border-width", StylePropertyID.BorderWidth)]
|
||||
public Style<float> borderWidth;
|
||||
|
||||
// Token: 0x04000BC0 RID: 3008
|
||||
[StyleProperty("border-radius", StylePropertyID.BorderRadius)]
|
||||
public Style<float> borderRadius;
|
||||
|
||||
// Token: 0x04000BC1 RID: 3009
|
||||
[StyleProperty("slice-left", StylePropertyID.SliceLeft)]
|
||||
public Style<int> sliceLeft;
|
||||
|
||||
// Token: 0x04000BC2 RID: 3010
|
||||
[StyleProperty("slice-top", StylePropertyID.SliceTop)]
|
||||
public Style<int> sliceTop;
|
||||
|
||||
// Token: 0x04000BC3 RID: 3011
|
||||
[StyleProperty("slice-right", StylePropertyID.SliceRight)]
|
||||
public Style<int> sliceRight;
|
||||
|
||||
// Token: 0x04000BC4 RID: 3012
|
||||
[StyleProperty("slice-bottom", StylePropertyID.SliceBottom)]
|
||||
public Style<int> sliceBottom;
|
||||
|
||||
// Token: 0x04000BC5 RID: 3013
|
||||
[StyleProperty("opacity", StylePropertyID.Opacity)]
|
||||
public Style<float> opacity;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user