资源简介

协议的处理在lua,所有数据都是通过C#的socket转发到lua,lua最后解密,
需要环境:
Unity环境: 2018.1.0b11(64bit)
protobuf环境:protobuf3.3
你需要点击:Assets\LuaFramework\LuaProject\Scene\Start才能运行
注意这只是客户端,如果你需要服务端请下载:Netty Protobuf3 测试服务器

资源截图

代码片段和文件信息

using UnityEngine;
using System;
using System.Collections.Generic;
using LuaInterface;
using Luaframework;
using UnityEditor;

using BindType = ToLuaMenu.BindType;
using UnityEngine.UI;
using System.Reflection;

public static class CustomSettings
{
    public static string frameworkPath = AppConst.frameworkRoot;
    public static string saveDir = frameworkPath + “/ToLua/Source/Generate/“;
    //项目打成LuaBundle项目得路径
    public static string luaDir = frameworkPath + “/LuaProject/Lua“; //“/Lua/“;
    public static string toluabaseType = frameworkPath + “/ToLua/baseType/“;
public static string baseLuaDir = frameworkPath + “/ToLua/Lua“;
public static string injectionFilesPath = Application.dataPath + “/ToLua/Injection/“;

    //导出时强制做为静态类的类型(注意customTypeList 还要添加这个类型才能导出)
    //unity 有些类作为sealed class 其实完全等价于静态类
    public static List staticClassTypes = new List
    {        
        typeof(UnityEngine.Application)
        typeof(UnityEngine.Time)
        typeof(UnityEngine.Screen)
        typeof(UnityEngine.SleepTimeout)
        typeof(UnityEngine.Input)
        typeof(UnityEngine.Resources)
        typeof(UnityEngine.Physics)
        typeof(UnityEngine.RenderSettings)
        typeof(UnityEngine.QualitySettings)
        typeof(UnityEngine.GL)
        typeof(UnityEngine.Graphics)
    };

    //附加导出委托类型(在导出委托时 customTypeList 中牵扯的委托类型都会导出, 无需写在这里)
    public static DelegateType[] customDelegateList = 
    {        
        _DT(typeof(Action))                
        _DT(typeof(UnityEngine.Events.UnityAction))
        _DT(typeof(System.Predicate))
        _DT(typeof(System.Action))
        _DT(typeof(System.Comparison))
        _DT(typeof(System.Func))
    };

    //在这里添加你要导出注册到lua的类型列表
    public static BindType[] customTypeList =
    {                
        //------------------------为例子导出--------------------------------
        //_GT(typeof(TestEventListener))
        //_GT(typeof(TestProtol))
        //_GT(typeof(TestAccount))
        //_GT(typeof(Dictionary)).SetLibName(“AccountMap“)
        //_GT(typeof(KeyValuePair))
        //_GT(typeof(Dictionary.KeyCollection))
        //_GT(typeof(Dictionary.ValueCollection))
        //_GT(typeof(TestExport))
        //_GT(typeof(TestExport.Space))
        //-------------------------------------------------------------------        
                        
        _GT(typeof(LuaInjectionStation))
        _GT(typeof(InjectType))
        _GT(typeof(Debugger)).SetNameSpace(null)          

#if USING_DOTWEENING
        _GT(typeof(DG.Tweening.DOTween))
        _GT(typeof(DG.Tweening.Tween)).SetbaseType(typeof(System.object)).AddExtendType(typeof(DG.Tweening.TweenExtensions))
        _GT(typeof(DG.Tweening.Sequence)).AddExtendType(typeof(DG.Tweening.TweenSettingsExtensions))
        _GT(typeof(DG.Tweening.Tweener)).AddExtendType(typeof(DG.Tweening.TweenSettingsExtensions))

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-04-10 16:14  ToLuaProtobuffer3Code\
     目录           0  2020-04-10 15:30  ToLuaProtobuffer3Code\.vs\
     目录           0  2020-04-10 15:30  ToLuaProtobuffer3Code\.vs\Luaframework_UGUI_V2-master\
     目录           0  2020-04-10 15:30  ToLuaProtobuffer3Code\.vs\Luaframework_UGUI_V2-master\v14\
     文件      386048  2020-04-10 15:25  ToLuaProtobuffer3Code\.vs\Luaframework_UGUI_V2-master\v14\.suo
     文件       28132  2020-04-10 16:12  ToLuaProtobuffer3Code\Assembly-CSharp-Editor.csproj
     文件       46518  2020-04-10 16:12  ToLuaProtobuffer3Code\Assembly-CSharp.csproj
     目录           0  2020-04-10 15:30  ToLuaProtobuffer3Code\Assets\
     目录           0  2020-04-10 15:30  ToLuaProtobuffer3Code\Assets\Luaframework\
     目录           0  2020-04-10 15:30  ToLuaProtobuffer3Code\Assets\Luaframework\Editor\
     文件       10511  2020-04-10 11:13  ToLuaProtobuffer3Code\Assets\Luaframework\Editor\CustomSettings.cs
     文件         262  2019-08-07 16:15  ToLuaProtobuffer3Code\Assets\Luaframework\Editor\CustomSettings.cs.meta
     文件       12591  2019-08-07 16:15  ToLuaProtobuffer3Code\Assets\Luaframework\Editor\Packager.cs
     文件         178  2019-08-07 16:15  ToLuaProtobuffer3Code\Assets\Luaframework\Editor\Packager.cs.meta
     文件         191  2019-08-07 16:15  ToLuaProtobuffer3Code\Assets\Luaframework\Editor.meta
     目录           0  2020-04-10 15:30  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\
     目录           0  2020-04-10 15:30  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\Builds\
     目录           0  2020-04-10 15:30  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\Builds\Message\
     文件        9867  2019-08-07 16:15  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\Builds\Message\MessagePanel.prefab
     文件         179  2019-08-07 16:15  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\Builds\Message\MessagePanel.prefab.meta
     文件         107  2019-08-07 16:15  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\Builds\Message.meta
     目录           0  2020-04-10 15:30  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\Builds\Prompt\
     文件        5126  2019-08-07 16:15  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\Builds\Prompt\PromptItem.prefab
     文件         138  2019-08-07 16:15  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\Builds\Prompt\PromptItem.prefab.meta
     文件       17987  2019-08-07 16:15  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\Builds\Prompt\PromptPanel.prefab
     文件         179  2019-08-07 16:15  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\Builds\Prompt\PromptPanel.prefab.meta
     文件         107  2019-08-07 16:15  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\Builds\Prompt.meta
     文件         107  2019-08-07 16:15  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\Builds.meta
     目录           0  2020-04-10 15:30  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\Editor\
     文件        7783  2019-08-07 16:15  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\Editor\WelcomeScreen.cs
     文件         262  2019-08-07 16:15  ToLuaProtobuffer3Code\Assets\Luaframework\Examples\Editor\WelcomeScreen.cs.meta
............此处省略1459个文件信息

评论

共有 条评论

相关资源