简单的c#脚本

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
public class LoadAB
{
    [MenuItem("Assets/LoadAB")]
    static void Load()
    {
        string dir = "Assets/StreamingAssets";
        if (Directory.Exists(dir) == false)
        {
            Directory.CreateDirectory(dir);
        }
        BuildPipeline.BuildAssetBundles(dir, BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows64);
    }
}




using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Utils
{
    ///
    /// 添加lua点击事件
    ///

    ///
    ///
    public static void AddClick(GameObject go, System.Object luaFunc)
    {
        UIEventListener.Get(go).onClick += delegate(GameObject obj)
        {
            LuaInterface.LuaFunction func = (LuaInterface.LuaFunction)luaFunc;
            func.Call(obj);
           
        };
       
    }
}

你可能感兴趣的:(lua)