content_rule_and_tips.ts 1004 B

1234567891011121314151617181920212223242526272829303132333435
  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. protected start(): void {
  10. this.btn_tips.on(Node.EventType.TOUCH_END,()=>{
  11. if(this.m_tips_call_back!=null){
  12. this.m_tips_call_back()
  13. }
  14. })
  15. this.btn_rule.on(Node.EventType.TOUCH_END,()=>{
  16. if(this.m_rule_call_back!=null){
  17. this.m_rule_call_back()
  18. }
  19. })
  20. }
  21. public initView(tips_call,rule_call,isShowRule){
  22. this.m_tips_call_back = tips_call;
  23. this.m_rule_call_back = rule_call;
  24. if(!isShowRule){
  25. this.btn_rule.active = false;
  26. }
  27. }
  28. public showRuleBtn(){
  29. this.btn_rule.active = true;
  30. }
  31. }