feat: group 1.0.0
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
Prefab,
|
||||
instantiate,
|
||||
director,
|
||||
Color,
|
||||
} from "cc";
|
||||
import { NoteControl } from "./NoteControl";
|
||||
import { BombEffect } from "../effects/BombEffectControl";
|
||||
@@ -43,6 +44,8 @@ export class DinoControl extends Component {
|
||||
lineNode: Node = null;
|
||||
|
||||
onLoad() {
|
||||
// 设置小恐龙颜色
|
||||
this.setDinoColor();
|
||||
// 监听继续游戏事件
|
||||
EventDispatcher.getTarget().on(
|
||||
EventDispatcher.GAME_RESUME,
|
||||
@@ -130,6 +133,10 @@ export class DinoControl extends Component {
|
||||
// 设置这个空节点的父节点
|
||||
neckChild.parent = this.node.getChildByName("dino_neck_box");
|
||||
|
||||
// 设置脖子的颜色
|
||||
neckChild.getComponent(Sprite).color = new Color(
|
||||
GlobalData.currentDinoInfo.dinoColor,
|
||||
);
|
||||
// 获取小恐龙身体
|
||||
const bodyNode = this.node.getChildByName("dino_body");
|
||||
|
||||
@@ -216,5 +223,19 @@ export class DinoControl extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
// 设置小恐龙颜色
|
||||
setDinoColor() {
|
||||
// 获取当前小恐龙信息
|
||||
const dinoInfo = GlobalData.currentDinoInfo;
|
||||
// 获取小恐龙颜色
|
||||
const dinoColor = new Color(dinoInfo.dinoColor);
|
||||
// 设置小恐龙身体颜色
|
||||
this.node.getChildByName("dino_body").getComponent(Sprite).color =
|
||||
dinoColor;
|
||||
// 设置小恐龙头部颜色
|
||||
this.node.getChildByName("dino_head").getComponent(Sprite).color =
|
||||
dinoColor;
|
||||
}
|
||||
|
||||
update(deltaTime: number) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user