Ejemplo n.º 1
0
    public static System.Type Bind(IntPtr L, string typeName = null)
    {
        System.Type type = null;
        switch (typeName)
        {
        case "clientlib.net.NetMsg": type = clientlib_net_NetMsgWrap.Register(L); break;

        case "CMD5": type = CMD5Wrap.Register(L); break;

        case "ThreeDButton": type = ThreeDButtonWrap.Register(L); break;

        case "UnityEngine.Animation": type = UnityEngine_AnimationWrap.Register(L); break;

        case "UnityEngine.Animator": type = UnityEngine_AnimatorWrap.Register(L); break;

        case "UnityEngine.Application": type = UnityEngine_ApplicationWrap.Register(L); break;

        case "UnityEngine.Behaviour": type = UnityEngine_BehaviourWrap.Register(L); break;

        case "UnityEngine.Camera": type = UnityEngine_CameraWrap.Register(L); break;

        case "UnityEngine.CanvasGroup": type = UnityEngine_CanvasGroupWrap.Register(L); break;

        case "UnityEngine.Canvas": type = UnityEngine_CanvasWrap.Register(L); break;

        case "UnityEngine.Collider": type = UnityEngine_ColliderWrap.Register(L); break;

        case "UnityEngine.Component": type = UnityEngine_ComponentWrap.Register(L); break;

        case "UnityEngine.EventSystems.BaseEventData": type = UnityEngine_EventSystems_BaseEventDataWrap.Register(L); break;

        case "UnityEngine.EventSystems.PointerEventData": type = UnityEngine_EventSystems_PointerEventDataWrap.Register(L); break;

        case "UnityEngine.EventSystems.UIBehaviour": type = UnityEngine_EventSystems_UIBehaviourWrap.Register(L); break;

        case "UnityEngine.GameObject": type = UnityEngine_GameObjectWrap.Register(L); break;

        case "UnityEngine.MonoBehaviour": type = UnityEngine_MonoBehaviourWrap.Register(L); break;

        case "UnityEngine.Object": type = UnityEngine_ObjectWrap.Register(L); break;

        case "UnityEngine.PlayerPrefs": type = UnityEngine_PlayerPrefsWrap.Register(L); break;

        case "UnityEngine.RectTransform": type = UnityEngine_RectTransformWrap.Register(L); break;

        case "UnityEngine.Screen": type = UnityEngine_ScreenWrap.Register(L); break;

        case "UnityEngine.SystemInfo": type = UnityEngine_SystemInfoWrap.Register(L); break;

        case "UnityEngine.Time": type = UnityEngine_TimeWrap.Register(L); break;

        case "UnityEngine.Transform": type = UnityEngine_TransformWrap.Register(L); break;

        case "UnityEngine.UI.Button": type = UnityEngine_UI_ButtonWrap.Register(L); break;

        case "UnityEngine.UI.Dropdown": type = UnityEngine_UI_DropdownWrap.Register(L); break;

        case "UnityEngine.UI.Dropdown.OptionData": type = UnityEngine_UI_Dropdown_OptionDataWrap.Register(L); break;

        case "UnityEngine.UI.Graphic": type = UnityEngine_UI_GraphicWrap.Register(L); break;

        case "UnityEngine.UI.Image": type = UnityEngine_UI_ImageWrap.Register(L); break;

        case "UnityEngine.UI.InputField": type = UnityEngine_UI_InputFieldWrap.Register(L); break;

        case "UnityEngine.UI.MaskableGraphic": type = UnityEngine_UI_MaskableGraphicWrap.Register(L); break;

        case "UnityEngine.UI.RawImage": type = UnityEngine_UI_RawImageWrap.Register(L); break;

        case "UnityEngine.UI.Scrollbar": type = UnityEngine_UI_ScrollbarWrap.Register(L); break;

        case "UnityEngine.UI.ScrollRect": type = UnityEngine_UI_ScrollRectWrap.Register(L); break;

        case "UnityEngine.UI.Selectable": type = UnityEngine_UI_SelectableWrap.Register(L); break;

        case "UnityEngine.UI.Slider": type = UnityEngine_UI_SliderWrap.Register(L); break;

        case "UnityEngine.UI.Text": type = UnityEngine_UI_TextWrap.Register(L); break;

        case "UnityEngine.UI.Toggle": type = UnityEngine_UI_ToggleWrap.Register(L); break;

        case "UnityEngine.WaitForSeconds": type = UnityEngine_WaitForSecondsWrap.Register(L); break;

        case "ZFrame.AudioManager": type = ZFrame_AudioManagerWrap.Register(L); break;

        case "ZFrame.NetEngine.NetworkMgr": type = ZFrame_NetEngine_NetworkMgrWrap.Register(L); break;

        case "ZFrame.NetEngine.TcpClientHandler": type = ZFrame_NetEngine_TcpClientHandlerWrap.Register(L); break;

        case "ZFrame.Tween.BaseTweener": type = ZFrame_Tween_BaseTweenerWrap.Register(L); break;

        case "ZFrame.Tween.ZTweener": type = ZFrame_Tween_ZTweenerWrap.Register(L); break;

        case "ZFrame.UGUI.FollowUITarget": type = ZFrame_UGUI_FollowUITargetWrap.Register(L); break;

        case "ZFrame.UGUI.UIButton": type = ZFrame_UGUI_UIButtonWrap.Register(L); break;

        case "ZFrame.UGUI.UICloseButton": type = ZFrame_UGUI_UICloseButtonWrap.Register(L); break;

        case "ZFrame.UGUI.UIDragged": type = ZFrame_UGUI_UIDraggedWrap.Register(L); break;

        case "ZFrame.UGUI.UIDropdown": type = ZFrame_UGUI_UIDropdownWrap.Register(L); break;

        case "ZFrame.UGUI.UIEventTrigger": type = ZFrame_UGUI_UIEventTriggerWrap.Register(L); break;

        case "ZFrame.UGUI.UIInput": type = ZFrame_UGUI_UIInputWrap.Register(L); break;

        case "ZFrame.UGUI.UILabel": type = ZFrame_UGUI_UILabelWrap.Register(L); break;

        case "ZFrame.UGUI.UILongpress": type = ZFrame_UGUI_UILongpressWrap.Register(L); break;

        case "ZFrame.UGUI.UIProgressBar": type = ZFrame_UGUI_UIProgressBarWrap.Register(L); break;

        case "ZFrame.UGUI.UIScrollView": type = ZFrame_UGUI_UIScrollViewWrap.Register(L); break;

        case "ZFrame.UGUI.UISelectable": type = ZFrame_UGUI_UISelectableWrap.Register(L); break;

        case "ZFrame.UGUI.UISlider": type = ZFrame_UGUI_UISliderWrap.Register(L); break;

        case "ZFrame.UGUI.UISprite": type = ZFrame_UGUI_UISpriteWrap.Register(L); break;

        case "ZFrame.UGUI.UITexture": type = ZFrame_UGUI_UITextureWrap.Register(L); break;

        case "ZFrame.UGUI.UIToggle": type = ZFrame_UGUI_UIToggleWrap.Register(L); break;

        default: break;
        }
        wrapList.Add(typeName);
        return(type);
    }
Ejemplo n.º 2
0
    public static void Bind(LuaState L)
    {
        float t = Time.realtimeSinceStartup;

        L.BeginModule(null);
        LuaInterface_DebuggerWrap.Register(L);
        MonoManagerWrap.Register(L);
        LuaProfilerWrap.Register(L);
        L.BeginModule("UnityEngine");
        UnityEngine_ComponentWrap.Register(L);
        UnityEngine_TransformWrap.Register(L);
        UnityEngine_MaterialWrap.Register(L);
        UnityEngine_LightWrap.Register(L);
        UnityEngine_CameraWrap.Register(L);
        UnityEngine_AudioSourceWrap.Register(L);
        UnityEngine_YieldInstructionWrap.Register(L);
        UnityEngine_WaitForEndOfFrameWrap.Register(L);
        UnityEngine_WaitForFixedUpdateWrap.Register(L);
        UnityEngine_WaitForSecondsWrap.Register(L);
        UnityEngine_ObjectWrap.Register(L);
        UnityEngine_BehaviourWrap.Register(L);
        UnityEngine_MonoBehaviourWrap.Register(L);
        UnityEngine_GameObjectWrap.Register(L);
        UnityEngine_TrackedReferenceWrap.Register(L);
        UnityEngine_ApplicationWrap.Register(L);
        UnityEngine_PhysicsWrap.Register(L);
        UnityEngine_ColliderWrap.Register(L);
        UnityEngine_TimeWrap.Register(L);
        UnityEngine_TextureWrap.Register(L);
        UnityEngine_Texture2DWrap.Register(L);
        UnityEngine_ShaderWrap.Register(L);
        UnityEngine_RendererWrap.Register(L);
        UnityEngine_WWWWrap.Register(L);
        UnityEngine_ScreenWrap.Register(L);
        UnityEngine_CameraClearFlagsWrap.Register(L);
        UnityEngine_AudioClipWrap.Register(L);
        UnityEngine_AssetBundleWrap.Register(L);
        UnityEngine_ParticleSystemWrap.Register(L);
        UnityEngine_AsyncOperationWrap.Register(L);
        UnityEngine_LightTypeWrap.Register(L);
        UnityEngine_SleepTimeoutWrap.Register(L);
        UnityEngine_RandomWrap.Register(L);
        UnityEngine_AnimatorWrap.Register(L);
        UnityEngine_InputWrap.Register(L);
        UnityEngine_KeyCodeWrap.Register(L);
        UnityEngine_SkinnedMeshRendererWrap.Register(L);
        UnityEngine_SpaceWrap.Register(L);
        UnityEngine_AnimationBlendModeWrap.Register(L);
        UnityEngine_QueueModeWrap.Register(L);
        UnityEngine_PlayModeWrap.Register(L);
        UnityEngine_WrapModeWrap.Register(L);
        UnityEngine_QualitySettingsWrap.Register(L);
        UnityEngine_RenderSettingsWrap.Register(L);
        UnityEngine_ResourcesWrap.Register(L);
        UnityEngine_TextAssetWrap.Register(L);
        UnityEngine_DebugWrap.Register(L);
        UnityEngine_SpriteRendererWrap.Register(L);
        UnityEngine_AudioListenerWrap.Register(L);
        UnityEngine_SystemInfoWrap.Register(L);
        UnityEngine_RectTransformWrap.Register(L);
        UnityEngine_CanvasWrap.Register(L);
        UnityEngine_CanvasGroupWrap.Register(L);
        UnityEngine_AudioBehaviourWrap.Register(L);
        L.BeginModule("SceneManagement");
        UnityEngine_SceneManagement_SceneManagerWrap.Register(L);
        L.EndModule();
        L.BeginModule("UI");
        UnityEngine_UI_GraphicRaycasterWrap.Register(L);
        UnityEngine_UI_ButtonWrap.Register(L);
        UnityEngine_UI_ImageWrap.Register(L);
        UnityEngine_UI_RawImageWrap.Register(L);
        UnityEngine_UI_SliderWrap.Register(L);
        UnityEngine_UI_InputFieldWrap.Register(L);
        UnityEngine_UI_ScrollbarWrap.Register(L);
        UnityEngine_UI_ToggleWrap.Register(L);
        UnityEngine_UI_ToggleGroupWrap.Register(L);
        UnityEngine_UI_MaskWrap.Register(L);
        UnityEngine_UI_TextWrap.Register(L);
        UnityEngine_UI_CanvasScalerWrap.Register(L);
        UnityEngine_UI_DropdownWrap.Register(L);
        UnityEngine_UI_SelectableWrap.Register(L);
        UnityEngine_UI_MaskableGraphicWrap.Register(L);
        UnityEngine_UI_GraphicWrap.Register(L);
        L.BeginModule("Dropdown");
        UnityEngine_UI_Dropdown_DropdownEventWrap.Register(L);
        UnityEngine_UI_Dropdown_OptionDataWrap.Register(L);
        L.EndModule();
        L.BeginModule("Toggle");
        UnityEngine_UI_Toggle_ToggleEventWrap.Register(L);
        L.EndModule();
        L.BeginModule("InputField");
        UnityEngine_UI_InputField_OnChangeEventWrap.Register(L);
        L.RegFunction("OnValidateInput", UnityEngine_UI_InputField_OnValidateInput);
        L.EndModule();
        L.EndModule();
        L.BeginModule("Events");
        UnityEngine_Events_UnityEventWrap.Register(L);
        UnityEngine_Events_UnityEventBaseWrap.Register(L);
        UnityEngine_Events_UnityEvent_intWrap.Register(L);
        UnityEngine_Events_UnityEvent_boolWrap.Register(L);
        UnityEngine_Events_UnityEvent_stringWrap.Register(L);
        L.RegFunction("UnityAction", UnityEngine_Events_UnityAction);
        L.RegFunction("UnityAction_UnityEngine_SceneManagement_Scene_UnityEngine_SceneManagement_LoadSceneMode", UnityEngine_Events_UnityAction_UnityEngine_SceneManagement_Scene_UnityEngine_SceneManagement_LoadSceneMode);
        L.RegFunction("UnityAction_UnityEngine_SceneManagement_Scene", UnityEngine_Events_UnityAction_UnityEngine_SceneManagement_Scene);
        L.RegFunction("UnityAction_UnityEngine_SceneManagement_Scene_UnityEngine_SceneManagement_Scene", UnityEngine_Events_UnityAction_UnityEngine_SceneManagement_Scene_UnityEngine_SceneManagement_Scene);
        L.RegFunction("UnityAction_int", UnityEngine_Events_UnityAction_int);
        L.RegFunction("UnityAction_bool", UnityEngine_Events_UnityAction_bool);
        L.RegFunction("UnityAction_string", UnityEngine_Events_UnityAction_string);
        L.EndModule();
        L.BeginModule("EventSystems");
        UnityEngine_EventSystems_EventSystemWrap.Register(L);
        UnityEngine_EventSystems_StandaloneInputModuleWrap.Register(L);
        UnityEngine_EventSystems_BaseRaycasterWrap.Register(L);
        UnityEngine_EventSystems_UIBehaviourWrap.Register(L);
        UnityEngine_EventSystems_PointerInputModuleWrap.Register(L);
        UnityEngine_EventSystems_BaseInputModuleWrap.Register(L);
        L.EndModule();
        L.BeginModule("Camera");
        L.RegFunction("CameraCallback", UnityEngine_Camera_CameraCallback);
        L.EndModule();
        L.BeginModule("Application");
        L.RegFunction("LowMemoryCallback", UnityEngine_Application_LowMemoryCallback);
        L.RegFunction("AdvertisingIdentifierCallback", UnityEngine_Application_AdvertisingIdentifierCallback);
        L.RegFunction("LogCallback", UnityEngine_Application_LogCallback);
        L.EndModule();
        L.BeginModule("AudioClip");
        L.RegFunction("PCMReaderCallback", UnityEngine_AudioClip_PCMReaderCallback);
        L.RegFunction("PCMSetPositionCallback", UnityEngine_AudioClip_PCMSetPositionCallback);
        L.EndModule();
        L.BeginModule("RectTransform");
        L.RegFunction("ReapplyDrivenProperties", UnityEngine_RectTransform_ReapplyDrivenProperties);
        L.EndModule();
        L.BeginModule("Canvas");
        L.RegFunction("WillRenderCanvases", UnityEngine_Canvas_WillRenderCanvases);
        L.EndModule();
        L.EndModule();
        L.BeginModule("Generic");
        Generic_ObjectExternionsWrap.Register(L);
        Generic_GameObjectExternionsWrap.Register(L);
        Generic_ComponentExternionsWrap.Register(L);
        Generic_ResourcesExternionsWrap.Register(L);
        L.EndModule();
        L.BeginModule("System");
        L.RegFunction("Action", System_Action);
        L.RegFunction("Predicate_int", System_Predicate_int);
        L.RegFunction("Action_int", System_Action_int);
        L.RegFunction("Comparison_int", System_Comparison_int);
        L.RegFunction("Func_int_int", System_Func_int_int);
        L.RegFunction("Func_bool", System_Func_bool);
        L.RegFunction("Action_UnityEngine_AsyncOperation", System_Action_UnityEngine_AsyncOperation);
        L.EndModule();
        L.EndModule();
        L.BeginPreLoad();
        L.AddPreLoad("UnityEngine.MeshRenderer", LuaOpen_UnityEngine_MeshRenderer, typeof(UnityEngine.MeshRenderer));
        L.AddPreLoad("UnityEngine.BoxCollider", LuaOpen_UnityEngine_BoxCollider, typeof(UnityEngine.BoxCollider));
        L.AddPreLoad("UnityEngine.MeshCollider", LuaOpen_UnityEngine_MeshCollider, typeof(UnityEngine.MeshCollider));
        L.AddPreLoad("UnityEngine.SphereCollider", LuaOpen_UnityEngine_SphereCollider, typeof(UnityEngine.SphereCollider));
        L.AddPreLoad("UnityEngine.CharacterController", LuaOpen_UnityEngine_CharacterController, typeof(UnityEngine.CharacterController));
        L.AddPreLoad("UnityEngine.CapsuleCollider", LuaOpen_UnityEngine_CapsuleCollider, typeof(UnityEngine.CapsuleCollider));
        L.AddPreLoad("UnityEngine.Animation", LuaOpen_UnityEngine_Animation, typeof(UnityEngine.Animation));
        L.AddPreLoad("UnityEngine.AnimationClip", LuaOpen_UnityEngine_AnimationClip, typeof(UnityEngine.AnimationClip));
        L.AddPreLoad("UnityEngine.AnimationState", LuaOpen_UnityEngine_AnimationState, typeof(UnityEngine.AnimationState));
        L.AddPreLoad("UnityEngine.BlendWeights", LuaOpen_UnityEngine_BlendWeights, typeof(UnityEngine.BlendWeights));
        L.AddPreLoad("UnityEngine.RenderTexture", LuaOpen_UnityEngine_RenderTexture, typeof(UnityEngine.RenderTexture));
        L.AddPreLoad("UnityEngine.Rigidbody", LuaOpen_UnityEngine_Rigidbody, typeof(UnityEngine.Rigidbody));
        L.EndPreLoad();
        Debugger.Log("Register lua type cost time: {0}", Time.realtimeSinceStartup - t);
    }
Ejemplo n.º 3
0
    public static void Bind(LuaState L)
    {
        float t = Time.realtimeSinceStartup;

        L.BeginModule(null);
        LuaInterface_DebuggerWrap.Register(L);
        LuaProfilerWrap.Register(L);
        TestUtilsWrap.Register(L);
        L.BeginModule("UnityEngine");
        UnityEngine_ComponentWrap.Register(L);
        UnityEngine_TransformWrap.Register(L);
        UnityEngine_MaterialWrap.Register(L);
        UnityEngine_LightWrap.Register(L);
        UnityEngine_CameraWrap.Register(L);
        UnityEngine_AudioSourceWrap.Register(L);
        UnityEngine_YieldInstructionWrap.Register(L);
        UnityEngine_WaitForEndOfFrameWrap.Register(L);
        UnityEngine_WaitForFixedUpdateWrap.Register(L);
        UnityEngine_WaitForSecondsWrap.Register(L);
        UnityEngine_BehaviourWrap.Register(L);
        UnityEngine_MonoBehaviourWrap.Register(L);
        UnityEngine_GameObjectWrap.Register(L);
        UnityEngine_TrackedReferenceWrap.Register(L);
        UnityEngine_ApplicationWrap.Register(L);
        UnityEngine_PhysicsWrap.Register(L);
        UnityEngine_ColliderWrap.Register(L);
        UnityEngine_TimeWrap.Register(L);
        UnityEngine_TextureWrap.Register(L);
        UnityEngine_Texture2DWrap.Register(L);
        UnityEngine_ShaderWrap.Register(L);
        UnityEngine_RendererWrap.Register(L);
        UnityEngine_WWWWrap.Register(L);
        UnityEngine_ScreenWrap.Register(L);
        UnityEngine_CameraClearFlagsWrap.Register(L);
        UnityEngine_AudioClipWrap.Register(L);
        UnityEngine_AssetBundleWrap.Register(L);
        UnityEngine_ParticleSystemWrap.Register(L);
        UnityEngine_AsyncOperationWrap.Register(L);
        UnityEngine_LightTypeWrap.Register(L);
        UnityEngine_SleepTimeoutWrap.Register(L);
        UnityEngine_AnimatorWrap.Register(L);
        UnityEngine_InputWrap.Register(L);
        UnityEngine_KeyCodeWrap.Register(L);
        UnityEngine_SkinnedMeshRendererWrap.Register(L);
        UnityEngine_SpaceWrap.Register(L);
        UnityEngine_AnimationBlendModeWrap.Register(L);
        UnityEngine_QueueModeWrap.Register(L);
        UnityEngine_PlayModeWrap.Register(L);
        UnityEngine_WrapModeWrap.Register(L);
        UnityEngine_QualitySettingsWrap.Register(L);
        UnityEngine_RenderSettingsWrap.Register(L);
        UnityEngine_ResourcesWrap.Register(L);
        UnityEngine_AudioBehaviourWrap.Register(L);
        L.BeginModule("Events");
        L.RegFunction("UnityAction", UnityEngine_Events_UnityAction);
        L.EndModule();
        L.BeginModule("Camera");
        L.RegFunction("CameraCallback", UnityEngine_Camera_CameraCallback);
        L.EndModule();
        L.BeginModule("Application");
        L.RegFunction("LowMemoryCallback", UnityEngine_Application_LowMemoryCallback);
        L.RegFunction("AdvertisingIdentifierCallback", UnityEngine_Application_AdvertisingIdentifierCallback);
        L.RegFunction("LogCallback", UnityEngine_Application_LogCallback);
        L.EndModule();
        L.BeginModule("AudioClip");
        L.RegFunction("PCMReaderCallback", UnityEngine_AudioClip_PCMReaderCallback);
        L.RegFunction("PCMSetPositionCallback", UnityEngine_AudioClip_PCMSetPositionCallback);
        L.EndModule();
        L.EndModule();
        L.BeginModule("CSharpLua");
        CSharpLua_BridgeMonoBehaviourWrap.Register(L);
        L.EndModule();
        L.BeginModule("System");
        L.RegFunction("Action", System_Action);
        L.RegFunction("Predicate_int", System_Predicate_int);
        L.RegFunction("Action_int", System_Action_int);
        L.RegFunction("Comparison_int", System_Comparison_int);
        L.RegFunction("Func_int_int", System_Func_int_int);
        L.RegFunction("Func_bool", System_Func_bool);
        L.RegFunction("Action_UnityEngine_AsyncOperation", System_Action_UnityEngine_AsyncOperation);
        L.EndModule();
        L.EndModule();
        L.BeginPreLoad();
        L.AddPreLoad("UnityEngine.MeshRenderer", LuaOpen_UnityEngine_MeshRenderer, typeof(UnityEngine.MeshRenderer));
        L.AddPreLoad("UnityEngine.BoxCollider", LuaOpen_UnityEngine_BoxCollider, typeof(UnityEngine.BoxCollider));
        L.AddPreLoad("UnityEngine.MeshCollider", LuaOpen_UnityEngine_MeshCollider, typeof(UnityEngine.MeshCollider));
        L.AddPreLoad("UnityEngine.SphereCollider", LuaOpen_UnityEngine_SphereCollider, typeof(UnityEngine.SphereCollider));
        L.AddPreLoad("UnityEngine.CharacterController", LuaOpen_UnityEngine_CharacterController, typeof(UnityEngine.CharacterController));
        L.AddPreLoad("UnityEngine.CapsuleCollider", LuaOpen_UnityEngine_CapsuleCollider, typeof(UnityEngine.CapsuleCollider));
        L.AddPreLoad("UnityEngine.Animation", LuaOpen_UnityEngine_Animation, typeof(UnityEngine.Animation));
        L.AddPreLoad("UnityEngine.AnimationClip", LuaOpen_UnityEngine_AnimationClip, typeof(UnityEngine.AnimationClip));
        L.AddPreLoad("UnityEngine.AnimationState", LuaOpen_UnityEngine_AnimationState, typeof(UnityEngine.AnimationState));
        L.AddPreLoad("UnityEngine.BlendWeights", LuaOpen_UnityEngine_BlendWeights, typeof(UnityEngine.BlendWeights));
        L.AddPreLoad("UnityEngine.RenderTexture", LuaOpen_UnityEngine_RenderTexture, typeof(UnityEngine.RenderTexture));
        L.AddPreLoad("UnityEngine.Rigidbody", LuaOpen_UnityEngine_Rigidbody, typeof(UnityEngine.Rigidbody));
        L.EndPreLoad();
        Debugger.Log("Register lua type cost time: {0}", Time.realtimeSinceStartup - t);
    }