LookOn.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties: {
  4. },
  5. ctor:function(){
  6. },
  7. onLoad: function() {
  8. this.InitView();
  9. },
  10. InitView: function() {
  11. if(!this.m_TipNode) {
  12. this.m_TipNode = this.$('imgLookOn');
  13. // ShowBlink(this.m_TipNode, 1);
  14. }
  15. if(!this.m_ButtonNode) this.m_ButtonNode = this.$('ButtonNode');
  16. },
  17. OnShowView: function () {
  18. this.InitView();
  19. ShowO2I(this.node);
  20. this.node.zIndex = 10;
  21. },
  22. OnHideView: function () {
  23. this.node.zIndex = 0;
  24. HideI2O(this.node);
  25. },
  26. OnClicked_NoClick: function() {
  27. this.m_ButtonNode.active = !this.m_ButtonNode.active;
  28. },
  29. OnClicked_Sit: function() {
  30. if(this.m_Hook && this.m_Hook.OnBtLookOnSit) this.m_Hook.OnBtLookOnSit();
  31. },
  32. OnClicked_Return: function() {
  33. if(this.m_Hook && this.m_Hook.OnBtReturn) this.m_Hook.OnBtReturn();
  34. },
  35. OnClicked_Menu: function(Tag) {
  36. if(this.m_Hook && this.m_Hook.OnBtClick_BtMenu) this.m_Hook.OnBtClick_BtMenu(Tag);
  37. },
  38. });