mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-17 03:35:49 +08:00
添加工具类注释
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: dgflash
|
||||
* @Date: 2022-02-11 09:32:47
|
||||
* @LastEditors: dgflash
|
||||
* @LastEditTime: 2022-08-03 15:48:31
|
||||
* @LastEditTime: 2022-08-12 16:52:00
|
||||
*/
|
||||
import { ECSRootSystem } from "../libs/ecs/ECSSystem";
|
||||
import { LanguageManager } from "../libs/gui/language/Language";
|
||||
@@ -20,6 +20,7 @@ export var version: string = "1.0.8";
|
||||
|
||||
export class oops {
|
||||
/** ----------核心模块---------- */
|
||||
|
||||
/** 日志管理 */
|
||||
static log = Logger;
|
||||
/** 全局消息 */
|
||||
|
||||
@@ -67,6 +67,7 @@ export class Root extends Component {
|
||||
oops.game = new GameManager(this.game!);
|
||||
oops.gui = new LayerManager(this.gui!);
|
||||
this.initGui();
|
||||
|
||||
oops.ecs = new ecs.RootSystem();
|
||||
this.initEcsSystem();
|
||||
oops.ecs.init();
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
* @Author: dgflash
|
||||
* @Date: 2021-08-11 16:41:12
|
||||
* @LastEditors: dgflash
|
||||
* @LastEditTime: 2022-01-24 15:00:52
|
||||
*/
|
||||
/**
|
||||
* 数组工具
|
||||
* @LastEditTime: 2022-08-12 16:51:46
|
||||
*/
|
||||
|
||||
/** 数组工具 */
|
||||
export default class ArrayUtil {
|
||||
/** 去重 */
|
||||
public static noRepeated(arr: any[]) {
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* @Author: dgflash
|
||||
* @Date: 2022-07-26 15:29:57
|
||||
* @LastEditors: dgflash
|
||||
* @LastEditTime: 2022-08-12 16:51:38
|
||||
*/
|
||||
import { Camera, Vec3, view } from "cc";
|
||||
|
||||
/** 摄像机工具 */
|
||||
export class CameraUtil {
|
||||
/**
|
||||
* 当前世界坐标是否在摄像机显示范围内
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/** 数学工具 */
|
||||
export class MathUtil {
|
||||
/**
|
||||
* 角度转弧度
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
/**
|
||||
* 对象工具
|
||||
/*
|
||||
* @Author: dgflash
|
||||
* @Date: 2022-07-26 15:29:57
|
||||
* @LastEditors: dgflash
|
||||
* @LastEditTime: 2022-08-12 16:50:30
|
||||
*/
|
||||
|
||||
/** 对象工具 */
|
||||
export default class ObjectUtil {
|
||||
/**
|
||||
* 判断指定的值是否为对象
|
||||
|
||||
@@ -1,27 +1,31 @@
|
||||
/*
|
||||
* @Date: 2021-08-14 16:17:03
|
||||
* @LastEditors: H.Joeson
|
||||
* @LastEditTime: 2021-11-25 15:52:12
|
||||
* @LastEditors: dgflash
|
||||
* @LastEditTime: 2022-08-12 16:50:15
|
||||
*/
|
||||
import { sys } from "cc";
|
||||
import { native, sys } from "cc";
|
||||
|
||||
/** 平台数据 */
|
||||
export class PlatformUtil {
|
||||
/** 是否为安卓系统 */
|
||||
public static isNativeAndroid() {
|
||||
if (typeof jsb == "undefined")
|
||||
if (typeof native == "undefined")
|
||||
return false
|
||||
if (sys.isNative && sys.platform === sys.Platform.ANDROID)
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
/** 是否为苹果系统 */
|
||||
public static isNativeIOS() {
|
||||
if (typeof jsb == "undefined")
|
||||
if (typeof native == "undefined")
|
||||
return false
|
||||
if (sys.isNative && sys.os === sys.OS.IOS)
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
/** 获取平台名 */
|
||||
public static getPlateform() {
|
||||
if (this.isNativeAndroid())
|
||||
return 'android'
|
||||
@@ -31,7 +35,7 @@ export class PlatformUtil {
|
||||
return 'h5'
|
||||
}
|
||||
|
||||
public static isIOSwebview = function () {
|
||||
public static isIOSWebview() {
|
||||
//@ts-ignore
|
||||
if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.sdkLoginOut)
|
||||
return true
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
/**
|
||||
* 正则工具
|
||||
/*
|
||||
* @Author: dgflash
|
||||
* @Date: 2022-07-26 15:29:57
|
||||
* @LastEditors: dgflash
|
||||
* @LastEditTime: 2022-08-12 16:48:08
|
||||
*/
|
||||
|
||||
/** 正则工具 */
|
||||
export default class RegexUtil {
|
||||
/**
|
||||
* 判断字符是否为双字节字符(如中文字符)
|
||||
* @param string 原字符串
|
||||
*/
|
||||
public static isDWORD(string: string): boolean {
|
||||
public static isDoubleWord(string: string): boolean {
|
||||
return /[^\x00-\xff]/.test(string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
/*
|
||||
* @Author: dgflash
|
||||
* @Date: 2022-07-26 15:29:57
|
||||
* @LastEditors: dgflash
|
||||
* @LastEditTime: 2022-08-12 16:50:07
|
||||
*/
|
||||
import { Node, Quat, toRadian, Vec3 } from "cc";
|
||||
import { Vec3Util } from "./Vec3Util";
|
||||
|
||||
/** 旋转工具 */
|
||||
export class RotateUtil {
|
||||
/**
|
||||
* 自由旋转
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
import { Vec3 } from "cc";
|
||||
|
||||
/*
|
||||
* @Author: dgflash
|
||||
* @Date: 2021-08-11 16:41:12
|
||||
* @LastEditors: H.Joeson
|
||||
* @LastEditTime: 2021-09-14 10:54:02
|
||||
*/
|
||||
/** 字符串工具 */
|
||||
export class StringUtil {
|
||||
/** 123456789 = 123,456,789 */
|
||||
public static numberTotPermil(num: number): string {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { Mat4, Vec3 } from "cc";
|
||||
import { MathUtil } from "./MathUtil";
|
||||
|
||||
/** 向量工具 */
|
||||
export class Vec3Util {
|
||||
/**
|
||||
* X轴
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
* @Author: dgflash
|
||||
* @Date: 2021-08-16 09:34:56
|
||||
* @LastEditors: dgflash
|
||||
* @LastEditTime: 2022-07-25 11:51:27
|
||||
* @LastEditTime: 2022-08-12 16:49:41
|
||||
*/
|
||||
import { Animation, AnimationClip, EventTouch, instantiate, Node, Prefab, Size, UITransform, v3, Vec3 } from "cc";
|
||||
import { resLoader } from "../common/loader/ResLoader";
|
||||
|
||||
/** 显示对象工具 */
|
||||
export class ViewUtil {
|
||||
/**
|
||||
* 把Node当前的节点树结构根据Node命名转成一个js对象,重名的组件会覆盖,
|
||||
|
||||
Reference in New Issue
Block a user