12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- import { _decorator, Component, Node } from 'cc';
- import { config } from '../../config';
- const { ccclass, property } = _decorator;
- @ccclass('effect_node')
- export class effect_node extends Component {
- @property(Node) effect_dun:Node = null
- @property(Node) effect_xi:Node = null
- @property(Node) effect_xing:Node = null
- private curShowBuffType:number = -1;
- public init(){
- this.curShowBuffType = -1
- this.hideAllEffect()
- }
- public hideAllEffect(){
- this.effect_dun.active = false
- this.effect_xi.active = false
- this.effect_xing.active = false
- }
- updateStatus(type:number){
- if(type===this.curShowBuffType){
- return
- }
- this.curShowBuffType = type
- this.hideAllEffect()
- switch (type) {
- case config.SHOW_BUFF_STATUS.DUN:
- this.effect_dun.active = true
- break;
-
- case config.SHOW_BUFF_STATUS.XI:
- this.effect_xi.active = true
- break;
- case config.SHOW_BUFF_STATUS.XING:
- this.effect_xing.active = true
- break;
- }
- }
- public cancelStatus(type:number){
- if(type===this.curShowBuffType){
- this.curShowBuffType=-1;
- }
- switch (type) {
- case config.SHOW_BUFF_STATUS.DUN:
- this.effect_dun.active = false
- break;
-
- case config.SHOW_BUFF_STATUS.XI:
- this.effect_xi.active = false
- break;
- case config.SHOW_BUFF_STATUS.XING:
- this.effect_xing.active = false
- break;
- }
- }
- }
|