AnimControlSkin.cs 862 B

123456789101112131415161718192021222324252627282930
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using LuaInterface;
  4. using UnityEngine;
  5. // [RequireComponent(typeof(Animator))]
  6. public class AnimControlSkin : MonoBehaviour {
  7. private LuaTable m_LuaTable;
  8. private LuaFunction m_LuaFunction;
  9. private void OnDestroy () {
  10. m_LuaTable = null;
  11. m_LuaFunction = null;
  12. }
  13. public void SetBindLuaCallback (LuaTable luaTable, LuaFunction luaFunction) {
  14. m_LuaTable = luaTable;
  15. m_LuaFunction = luaFunction;
  16. }
  17. public void ChangeSkins (int[] skinSlotTypes, int[] roleAvatarIds) {
  18. if (m_LuaFunction != null) {
  19. if (m_LuaTable != null) {
  20. m_LuaFunction.Call (m_LuaTable, skinSlotTypes, roleAvatarIds);
  21. } else {
  22. m_LuaFunction.Call (skinSlotTypes, roleAvatarIds);
  23. }
  24. }
  25. }
  26. }