mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
fdaaf22ea4
* remove unused files * typing
53 lines
2.3 KiB
TypeScript
53 lines
2.3 KiB
TypeScript
/****************************************************************************
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
|
|
|
http://www.cocos.com
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated engine source code (the "Software"), a limited,
|
|
worldwide, royalty-free, non-assignable, revocable and non-exclusive license
|
|
to use Cocos Creator solely to develop games on your target platforms. You shall
|
|
not use Cocos Creator software for developing other software or tools that's
|
|
used for developing games. You are not granted to publish, distribute,
|
|
sublicense, and/or sell copies of Cocos Creator.
|
|
|
|
The software or tools in this License Agreement are licensed, not sold.
|
|
Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
THE SOFTWARE.
|
|
****************************************************************************/
|
|
|
|
import {ccclass, property} from '../core/data/class-decorator';
|
|
import { Asset } from './asset';
|
|
|
|
/**
|
|
* !#en
|
|
* Class for JSON file. When the JSON file is loaded, this object is returned.
|
|
* The parsed JSON object can be accessed through the `json` attribute in it.<br>
|
|
* If you want to get the original JSON text, you should modify the extname to `.txt`
|
|
* so that it is loaded as a `TextAsset` instead of a `JsonAsset`.
|
|
*
|
|
* !#zh
|
|
* JSON 资源类。JSON 文件加载后,将会返回该对象。可以通过其中的 `json` 属性访问解析后的 JSON 对象。<br>
|
|
* 如果你想要获得 JSON 的原始文本,那么应该修改源文件的后缀为 `.txt`,这样就会加载为一个 `TextAsset` 而不是 `JsonAsset`。
|
|
*
|
|
* @class JsonAsset
|
|
* @extends Asset
|
|
*/
|
|
@ccclass('cc.JsonAsset')
|
|
export default class JsonAsset extends Asset {
|
|
/**
|
|
* @property json - The loaded JSON object.
|
|
*/
|
|
@property()
|
|
public json: object | null = null;
|
|
}
|
|
|
|
cc.JsonAsset = JsonAsset;
|