Skip to content

Commit

Permalink
Update root.ts and action-manager.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
dumganhar committed Oct 12, 2024
1 parent 37fb5fc commit 851ae8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
14 changes: 0 additions & 14 deletions cocos/root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,6 @@ export class Root {
public set fixedFPS (fps: number) {
if (fps > 0) {
this._fixedFPS$ = fps;
this._fixedFPSFrameTime = 1000.0 / fps;
} else {
this._fixedFPSFrameTime = 0;
}
}

Expand Down Expand Up @@ -469,17 +466,6 @@ export class Root {
public frameMove (deltaTime: number): void {
this._frameTime$ = deltaTime;

/*
if (this._fixedFPSFrameTime > 0) {
const elapsed = this._frameTime * 1000.0;
if (this._fixedFPSFrameTime > elapsed) {
setTimeout(function () {}, this._fixedFPSFrameTime - elapsed);
}
}
*/

++this._frameCount$;
this._cumulativeTime$ += deltaTime;
this._fpsTime$ += deltaTime;
Expand Down
8 changes: 4 additions & 4 deletions cocos/tween/actions/action-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/

import { errorID, logID } from '../../core/platform/debug';
import { Action } from './action';
import { Action, ActionEnum } from './action';
import { isCCObject } from '../../core/data/object';
import { Node, NodeEventType } from '../../scene-graph';

Expand Down Expand Up @@ -267,7 +267,7 @@ export class ActionManager {
* @param {T} target
*/
removeActionByTag<T> (tag: number, target?: T): void {
if (tag === Action.TAG_INVALID) logID(1002);
if (tag === ActionEnum.TAG_INVALID) logID(1002);

const hashTargets = this._hashTargets;
if (target) {
Expand All @@ -290,7 +290,7 @@ export class ActionManager {
* @param {T} target
*/
removeAllActionsByTag<T> (tag: number, target?: T): void {
if (tag === Action.TAG_INVALID) logID(1002);
if (tag === ActionEnum.TAG_INVALID) logID(1002);

const hashTargets = this._hashTargets;
if (target) {
Expand All @@ -314,7 +314,7 @@ export class ActionManager {
* @return {Action|null} return the Action with the given tag on success
*/
getActionByTag<T> (tag: number, target: T): Action | null {
if (tag === Action.TAG_INVALID) logID(1004);
if (tag === ActionEnum.TAG_INVALID) logID(1004);

const element = this._hashTargets.get(target);
if (element) {
Expand Down

0 comments on commit 851ae8b

Please sign in to comment.