SUIHandFollow.lua.txt 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. local SUIHandFollow = {}
  2. local function SetSelectedEffect(target, bShow)
  3. print("SUIHandFollow.SetSelectedEffect")
  4. local powerUpGlow = target.transform:Find("PowerupGlow1").gameObject
  5. local effectLight = target.transform:GetChild(2).gameObject
  6. powerUpGlow:SetActive(bShow)
  7. effectLight:SetActive(bShow)
  8. require("Base/SMusicManager.lua"):PlaySound("Audios/Gaming/lockSelectObj.mp3")
  9. end
  10. local function SetColliderEnabled(target, bEnabled)
  11. print("----> SUIHandFollow.SetColliderEnabled")
  12. target.transform:GetComponent("Collider2D").enabled = bEnabled
  13. end
  14. function SUIHandFollow.OnTriggerEnter2D(coll)
  15. print("----> SUIHandFollow.OnTriggerEnter2D coll:", coll.name)
  16. SetColliderEnabled(coll.gameObject, false)
  17. local dataRelay = require("Base/DataRelay.lua")
  18. local GAMING_SELECT_TWO = dataRelay:GetCache(dataRelay.KEY_TYPE.GAMING_SELECT_TWO)
  19. if GAMING_SELECT_TWO then
  20. return
  21. end
  22. SetSelectedEffect(coll.gameObject, true)
  23. require("UI/SUIGamingPanel.lua"):SelectShape(coll.gameObject)
  24. end
  25. return SUIHandFollow