139 lines
3.7 KiB
C#
139 lines
3.7 KiB
C#
using System;
|
|
|
|
namespace UnityEngine.StyleSheets
|
|
{
|
|
// Token: 0x02000379 RID: 889
|
|
[Serializable]
|
|
internal class StyleSheet : ScriptableObject
|
|
{
|
|
// Token: 0x17000C44 RID: 3140
|
|
// (get) Token: 0x0600357B RID: 13691 RVA: 0x0005978C File Offset: 0x0005798C
|
|
// (set) Token: 0x0600357C RID: 13692 RVA: 0x000597A8 File Offset: 0x000579A8
|
|
public StyleRule[] rules
|
|
{
|
|
get
|
|
{
|
|
return this.m_Rules;
|
|
}
|
|
internal set
|
|
{
|
|
this.m_Rules = value;
|
|
this.SetupReferences();
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000C45 RID: 3141
|
|
// (get) Token: 0x0600357D RID: 13693 RVA: 0x000597B8 File Offset: 0x000579B8
|
|
// (set) Token: 0x0600357E RID: 13694 RVA: 0x000597D4 File Offset: 0x000579D4
|
|
public StyleComplexSelector[] complexSelectors
|
|
{
|
|
get
|
|
{
|
|
return this.m_ComplexSelectors;
|
|
}
|
|
internal set
|
|
{
|
|
this.m_ComplexSelectors = value;
|
|
this.SetupReferences();
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600357F RID: 13695 RVA: 0x000597E4 File Offset: 0x000579E4
|
|
private static T CheckAccess<T>(T[] list, StyleValueType type, StyleValueHandle handle)
|
|
{
|
|
T t = default(T);
|
|
if (handle.valueType != type)
|
|
{
|
|
Debug.LogErrorFormat("Trying to read value of type {0} while reading a value of type {1}", new object[] { type, handle.valueType });
|
|
}
|
|
else if (handle.valueIndex < 0 && handle.valueIndex >= list.Length)
|
|
{
|
|
Debug.LogError("Accessing invalid property");
|
|
}
|
|
else
|
|
{
|
|
t = list[handle.valueIndex];
|
|
}
|
|
return t;
|
|
}
|
|
|
|
// Token: 0x06003580 RID: 13696 RVA: 0x00059880 File Offset: 0x00057A80
|
|
private void OnEnable()
|
|
{
|
|
this.SetupReferences();
|
|
}
|
|
|
|
// Token: 0x06003581 RID: 13697 RVA: 0x0005988C File Offset: 0x00057A8C
|
|
private void SetupReferences()
|
|
{
|
|
if (this.complexSelectors != null && this.rules != null)
|
|
{
|
|
for (int i = 0; i < this.complexSelectors.Length; i++)
|
|
{
|
|
StyleComplexSelector styleComplexSelector = this.complexSelectors[i];
|
|
if (styleComplexSelector.ruleIndex < this.rules.Length)
|
|
{
|
|
styleComplexSelector.rule = this.rules[styleComplexSelector.ruleIndex];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06003582 RID: 13698 RVA: 0x00059904 File Offset: 0x00057B04
|
|
public StyleValueKeyword ReadKeyword(StyleValueHandle handle)
|
|
{
|
|
return (StyleValueKeyword)handle.valueIndex;
|
|
}
|
|
|
|
// Token: 0x06003583 RID: 13699 RVA: 0x00059920 File Offset: 0x00057B20
|
|
public float ReadFloat(StyleValueHandle handle)
|
|
{
|
|
return StyleSheet.CheckAccess<float>(this.floats, StyleValueType.Float, handle);
|
|
}
|
|
|
|
// Token: 0x06003584 RID: 13700 RVA: 0x00059944 File Offset: 0x00057B44
|
|
public Color ReadColor(StyleValueHandle handle)
|
|
{
|
|
return StyleSheet.CheckAccess<Color>(this.colors, StyleValueType.Color, handle);
|
|
}
|
|
|
|
// Token: 0x06003585 RID: 13701 RVA: 0x00059968 File Offset: 0x00057B68
|
|
public string ReadString(StyleValueHandle handle)
|
|
{
|
|
return StyleSheet.CheckAccess<string>(this.strings, StyleValueType.String, handle);
|
|
}
|
|
|
|
// Token: 0x06003586 RID: 13702 RVA: 0x0005998C File Offset: 0x00057B8C
|
|
public string ReadEnum(StyleValueHandle handle)
|
|
{
|
|
return StyleSheet.CheckAccess<string>(this.strings, StyleValueType.Enum, handle);
|
|
}
|
|
|
|
// Token: 0x06003587 RID: 13703 RVA: 0x000599B0 File Offset: 0x00057BB0
|
|
public string ReadResourcePath(StyleValueHandle handle)
|
|
{
|
|
return StyleSheet.CheckAccess<string>(this.strings, StyleValueType.ResourcePath, handle);
|
|
}
|
|
|
|
// Token: 0x04000BE2 RID: 3042
|
|
[SerializeField]
|
|
private StyleRule[] m_Rules;
|
|
|
|
// Token: 0x04000BE3 RID: 3043
|
|
[SerializeField]
|
|
private StyleComplexSelector[] m_ComplexSelectors;
|
|
|
|
// Token: 0x04000BE4 RID: 3044
|
|
[SerializeField]
|
|
internal float[] floats;
|
|
|
|
// Token: 0x04000BE5 RID: 3045
|
|
[SerializeField]
|
|
internal Color[] colors;
|
|
|
|
// Token: 0x04000BE6 RID: 3046
|
|
[SerializeField]
|
|
internal string[] strings;
|
|
}
|
|
}
|