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

@@ -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
}
}
}