DaFuWeng/assets/Script/UIRoot/GameRoleController.ts

49 lines
1.2 KiB
TypeScript
Raw Normal View History

/*
* @Author: WoNiu
* @Date: 2024-03-29 14:04:56
* @LastEditTime: 2024-03-29 14:14:48
* @LastEditors: WoNiu
* @Description:
*/
import { _decorator, Component, Node } from "cc";
import { GamerRoleNode } from "../Gamer/GamerRoleNode";
import { GamerRoleType } from "../Gamer/GamerRoleType";
const { ccclass, property } = _decorator;
@ccclass("GameRoleController")
/**
* @description:
*/
export class GameRoleController extends Component {
/** 玩家 1 角色 */
oneRole: GamerRoleNode;
/** 玩家 2 角色 */
twoRole: GamerRoleNode;
/** 玩家 3 角色 */
threeRole: GamerRoleNode;
/**
* @description:
* @param oneRoleType : 玩家 1
* @param twoRoleType : 玩家 2
* @param threeRoleType : 玩家 3
*/
initRole(
oneRoleType: GamerRoleType,
twoRoleType: GamerRoleType,
threeRoleType: GamerRoleType
) {
this.oneRole = new GamerRoleNode(oneRoleType);
this.twoRole = new GamerRoleNode(twoRoleType);
this.threeRole = new GamerRoleNode(threeRoleType);
this.node.addChild(this.oneRole);
this.node.addChild(this.twoRole);
this.node.addChild(this.threeRole);
}
start() {}
update(deltaTime: number) {}
}