mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
This reverts commit fb35719387.
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
import { ray } from '../../3d/geom-utils';
|
||||
import { Component } from '../../components/component';
|
||||
import { ccclass, executeInEditMode, menu, property } from '../../core/data/class-decorator';
|
||||
import { constget } from '../../core/data/utils/constget';
|
||||
import { Color, Enum, Rect, Vec3 } from '../../core/value-types';
|
||||
import { color4, toRadian } from '../../core/vmath';
|
||||
import { GFXClearFlag } from '../../gfx/define';
|
||||
@@ -209,8 +208,7 @@ export class CameraComponent extends Component {
|
||||
* @zh 相机的颜色缓冲默认值。
|
||||
*/
|
||||
@property
|
||||
@constget
|
||||
get color (): Readonly<Color> {
|
||||
get color () {
|
||||
return this._color;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
*/
|
||||
import { Component } from '../../components/component';
|
||||
import { ccclass, property } from '../../core/data/class-decorator';
|
||||
import { constget } from '../../core/data/utils/constget';
|
||||
import { Color, Enum } from '../../core/value-types';
|
||||
import { Light, LightType } from '../../renderer/scene/light';
|
||||
import { RenderScene } from '../../renderer/scene/render-scene';
|
||||
@@ -56,8 +55,7 @@ export class LightComponent extends Component {
|
||||
* 光源颜色。
|
||||
*/
|
||||
@property
|
||||
@constget
|
||||
get color (): Readonly<Color> {
|
||||
get color () {
|
||||
return this._color;
|
||||
}
|
||||
set color (val) {
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
import { SpriteFrame } from '../../../assets';
|
||||
import { Component, EventHandler as ComponentEventHandler } from '../../../components';
|
||||
import { ccclass, executeInEditMode, executionOrder, menu, property } from '../../../core/data/class-decorator';
|
||||
import { constget } from '../../../core/data/utils/constget';
|
||||
import { EventMouse, EventTouch, SystemEventType } from '../../../core/platform';
|
||||
import { lerp } from '../../../core/utils';
|
||||
import { Color, Vec3 } from '../../../core/value-types';
|
||||
@@ -197,8 +196,7 @@ export class ButtonComponent extends Component {
|
||||
* 普通状态下按钮所显示的颜色。
|
||||
*/
|
||||
@property
|
||||
@constget
|
||||
get normalColor (): Readonly<Color> {
|
||||
get normalColor () {
|
||||
return this._normalColor;
|
||||
}
|
||||
|
||||
@@ -216,8 +214,7 @@ export class ButtonComponent extends Component {
|
||||
* 按下状态时按钮所显示的颜色。
|
||||
*/
|
||||
@property
|
||||
@constget
|
||||
get pressedColor (): Readonly<Color> {
|
||||
get pressedColor () {
|
||||
return this._pressColor;
|
||||
}
|
||||
|
||||
@@ -234,8 +231,7 @@ export class ButtonComponent extends Component {
|
||||
* 悬停状态下按钮所显示的颜色。
|
||||
*/
|
||||
@property
|
||||
@constget
|
||||
get hoverColor (): Readonly<Color> {
|
||||
get hoverColor () {
|
||||
return this._hoverColor;
|
||||
}
|
||||
|
||||
@@ -251,8 +247,7 @@ export class ButtonComponent extends Component {
|
||||
* 禁用状态下按钮所显示的颜色。
|
||||
*/
|
||||
@property
|
||||
@constget
|
||||
get disabledColor (): Readonly<Color> {
|
||||
get disabledColor () {
|
||||
return this._disabledColor;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
*/
|
||||
|
||||
import { ccclass, executionOrder, menu, property } from '../../../core/data/class-decorator';
|
||||
import { constget } from '../../../core/data/utils/constget';
|
||||
import { Color } from '../../../core/value-types';
|
||||
import { Model } from '../../../renderer';
|
||||
import { UI } from '../../../renderer/ui/ui';
|
||||
@@ -111,12 +110,11 @@ export class GraphicsComponent extends UIRenderComponent {
|
||||
* 线段颜色。
|
||||
*/
|
||||
@property
|
||||
@constget
|
||||
get strokeColor (): Readonly<Color> {
|
||||
get strokeColor () {
|
||||
return this._strokeColor;
|
||||
}
|
||||
|
||||
set strokeColor (value) {
|
||||
set strokeColor (value: Color) {
|
||||
if (!this.impl) {
|
||||
return;
|
||||
}
|
||||
@@ -130,8 +128,7 @@ export class GraphicsComponent extends UIRenderComponent {
|
||||
* 填充颜色。
|
||||
*/
|
||||
@property
|
||||
@constget
|
||||
get fillColor (): Readonly<Color> {
|
||||
get fillColor () {
|
||||
return this._fillColor;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
import { Component } from '../../../components';
|
||||
import { ccclass, executionOrder, menu, property } from '../../../core/data/class-decorator';
|
||||
import { constget } from '../../../core/data/utils/constget';
|
||||
import { Color } from '../../../core/value-types';
|
||||
import { LabelComponent } from './label-component';
|
||||
|
||||
@@ -68,8 +67,7 @@ export class LabelOutlineComponent extends Component {
|
||||
* ```
|
||||
*/
|
||||
@property
|
||||
@constget
|
||||
get color (): Readonly<Color> {
|
||||
get color () {
|
||||
return this._color;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
import { Component } from '../../../components/component';
|
||||
import { ccclass, executeInEditMode, executionOrder, menu, property } from '../../../core/data/class-decorator';
|
||||
import { constget } from '../../../core/data/utils/constget';
|
||||
import { Rect, Size, Vec2, Vec3 } from '../../../core/value-types';
|
||||
import { ccenum } from '../../../core/value-types/enum';
|
||||
import { vec3 } from '../../../core/vmath';
|
||||
@@ -217,17 +216,16 @@ export class LayoutComponent extends Component {
|
||||
* 每个格子的大小,只有布局类型为 GRID 的时候才有效。
|
||||
*/
|
||||
@property
|
||||
@constget
|
||||
get cellSize (): Readonly<Size> {
|
||||
get cellSize () {
|
||||
return this._cellSize;
|
||||
}
|
||||
|
||||
set cellSize (value) {
|
||||
set cellSize (value: Size) {
|
||||
if (this._cellSize === value) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._cellSize.set(value);
|
||||
this._cellSize = value;
|
||||
this._doLayoutDirty();
|
||||
}
|
||||
|
||||
@@ -446,7 +444,7 @@ export class LayoutComponent extends Component {
|
||||
@property
|
||||
private _N$padding = 0;
|
||||
@property
|
||||
private _cellSize = new Size(40, 40);
|
||||
private _cellSize = cc.size(40, 40);
|
||||
@property
|
||||
private _startAxis = AxisDirection.HORIZONTAL;
|
||||
@property
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
import { SpriteFrame } from '../../../assets';
|
||||
import { ccclass, executionOrder, menu, property} from '../../../core/data/class-decorator';
|
||||
import { constget } from '../../../core/data/utils/constget';
|
||||
import { SystemEventType } from '../../../core/platform';
|
||||
import { Color, Mat4, Size, Vec2, Vec3 } from '../../../core/value-types';
|
||||
import { ccenum } from '../../../core/value-types/enum';
|
||||
@@ -238,8 +237,7 @@ export class MaskComponent extends UIRenderComponent {
|
||||
visible: false,
|
||||
override: true,
|
||||
})
|
||||
@constget
|
||||
get color (): Readonly<Color> {
|
||||
get color () {
|
||||
return this._color;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ import {
|
||||
property,
|
||||
requireComponent,
|
||||
} from '../../../core/data/class-decorator';
|
||||
import { constget } from '../../../core/data/utils/constget';
|
||||
import { SystemEventType } from '../../../core/platform';
|
||||
import { Color } from '../../../core/value-types';
|
||||
import { ccenum } from '../../../core/value-types/enum';
|
||||
@@ -142,8 +141,7 @@ export class UIRenderComponent extends UIComponent {
|
||||
@property({
|
||||
displayOrder: 2,
|
||||
})
|
||||
@constget
|
||||
get color (): Readonly<Color> {
|
||||
get color () {
|
||||
return this._color;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
import { Component } from '../../../components';
|
||||
import { ccclass, executeInEditMode, executionOrder, menu, property } from '../../../core/data/class-decorator';
|
||||
import { constget } from '../../../core/data/utils/constget';
|
||||
import { SystemEventType } from '../../../core/platform/event-manager/event-enum';
|
||||
import { EventListener, ILinstenerMask } from '../../../core/platform/event-manager/event-listener';
|
||||
import { Mat4, Rect, Size, Vec2, Vec3 } from '../../../core/value-types';
|
||||
@@ -61,8 +60,7 @@ export class UITransformComponent extends Component {
|
||||
@property({
|
||||
displayOrder: 0,
|
||||
})
|
||||
@constget
|
||||
get contentSize (): Readonly<Size> {
|
||||
get contentSize () {
|
||||
return this._contentSize;
|
||||
}
|
||||
|
||||
@@ -139,8 +137,7 @@ export class UITransformComponent extends Component {
|
||||
@property({
|
||||
displayOrder: 1,
|
||||
})
|
||||
@constget
|
||||
get anchorPoint (): Readonly<Vec2> {
|
||||
get anchorPoint () {
|
||||
return this._anchorPoint;
|
||||
}
|
||||
|
||||
@@ -181,9 +178,9 @@ export class UITransformComponent extends Component {
|
||||
|
||||
public static EventType = SystemEventType;
|
||||
@property
|
||||
private _contentSize = new Size(100, 100);
|
||||
public _contentSize = new Size(100, 100);
|
||||
@property
|
||||
private _anchorPoint = new Vec2(0.5, 0.5);
|
||||
public _anchorPoint = new Vec2(0.5, 0.5);
|
||||
|
||||
public __preload () {
|
||||
this.node.uiTransfromComp = this;
|
||||
|
||||
@@ -39,7 +39,7 @@ const toFloat = 1 / 255;
|
||||
* 每个通道都为取值范围 [0, 255] 的整数。
|
||||
*/
|
||||
export default class Color extends ValueType {
|
||||
public _val: number;
|
||||
private _val: number;
|
||||
|
||||
/**
|
||||
* 构造与指定颜色相等的颜色。
|
||||
|
||||
@@ -484,7 +484,6 @@ export class Node extends BaseNode {
|
||||
* @zh
|
||||
* 本地旋转
|
||||
*/
|
||||
@constget
|
||||
public get rotation (): Readonly<Quat> {
|
||||
return this._lrot;
|
||||
}
|
||||
@@ -539,7 +538,6 @@ export class Node extends BaseNode {
|
||||
* @zh
|
||||
* 本地缩放
|
||||
*/
|
||||
@constget
|
||||
public get scale (): Readonly<Vec3> {
|
||||
return this._lscale;
|
||||
}
|
||||
@@ -606,7 +604,6 @@ export class Node extends BaseNode {
|
||||
* @zh
|
||||
* 世界坐标
|
||||
*/
|
||||
@constget
|
||||
public get worldPosition (): Readonly<Vec3> {
|
||||
this.updateWorldTransform();
|
||||
return this._pos;
|
||||
@@ -693,7 +690,6 @@ export class Node extends BaseNode {
|
||||
* @zh
|
||||
* 世界旋转
|
||||
*/
|
||||
@constget
|
||||
public get worldRotation (): Readonly<Quat> {
|
||||
this.updateWorldTransform();
|
||||
return this._rot;
|
||||
@@ -755,7 +751,6 @@ export class Node extends BaseNode {
|
||||
* @zh
|
||||
* 世界缩放
|
||||
*/
|
||||
@constget
|
||||
public get worldScale (): Readonly<Vec3> {
|
||||
this.updateWorldTransform();
|
||||
return this._scale;
|
||||
@@ -779,7 +774,6 @@ export class Node extends BaseNode {
|
||||
* @zh
|
||||
* 世界变换矩阵
|
||||
*/
|
||||
@constget
|
||||
public get worldMatrix (): Readonly<Mat4> {
|
||||
this.updateWorldTransformFull();
|
||||
return this._mat;
|
||||
|
||||
Reference in New Issue
Block a user