feat: group 1.0.0
This commit is contained in:
@@ -21,6 +21,8 @@ export class NoteControl extends Component {
|
||||
// 是否开始下落
|
||||
private isEnableFall: boolean = false;
|
||||
start() {
|
||||
// 设置小恐龙脖子颜色
|
||||
this.setDinoNeckColor();
|
||||
// 监听清除可视区域音符事件
|
||||
EventDispatcher.getTarget().on(
|
||||
EventDispatcher.CLEAR_SCREEN_NOTE,
|
||||
@@ -59,6 +61,7 @@ export class NoteControl extends Component {
|
||||
const noteHitSprite = this.node
|
||||
.getChildByName("note_img")
|
||||
.getComponent(Sprite);
|
||||
|
||||
// 4. 获取音符的颜色
|
||||
const noteColor = new Color("ffffff");
|
||||
// 5. 操作音符闪烁
|
||||
@@ -70,7 +73,7 @@ export class NoteControl extends Component {
|
||||
color: new Color(noteColor.r, noteColor.g, noteColor.b, 0),
|
||||
})
|
||||
.to(0.2, {
|
||||
color: noteColor,
|
||||
color: new Color(GlobalData.currentDinoInfo.dinoColor),
|
||||
}),
|
||||
)
|
||||
.call(() => {
|
||||
@@ -144,6 +147,18 @@ export class NoteControl extends Component {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 设置小恐龙脖子颜色
|
||||
private setDinoNeckColor() {
|
||||
// 获取当前小恐龙信息
|
||||
const dinoInfo = GlobalData.currentDinoInfo;
|
||||
// 获取小恐龙脖子节点
|
||||
const dinoNeckNode = this.node.getChildByName("note_img");
|
||||
// 获取小恐龙脖子节点下的 Sprite 组件
|
||||
const dinoNeckSprite = dinoNeckNode.getComponent(Sprite);
|
||||
// 设置小恐龙脖子颜色
|
||||
dinoNeckSprite.color = new Color(dinoInfo.dinoColor);
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
// 游戏未开始,不更新音符位置
|
||||
if (!this.isEnableFall || GlobalData.gameState != GameState.PLAYING) {
|
||||
|
||||
Reference in New Issue
Block a user