This commit is contained in:
2026-02-20 21:03:17 +08:00
parent 6cf9b8df56
commit 27a1f9d084
920 changed files with 196579 additions and 6801 deletions

View File

@@ -25,7 +25,10 @@ public class ScrollPaneHeader : GComponent
_c1.selectedIndex = 0;
}
public bool ReadyToRefresh => _c1.selectedIndex == 1;
public bool ReadyToRefresh
{
get { return _c1.selectedIndex == 1; }
}
public void SetRefreshStatus(int value)
{

View File

@@ -1,48 +1,23 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-1251759294947100335
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Globe Material
m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _EMISSION
m_InvalidKeywords: []
m_LightmapFlags: 7
m_Shader: {fileID: 10703, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_CustomRenderQueue: 2000
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: a9f1967c2ba9bff4b93efceca70b54a5, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
@@ -83,54 +58,20 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _Cull: 2
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _Glossiness: 0.5
- _GlossinessSource: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Shininess: 0
- _Smoothness: 0.5
- _SmoothnessSource: 1
- _SpecSource: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UVSec: 0
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -2,34 +2,22 @@
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: U1NPC0040
m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _EMISSION
m_InvalidKeywords: []
m_LightmapFlags: 7
m_Shader: {fileID: 10708, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_CustomRenderQueue: 3000
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 3c3eb5b459fd6d241afe2698a33268d9, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
@@ -70,65 +58,34 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- PixelSnap: 0
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ColorMask: 15
- _Cull: 2
- _Cutoff: 0.409
- _DetailNormalMapScale: 1
- _Direction: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _DstBlend: 10
- _Glossiness: 0.5
- _GlossinessSource: 0
- _LightIntensity_0: 0.8
- _LightIntensity_1: 0.6
- _Metallic: 0
- _Mode: 3
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _RimWidth: 0.7
- _Shininess: 0.078125
- _Smoothness: 0.5
- _SmoothnessSource: 1
- _SpecSource: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _Surface: 0
- _UVSec: 0
- _UseUIAlphaClip: 0
- _XRMotionVectorsPass: 1
- _ZWrite: 1
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.588, g: 0.588, b: 0.588, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _LightColor_0: {r: 0.6196, g: 0.5255, b: 0.46275, a: 1}
- _LightColor_1: {r: 0.2196, g: 0.498, b: 0.61176, a: 1}
@@ -136,18 +93,3 @@ Material:
- _LightDir_1: {r: -0.9, g: 0.5, b: 0.1, a: 1}
- _RimColor: {r: 0.4, g: 0.4, b: 0.4, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &6458519426764551773
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10

View File

@@ -16,7 +16,10 @@ public class Card : GButton
public bool opened
{
get => _front.visible;
get
{
return _front.visible;
}
set
{

View File

@@ -173,7 +173,10 @@ public class FairyBook : GComponent
/// <summary>
///
/// </summary>
public EventListener onTurnComplete => _onTurnComplete ?? (_onTurnComplete = new EventListener(this, "onTurnComplete"));
public EventListener onTurnComplete
{
get { return _onTurnComplete ?? (_onTurnComplete = new EventListener(this, "onTurnComplete")); }
}
/// <summary>
///
@@ -192,8 +195,8 @@ public class FairyBook : GComponent
/// </summary>
public Paper pageSoftness
{
get => _paper;
set => _paper = value;
get { return _paper; }
set { _paper = value; }
}
/// <summary>
@@ -201,7 +204,7 @@ public class FairyBook : GComponent
/// </summary>
public int pageCount
{
get => _pageCount;
get { return _pageCount; }
set
{
if (_pageCount % 2 != 0)
@@ -216,7 +219,7 @@ public class FairyBook : GComponent
/// </summary>
public int currentPage
{
get => _currentPage;
get { return _currentPage; }
set
{
if (value < 0 || value > _pageCount - 1)

View File

@@ -49,8 +49,8 @@ Shader "FairyGUI/BMFont"
Pass
{
CGPROGRAM
#pragma multi_compile NOT_GRAYED GRAYED
#pragma multi_compile NOT_CLIPPED CLIPPED SOFT_CLIPPED
#pragma multi_compile _ GRAYED
#pragma multi_compile _ CLIPPED SOFT_CLIPPED
#pragma vertex vert
#pragma fragment frag
#pragma exclude_renderers d3d9 opengl flash
@@ -127,28 +127,22 @@ Shader "FairyGUI/BMFont"
#endif
#ifdef SOFT_CLIPPED
float2 factor = float2(0,0);
if(i.clipPos.x<0)
factor.x = (1.0-abs(i.clipPos.x)) * _ClipSoftness.x;
else
factor.x = (1.0-i.clipPos.x) * _ClipSoftness.z;
if(i.clipPos.y<0)
factor.y = (1.0-abs(i.clipPos.y)) * _ClipSoftness.w;
else
factor.y = (1.0-i.clipPos.y) * _ClipSoftness.y;
float2 factor;
float2 condition = step(i.clipPos.xy, 0);
float4 clip_softness = _ClipSoftness * float4(condition, 1 - condition);
factor.xy = (1.0 - abs(i.clipPos.xy)) * (clip_softness.xw + clip_softness.zy);
col.a *= clamp(min(factor.x, factor.y), 0.0, 1.0);
#endif
#ifdef CLIPPED
float2 factor = abs(i.clipPos);
col.a *= step(max(factor.x, factor.y), 1);
#endif
return col;
}
}
ENDCG
}
}
Fallback "FairyGUI/Text"
//Fallback "FairyGUI/Text"
}

View File

@@ -49,9 +49,9 @@ Shader "FairyGUI/Image"
Pass
{
CGPROGRAM
#pragma multi_compile NOT_COMBINED COMBINED
#pragma multi_compile NOT_GRAYED GRAYED COLOR_FILTER
#pragma multi_compile NOT_CLIPPED CLIPPED SOFT_CLIPPED ALPHA_MASK
#pragma multi_compile _ COMBINED
#pragma multi_compile _ GRAYED COLOR_FILTER
#pragma multi_compile _ CLIPPED SOFT_CLIPPED ALPHA_MASK
#pragma vertex vert
#pragma fragment frag
@@ -139,15 +139,10 @@ Shader "FairyGUI/Image"
#endif
#ifdef SOFT_CLIPPED
float2 factor = float2(0,0);
if(i.clipPos.x<0)
factor.x = (1.0-abs(i.clipPos.x)) * _ClipSoftness.x;
else
factor.x = (1.0-i.clipPos.x) * _ClipSoftness.z;
if(i.clipPos.y<0)
factor.y = (1.0-abs(i.clipPos.y)) * _ClipSoftness.w;
else
factor.y = (1.0-i.clipPos.y) * _ClipSoftness.y;
float2 factor;
float2 condition = step(i.clipPos.xy, 0);
float4 clip_softness = _ClipSoftness * float4(condition, 1 - condition);
factor.xy = (1.0 - abs(i.clipPos.xy)) * (clip_softness.xw + clip_softness.zy);
col.a *= clamp(min(factor.x, factor.y), 0.0, 1.0);
#endif

View File

@@ -49,8 +49,8 @@ Shader "FairyGUI/Text"
Pass
{
CGPROGRAM
#pragma multi_compile NOT_GRAYED GRAYED
#pragma multi_compile NOT_CLIPPED CLIPPED SOFT_CLIPPED
#pragma multi_compile _ GRAYED
#pragma multi_compile _ CLIPPED SOFT_CLIPPED
#pragma vertex vert
#pragma fragment frag
@@ -125,15 +125,10 @@ Shader "FairyGUI/Text"
#endif
#ifdef SOFT_CLIPPED
float2 factor = float2(0,0);
if(i.clipPos.x<0)
factor.x = (1.0-abs(i.clipPos.x)) * _ClipSoftness.x;
else
factor.x = (1.0-i.clipPos.x) * _ClipSoftness.z;
if(i.clipPos.y<0)
factor.y = (1.0-abs(i.clipPos.y)) * _ClipSoftness.w;
else
factor.y = (1.0-i.clipPos.y) * _ClipSoftness.y;
float2 factor;
float2 condition = step(i.clipPos.xy, 0);
float4 clip_softness = _ClipSoftness * float4(condition, 1 - condition);
factor.xy = (1.0 - abs(i.clipPos.xy)) * (clip_softness.xw + clip_softness.zy);
col.a *= clamp(min(factor.x, factor.y), 0.0, 1.0);
#endif

View File

@@ -180,7 +180,7 @@ namespace FairyGUI
if (target.graphics != null)
{
oldLayer = target.graphics.gameObject.layer;
target.graphics.gameObject.layer = CaptureCamera.layer;
target._SetLayerDirect(CaptureCamera.layer);
}
if (target is Container)
@@ -196,7 +196,7 @@ namespace FairyGUI
RenderTexture.active = old;
if (target.graphics != null)
target.graphics.gameObject.layer = oldLayer;
target._SetLayerDirect(oldLayer);
if (target is Container)
((Container)target).SetChildrenLayer(oldLayer);

View File

@@ -942,6 +942,7 @@ namespace FairyGUI
private void CollectChildren(Container initiator, bool outlineChanged)
{
EnsureSizeCorrect();
int count = _children.Count;
for (int i = 0; i < count; i++)
{

View File

@@ -885,7 +885,7 @@ namespace FairyGUI
return;
}
_renderingOrder = context.renderingOrder + 1;
_renderingOrder = context.renderingOrder;
if (graphics != null)
graphics.SetRenderingOrder(context, inBatch);
else

View File

@@ -455,6 +455,8 @@ namespace FairyGUI
}
VertexBuffer vb2 = VertexBuffer.Begin();
if (color.a != 255)
vb2._alphaInVertexColor = true;
for (int j = 0; j < dirs; j++)
{
for (int i = 0; i < count; i++)
@@ -482,6 +484,8 @@ namespace FairyGUI
}
VertexBuffer vb2 = VertexBuffer.Begin();
if (color.a != 255)
vb2._alphaInVertexColor = true;
for (int i = 0; i < count; i++)
{
Vector3 vert = vertices[i];

View File

@@ -471,6 +471,12 @@ namespace FairyGUI
{
_vertexMatrix = value;
_meshDirty = true;
if (subInstances != null)
{
foreach (var sub in subInstances)
sub._vertexMatrix = value;
}
}
}
@@ -835,7 +841,10 @@ namespace FairyGUI
newGameObject.transform.SetParent(gameObject.transform, false);
newGameObject.layer = gameObject.layer;
newGameObject.hideFlags = gameObject.hideFlags;
return new NGraphics(newGameObject);
var newGraphics = new NGraphics(newGameObject);
newGraphics._vertexMatrix = _vertexMatrix;
return newGraphics;
}
class StencilEraser

View File

@@ -200,7 +200,7 @@ namespace FairyGUI
/// <param name="fillColor"></param>
/// <param name="rotation"></param>
/// <param name="distances"></param>
public void DrawRegularPolygon(int sides, float lineSize, Color centerColor, Color lineColor, Color fillColor, float rotation, float[] distances)
public void DrawRegularPolygon(int sides, float lineSize, Color? centerColor, Color lineColor, Color fillColor, float rotation, float[] distances)
{
RegularPolygonMesh mesh = graphics.GetMeshFactory<RegularPolygonMesh>();
mesh.sides = sides;

View File

@@ -917,7 +917,9 @@ namespace FairyGUI
#endif
pos.y = Screen.height - pos.y;
TouchInfo touch = _touches[0];
if (pos.x < 0 || pos.y < 0) // outside of the window
if (float.IsNaN(pos.x) || float.IsNaN(pos.y) || float.IsInfinity(pos.x) || float.IsInfinity(pos.y)) //not a valid position
_touchTarget = this;
else if (pos.x < 0 || pos.y < 0) // outside of the window
_touchTarget = this;
else
_touchTarget = HitTest(pos, true);
@@ -1810,4 +1812,4 @@ namespace FairyGUI
return obj;
}
}
}
}

View File

@@ -81,6 +81,9 @@ Properties {
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_BlendSrcFactor ("Blend SrcFactor", Float) = 1
_BlendDstFactor ("Blend DstFactor", Float) = 10
}
SubShader {
@@ -106,7 +109,8 @@ SubShader {
Lighting Off
Fog { Mode Off }
ZTest [unity_GUIZTestMode]
Blend One OneMinusSrcAlpha
Blend [_BlendSrcFactor] [_BlendDstFactor]
ColorMask [_ColorMask]
Pass {
@@ -120,8 +124,8 @@ SubShader {
//#pragma multi_compile __ UNITY_UI_CLIP_RECT
//#pragma multi_compile __ UNITY_UI_ALPHACLIP
#pragma multi_compile NOT_GRAYED GRAYED
#pragma multi_compile NOT_CLIPPED CLIPPED SOFT_CLIPPED
#pragma multi_compile _ GRAYED
#pragma multi_compile _ CLIPPED SOFT_CLIPPED
#include "UnityCG.cginc"
#include "UnityUI.cginc"
@@ -455,26 +459,20 @@ SubShader {
#endif
#ifdef SOFT_CLIPPED
float2 factor = float2(0,0);
if(input.mask.x<0)
factor.x = (1.0-abs(input.mask.x)) * _ClipSoftness.x;
else
factor.x = (1.0-input.mask.x) * _ClipSoftness.z;
if(input.mask.y<0)
factor.y = (1.0-abs(input.mask.y)) * _ClipSoftness.w;
else
factor.y = (1.0-input.mask.y) * _ClipSoftness.y;
float2 factor;
float2 condition = step(input.mask.xy, 0);
float4 clip_softness = _ClipSoftness * float4(condition, 1 - condition);
factor.xy = (1.0 - abs(input.mask.xy)) * (clip_softness.xw + clip_softness.zy);
faceColor.a *= clamp(min(factor.x, factor.y), 0.0, 1.0);
clip(faceColor.a - 0.001);
#endif
return faceColor * input.color.a;
}
return faceColor * input.color.a;
}
ENDCG
}
}
Fallback "TextMeshPro/Mobile/Distance Field"
//Fallback "TextMeshPro/Mobile/Distance Field"
CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
}

View File

@@ -2,7 +2,7 @@
"name": "FairyGUI",
"rootNamespace": "",
"references": [
"GUID:6055be8ebefd69e48b49212b09b47b2f"
"Unity.TextMeshPro"
],
"includePlatforms": [],
"excludePlatforms": [],

View File

@@ -266,7 +266,7 @@ namespace FairyGUI
distances[i] = buffer.ReadFloat();
}
_shape.DrawRegularPolygon(sides, lineSize, fillColor, lineColor, fillColor, startAngle, distances);
_shape.DrawRegularPolygon(sides, lineSize, null, lineColor, fillColor, startAngle, distances);
}
}
}

View File

@@ -22,16 +22,6 @@ namespace FairyGUI
/// </summary>
public object data;
/// <summary>
/// 多语言key
/// </summary>
public string lang;
/// <summary>
/// 多语言参数
/// </summary>
public object[] langArgs;
/// <summary>
/// The source width of the object.
/// </summary>
@@ -335,7 +325,10 @@ namespace FairyGUI
public float x
{
get { return _x; }
set { SetPosition(value, _y, _z); }
set
{
SetPosition(value, _y, _z);
}
}
/// <summary>
@@ -344,7 +337,10 @@ namespace FairyGUI
public float y
{
get { return _y; }
set { SetPosition(_x, value, _z); }
set
{
SetPosition(_x, value, _z);
}
}
/// <summary>
@@ -353,7 +349,10 @@ namespace FairyGUI
public float z
{
get { return _z; }
set { SetPosition(_x, _y, value); }
set
{
SetPosition(_x, _y, value);
}
}
/// <summary>
@@ -482,8 +481,14 @@ namespace FairyGUI
/// </summary>
public float width
{
get { return _width; }
set { SetSize(value, _rawHeight); }
get
{
return _width;
}
set
{
SetSize(value, _rawHeight);
}
}
/// <summary>
@@ -491,8 +496,14 @@ namespace FairyGUI
/// </summary>
public float height
{
get { return _height; }
set { SetSize(_rawWidth, value); }
get
{
return _height;
}
set
{
SetSize(_rawWidth, value);
}
}
/// <summary>
@@ -604,7 +615,10 @@ namespace FairyGUI
/// </summary>
public float xMin
{
get { return _pivotAsAnchor ? (_x - _width * _pivotX) : _x; }
get
{
return _pivotAsAnchor ? (_x - _width * _pivotX) : _x;
}
set
{
if (_pivotAsAnchor)
@@ -619,7 +633,10 @@ namespace FairyGUI
/// </summary>
public float yMin
{
get { return _pivotAsAnchor ? (_y - _height * _pivotY) : _y; }
get
{
return _pivotAsAnchor ? (_y - _height * _pivotY) : _y;
}
set
{
if (_pivotAsAnchor)
@@ -635,7 +652,10 @@ namespace FairyGUI
public float scaleX
{
get { return _scaleX; }
set { SetScale(value, _scaleY); }
set
{
SetScale(value, _scaleY);
}
}
/// <summary>
@@ -644,7 +664,10 @@ namespace FairyGUI
public float scaleY
{
get { return _scaleY; }
set { SetScale(_scaleX, value); }
set
{
SetScale(_scaleX, value);
}
}
/// <summary>
@@ -699,7 +722,10 @@ namespace FairyGUI
public float pivotX
{
get { return _pivotX; }
set { SetPivot(value, _pivotY, _pivotAsAnchor); }
set
{
SetPivot(value, _pivotY, _pivotAsAnchor);
}
}
/// <summary>
@@ -708,7 +734,10 @@ namespace FairyGUI
public float pivotY
{
get { return _pivotY; }
set { SetPivot(_pivotX, value, _pivotAsAnchor); }
set
{
SetPivot(_pivotX, value, _pivotAsAnchor);
}
}
/// <summary>
@@ -723,7 +752,10 @@ namespace FairyGUI
public bool pivotAsAnchor
{
get { return _pivotAsAnchor; }
set { SetPivot(_pivotX, _pivotY, value); }
set
{
SetPivot(_pivotX, _pivotY, value);
}
}
/// <summary>
@@ -760,7 +792,10 @@ namespace FairyGUI
/// </summary>
public bool touchable
{
get { return _touchable; }
get
{
return _touchable;
}
set
{
if (_touchable != value)
@@ -779,7 +814,10 @@ namespace FairyGUI
/// </summary>
public bool grayed
{
get { return _grayed; }
get
{
return _grayed;
}
set
{
if (_grayed != value)
@@ -796,7 +834,10 @@ namespace FairyGUI
/// </summary>
public bool enabled
{
get { return !_grayed && _touchable; }
get
{
return !_grayed && _touchable;
}
set
{
this.grayed = !value;
@@ -809,7 +850,10 @@ namespace FairyGUI
/// </summary>
public float rotation
{
get { return _rotation; }
get
{
return _rotation;
}
set
{
_rotation = value;
@@ -824,7 +868,10 @@ namespace FairyGUI
/// </summary>
public float rotationX
{
get { return _rotationX; }
get
{
return _rotationX;
}
set
{
_rotationX = value;
@@ -838,7 +885,10 @@ namespace FairyGUI
/// </summary>
public float rotationY
{
get { return _rotationY; }
get
{
return _rotationY;
}
set
{
_rotationY = value;
@@ -852,7 +902,11 @@ namespace FairyGUI
/// </summary>
public float alpha
{
get { return _alpha; }
get
{
return _alpha;
}
set
{
@@ -867,7 +921,10 @@ namespace FairyGUI
/// </summary>
public bool visible
{
get { return _visible; }
get
{
return _visible;
}
set
{
@@ -885,17 +942,26 @@ namespace FairyGUI
internal bool internalVisible
{
get { return _internalVisible && (group == null || group.internalVisible); }
get
{
return _internalVisible && (group == null || group.internalVisible);
}
}
internal bool internalVisible2
{
get { return _visible && (group == null || group.internalVisible2); }
get
{
return _visible && (group == null || group.internalVisible2);
}
}
internal bool internalVisible3
{
get { return _visible && _internalVisible; }
get
{
return _visible && _internalVisible;
}
}
/// <summary>
@@ -925,10 +991,7 @@ namespace FairyGUI
public bool focusable
{
get { return displayObject != null && displayObject.focusable; }
set
{
if (displayObject != null) displayObject.focusable = value;
}
set { if (displayObject != null) displayObject.focusable = value; }
}
/// <summary>
@@ -937,10 +1000,7 @@ namespace FairyGUI
public bool tabStop
{
get { return displayObject != null && displayObject.tabStop; }
set
{
if (displayObject != null) displayObject.tabStop = value;
}
set { if (displayObject != null) displayObject.tabStop = value; }
}
/// <summary>
@@ -1023,10 +1083,7 @@ namespace FairyGUI
virtual public IFilter filter
{
get { return displayObject != null ? displayObject.filter : null; }
set
{
if (displayObject != null) displayObject.filter = value;
}
set { if (displayObject != null) displayObject.filter = value; }
}
/// <summary>
@@ -1035,10 +1092,7 @@ namespace FairyGUI
virtual public BlendMode blendMode
{
get { return displayObject != null ? displayObject.blendMode : BlendMode.None; }
set
{
if (displayObject != null) displayObject.blendMode = value;
}
set { if (displayObject != null) displayObject.blendMode = value; }
}
/// <summary>
@@ -1076,7 +1130,10 @@ namespace FairyGUI
/// </summary>
public bool inContainer
{
get { return displayObject != null && displayObject.parent != null; }
get
{
return displayObject != null && displayObject.parent != null;
}
}
/// <summary>
@@ -1084,7 +1141,10 @@ namespace FairyGUI
/// </summary>
public bool onStage
{
get { return displayObject != null && displayObject.stage != null; }
get
{
return displayObject != null && displayObject.stage != null;
}
}
/// <summary>
@@ -1106,7 +1166,10 @@ namespace FairyGUI
/// </summary>
public GearXY gearXY
{
get { return (GearXY)GetGear(1); }
get
{
return (GearXY)GetGear(1);
}
}
/// <summary>
@@ -1114,7 +1177,10 @@ namespace FairyGUI
/// </summary>
public GearSize gearSize
{
get { return (GearSize)GetGear(2); }
get
{
return (GearSize)GetGear(2);
}
}
/// <summary>
@@ -1122,7 +1188,10 @@ namespace FairyGUI
/// </summary>
public GearLook gearLook
{
get { return (GearLook)GetGear(3); }
get
{
return (GearLook)GetGear(3);
}
}
public GearBase GetGear(int index)
@@ -1165,10 +1234,8 @@ namespace FairyGUI
default:
throw new System.Exception("FairyGUI: invalid gear index!");
}
_gears[index] = gear;
}
return gear;
}
@@ -1256,7 +1323,6 @@ namespace FairyGUI
if (gear != null && gear.controller == c)
gear.Apply();
}
_handlingController = false;
CheckGearDisplay();
@@ -1355,10 +1421,7 @@ namespace FairyGUI
virtual public string text
{
get { return null; }
set
{
/*override in child*/
}
set { /*override in child*/}
}
/// <summary>
@@ -1367,10 +1430,7 @@ namespace FairyGUI
virtual public string icon
{
get { return null; }
set
{
/*override in child*/
}
set { /*override in child*/}
}
/// <summary>
@@ -1445,7 +1505,6 @@ namespace FairyGUI
pt.x += _width * _pivotX;
pt.y += _height * _pivotY;
}
return displayObject.LocalToGlobal(pt);
}
@@ -1462,7 +1521,6 @@ namespace FairyGUI
pt.x -= _width * _pivotX;
pt.y -= _height * _pivotY;
}
return pt;
}
@@ -1536,7 +1594,6 @@ namespace FairyGUI
}
else
pt = r.LocalToGlobal(pt);
return GlobalToLocal(pt);
}
@@ -1577,7 +1634,6 @@ namespace FairyGUI
pt.x += _width * _pivotX;
pt.y += _height * _pivotY;
}
return this.displayObject.TransformPoint(pt, targetSpace != null ? targetSpace.displayObject : Stage.inst);
}
@@ -1594,7 +1650,6 @@ namespace FairyGUI
rect.x += _width * _pivotX;
rect.y += _height * _pivotY;
}
return this.displayObject.TransformRect(rect, targetSpace != null ? targetSpace.displayObject : Stage.inst);
}
@@ -1626,13 +1681,11 @@ namespace FairyGUI
if (gear != null)
gear.Dispose();
}
if (displayObject != null)
{
displayObject.gOwner = null;
displayObject.Dispose();
}
data = null;
}
@@ -1800,7 +1853,6 @@ namespace FairyGUI
xv += _width * _pivotX;
yv += _height * _pivotY;
}
displayObject.location = new Vector3(xv, yv, _z);
}
}
@@ -1947,7 +1999,6 @@ namespace FairyGUI
}
#region Drag support
Vector2 _dragTouchStartPos;
bool _dragTesting;
@@ -2084,11 +2135,9 @@ namespace FairyGUI
DispatchEvent("onDragEnd", null);
}
}
#endregion
#region Tween Helpers
public GTweener TweenMove(Vector2 endValue, float duration)
{
return GTween.To(this.xy, endValue, duration).SetTarget(this, TweenPropType.XY);
@@ -2133,7 +2182,6 @@ namespace FairyGUI
{
return GTween.To(_rotation, endValue, duration).SetTarget(this, TweenPropType.Rotation);
}
#endregion
}
}
}

View File

@@ -199,7 +199,7 @@ namespace FairyGUI.Utils
if (_attributes == null)
_attributes = new Dictionary<string, string>();
_attributes[attrName] = string.Format("{0:#.####}", attrValue);
_attributes[attrName] = string.Format("{0:0.####}", attrValue);
}
public void RemoveAttribute(string attrName)