Skip to content

路径相关

javascript
const core = require('cheese-js');
lua
local core = require('cheese-lua')

脚本assets目录: public static readonly ASSETS_DIRECTORY: File

返回值:

  • 🟢 File — 资源目录对应的 File 对象实例
  • 🔴 null

用法示例:

javascript
const core = require('cheese-js'); // 导入核心模块
const path = core.path;

const assetsDir = path.ASSETS_DIRECTORY;
console.log("资源目录路径:", assetsDir.getAbsolutePath());
lua
local core = require('cheese-lua')
local path = core.path
local assetsDir = path.ASSETS_DIRECTORY
print("资源目录路径:", assetsDir:getAbsolutePath())

脚本根目录: public static readonly ROOT_DIRECTORY: File

返回值:

  • 🟢 File — 根目录对应的 File 对象实例
  • 🔴 null

用法示例:

javascript
const core = require('cheese-js'); // 导入核心模块
const path = core.path;

const rootDir = path.ROOT_DIRECTORY;
console.log("根目录路径:", rootDir.getAbsolutePath());
lua
local core = require('cheese-lua')
local path = core.path
local rootDir = path.ROOT_DIRECTORY
print("根目录路径:", rootDir:getAbsolutePath())

日志目录: public static readonly LOG_DIRECTORY: File

返回值:

  • 🟢 File — 日志目录对应的 File 对象实例
  • 🔴 null

用法示例:

javascript
const core = require('cheese-js'); // 导入核心模块
const path = core.path;

const logDir = path.LOG_DIRECTORY;
console.log("日志目录路径:", logDir.getAbsolutePath());
lua
local core = require('cheese-lua')
local path = core.path
local logDir = path.LOG_DIRECTORY
print("日志目录路径:", logDir:getAbsolutePath())

脚本目录: public static readonly JS_DIRECTORY: File

返回值:

  • 🟢 File — 脚本目录对应的 File 对象实例
  • 🔴 null

用法示例:

javascript
const core = require('cheese-js'); // 导入核心模块
const path = core.path;

const jsDir = path.JS_DIRECTORY;
console.log("脚本目录路径:", jsDir.getAbsolutePath());
lua
local core = require('cheese-lua')
local path = core.path
local jsDir = path.JS_DIRECTORY
print("脚本目录路径:", jsDir:getAbsolutePath())

主目录: public static readonly MAIN_DIRECTORY: File

返回值:

  • 🟢 File — 主目录对应的 File 对象实例
  • 🔴 null

用法示例:

javascript
const core = require('cheese-js'); // 导入核心模块
const path = core.path;

const mainDir = path.MAIN_DIRECTORY;
console.log("主目录路径:", mainDir.getAbsolutePath());
lua
local core = require('cheese-lua')
local path = core.path
local mainDir = path.MAIN_DIRECTORY
print("主目录路径:", mainDir:getAbsolutePath())

UI 目录: public static readonly UI_DIRECTORY: File

返回值:

  • 🟢 File — UI 目录对应的 File 对象实例
  • 🔴 null

用法示例:

javascript
const core = require('cheese-js'); // 导入核心模块
const path = core.path;

const uiDir = path.UI_DIRECTORY;
console.log("UI 目录路径:", uiDir.getAbsolutePath());
lua
local core = require('cheese-lua')
local path = core.path
local uiDir = path.UI_DIRECTORY
print("UI 目录路径:", uiDir:getAbsolutePath())

工作目录: public static readonly WORKING_DIRECTORY: File

返回值:

  • 🟢 File — 当前工作目录对应的 File 对象实例
  • 🔴 null

用法示例:

javascript
const core = require('cheese-js'); // 导入核心模块
const path = core.path;

const workingDir = path.WORKING_DIRECTORY;
console.log("当前工作目录路径:", workingDir.getAbsolutePath());
lua
local core = require('cheese-lua')
local path = core.path
local workingDir = path.WORKING_DIRECTORY
print("当前工作目录路径:", workingDir:getAbsolutePath())

Released under the GPL-3.0 License.