46 lines
1.0 KiB
TypeScript
46 lines
1.0 KiB
TypeScript
// Learn TypeScript:
|
|
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
|
|
// Learn Attribute:
|
|
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
|
|
// Learn life-cycle callbacks:
|
|
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
|
|
|
|
import MapConroler from "../Map";
|
|
import NumberToImage from "../NumberToImage";
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
|
|
|
|
|
@ccclass
|
|
export default class Freeze extends cc.Component {
|
|
static _instance: any;
|
|
time: number = 60;
|
|
|
|
@property(cc.Material)
|
|
freeze: cc.Material = null;
|
|
|
|
@property(cc.SpriteAtlas)
|
|
simple_SpriteFrame: cc.SpriteAtlas = null;
|
|
posX: any;
|
|
posY: any;
|
|
color: number = -1;
|
|
// mapInfo: number[][] = [];
|
|
|
|
onLoad() {
|
|
|
|
}
|
|
|
|
start() {
|
|
|
|
}
|
|
|
|
setSpriteFrame(number, color) {
|
|
let simpleSpriteFrame = this.simple_SpriteFrame.getSpriteFrame(("simple" + number));
|
|
this.node.getComponent(cc.Sprite).spriteFrame = simpleSpriteFrame;
|
|
}
|
|
|
|
|
|
// update (dt) {}
|
|
}
|