//空类
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using XLua;
[Hotfix]
public class HotFixEmpty : MonoBehaviour
{
// Start is called before the first frame update
[LuaCallCSharp]
void Start()
{

}

// Update is called once per frame
[LuaCallCSharp]
void Update()
{
    
}
[LuaCallCSharp]
private void OnTriggerEnter(Collider other)
{
    
}
[LuaCallCSharp]
private void BehaviourMethod()
{

}

}

xxx.lua.txt
--*************************************************************
--9.0新的类

xlua.private_accessible(CS.HotFixEmpty)
xlua.hotfix(CS.HotFixEmpty,'Start',function(self)
self:Invoke("BehaviourMethod",8)
end)

xlua.hotfix(CS.HotFixEmpty,'Update',function(self)
self.transform:Translate(-self.transform.right4UnityEngine.Time.deltaTime,UnityEngine.Space.World)
end)

xlua.hotfix(CS.HotFixEmpty,'OnTriggerEnter',function(self,other)
if other.tag~="Untagged" and other.tag~="Wall" then
UnityEngine.Object.Destroy(other.gameObject)
end
end)

xlua.hotfix(CS.HotFixEmpty,'BehaviourMethod',function(self)
CS.Gun.Instance.level = CS.Gun.Instance.level+1
if CS.Gun.Instance.level==4 then
CS.Gun.Instance.level=1
end
canCreateNewFish = true
CS.Gun.Instance.changeAudio = true
UnityEngine.Object.Destroy(self.gameObject)
end)