content_rule_and_tips.ts 968 B

123456789101112131415161718192021222324252627282930313233
  1. import { _decorator, Component, Node } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('content_rule_and_tips')
  4. export class content_rule_and_tips extends Component {
  5. @property(Node) btn_tips:Node = null;
  6. @property(Node) btn_rule:Node = null;
  7. private m_tips_call_back = null;
  8. private m_rule_call_back = null;
  9. public initView(tips_call,rule_call,isShowRule){
  10. this.m_tips_call_back = tips_call;
  11. this.m_rule_call_back = rule_call;
  12. if(!isShowRule){
  13. this.btn_rule.active = false;
  14. }
  15. this.btn_tips.on(Node.EventType.TOUCH_END,()=>{
  16. if(this.m_tips_call_back!=null){
  17. this.m_tips_call_back()
  18. }
  19. })
  20. this.btn_rule.on(Node.EventType.TOUCH_END,()=>{
  21. if(this.m_rule_call_back!=null){
  22. this.m_rule_call_back()
  23. }
  24. })
  25. }
  26. public showRuleBtn(){
  27. this.btn_rule.active = true;
  28. }
  29. }