예제 #1
0
 public override void OnPreExporting(BindingManager bindingManager)
 {
     bindingManager.AddExportedType(typeof(WaitForSeconds), true);
     bindingManager.AddExportedType(typeof(WaitForEndOfFrame), true);
     bindingManager.AddExportedType(typeof(Time));
     // bindingManager.AddExportedType(typeof(System.Net.Dns));
     bindingManager.AddExportedType(typeof(System.Net.IPHostEntry));
 }
예제 #2
0
 public override void OnPreCollectTypes(BindingManager bindingManager)
 {
     // 添加导出
     bindingManager.AddExportedType(typeof(List <String>));
     // bindingManager.AddExportedType(typeof(Dictionary<String, String>))
     //     .SetMethodBlocked("Remove", typeof(string), typeof(string));
     //     ...
 }
예제 #3
0
        public override void OnPreExporting(BindingManager bindingManager)
        {
            bindingManager.AddExportedType(typeof(WaitForSeconds), true);
            bindingManager.AddExportedType(typeof(WaitForEndOfFrame), true);
            // AddExportedType(typeof(System.Collections.IEnumerator), true);
            bindingManager.AddExportedType(typeof(Time));
            // bindingManager.AddExportedType(typeof(System.Net.Dns));
            bindingManager.AddExportedType(typeof(System.Net.IPHostEntry));

            bindingManager.AddExportedType(typeof(System.Enum));

#if UNITY_EDITOR
            // [test] editor only
            bindingManager.AddExportedType(typeof(UnityEditor.EditorApplication), false, true);
            bindingManager.AddExportedType(typeof(UnityEditor.EditorWindow), false, true);
#endif
        }
예제 #4
0
        public override void OnPreExporting(BindingManager bindingManager)
        {
            // 添加导出
            bindingManager.AddExportedType(typeof(List <String>));

            bindingManager.AddExportedType(typeof(UnityEngine.Vector2));
            bindingManager.AddExportedType(typeof(UnityEngine.Vector3));
            bindingManager.AddExportedType(typeof(UnityEngine.Quaternion));
            bindingManager.AddExportedType(typeof(UnityEngine.GameObject), true);
            bindingManager.AddExportedType(typeof(UnityEngine.Mathf));
            bindingManager.AddExportedType(typeof(UnityEngine.PrimitiveType));
            bindingManager.AddExportedType(typeof(UnityEngine.Color));
            bindingManager.AddExportedType(typeof(UnityEngine.MonoBehaviour), true)
            .SetMemberBlocked("runInEditMode");
            bindingManager.AddExportedType(typeof(UnityEngine.Transform), true);
            bindingManager.AddExportedType(typeof(UnityEngine.UI.Text), true)
            .SetMemberBlocked("OnRebuildRequested");
            bindingManager.AddExportedType(typeof(UnityEngine.UI.Graphic))
            .SetMemberBlocked("OnRebuildRequested");
            bindingManager.AddExportedType(typeof(UnityEngine.UI.Button), true);
            bindingManager.AddExportedType(typeof(UnityEngine.UI.Button.ButtonClickedEvent), true);
            bindingManager.AddExportedType(typeof(UnityEngine.Random));
            bindingManager.AddExportedType(typeof(UnityEngine.Camera), true);
            bindingManager.AddExportedType(typeof(UnityEngine.Time));
            bindingManager.AddExportedType(typeof(UnityEngine.KeyCode));
            bindingManager.AddExportedType(typeof(UnityEngine.Input))
            .SetMemberBlocked("IsJoystickPreconfigured");

            // bindingManager.AddExportedType(typeof(Dictionary<String, String>))
            //     .SetMethodBlocked("Remove", typeof(string), typeof(string));
            //     ...
        }
예제 #5
0
        public override void OnPreExporting(BindingManager bindingManager)
        {
            bindingManager.AddExportedType(typeof(FairyGUI.ProgressTitleType));
            bindingManager.AddExportedType(typeof(FairyGUI.PackageItemType));
            bindingManager.AddExportedType(typeof(FairyGUI.DestroyMethod));
            bindingManager.AddExportedType(typeof(FairyGUI.ObjectType));
            bindingManager.AddExportedType(typeof(FairyGUI.RelationType));
            bindingManager.AddExportedType(typeof(FairyGUI.GroupLayoutType));
            bindingManager.AddExportedType(typeof(FairyGUI.ChildrenRenderOrder));
            bindingManager.AddExportedType(typeof(FairyGUI.FlipType));
            bindingManager.AddExportedType(typeof(FairyGUI.FillMethod));
            bindingManager.AddExportedType(typeof(FairyGUI.ListLayoutType));
            bindingManager.AddExportedType(typeof(FairyGUI.CustomEase));
            bindingManager.AddExportedType(typeof(FairyGUI.GPathPoint));
            bindingManager.AddExportedType(typeof(FairyGUI.GPathPoint.CurveType));
            bindingManager.AddExportedType(typeof(FairyGUI.NTexture));
            bindingManager.AddExportedType(typeof(FairyGUI.Utils.ByteBuffer));
            bindingManager.AddExportedType(typeof(FairyGUI.OverflowType));
            bindingManager.AddExportedType(typeof(FairyGUI.FillType));
            bindingManager.AddExportedType(typeof(FairyGUI.PixelHitTestData));
            bindingManager.AddExportedType(typeof(FairyGUI.BitmapFont));
            bindingManager.AddExportedType(typeof(FairyGUI.BitmapFont.BMGlyph));
            bindingManager.AddExportedType(typeof(FairyGUI.TransitionActionType));
            bindingManager.AddExportedType(typeof(FairyGUI.AutoSizeType));
            bindingManager.AddExportedType(typeof(FairyGUI.TweenPropType));
            bindingManager.AddExportedType(typeof(FairyGUI.ScrollType));
            bindingManager.AddExportedType(typeof(FairyGUI.ScrollBarDisplayType));
            bindingManager.AddExportedType(typeof(FairyGUI.ButtonMode));
            bindingManager.AddExportedType(typeof(FairyGUI.AlignType));
            bindingManager.AddExportedType(typeof(FairyGUI.VertAlignType));
            bindingManager.AddExportedType(typeof(FairyGUI.OriginHorizontal));
            bindingManager.AddExportedType(typeof(FairyGUI.OriginVertical));
            bindingManager.AddExportedType(typeof(FairyGUI.ListSelectionMode));
            bindingManager.AddExportedType(typeof(FairyGUI.PopupDirection));
            bindingManager.AddExportedType(typeof(FairyGUI.NAudioClip));
            bindingManager.AddExportedType(typeof(FairyGUI.UIContentScaler));
            bindingManager.AddExportedType(typeof(FairyGUI.UIContentScaler.ScaleMode));
            bindingManager.AddExportedType(typeof(FairyGUI.UIContentScaler.ScreenMatchMode));
            bindingManager.AddExportedType(typeof(FairyGUI.EventContext));
            bindingManager.AddExportedType(typeof(FairyGUI.EventDispatcher));
            bindingManager.AddExportedType(typeof(FairyGUI.EventListener));
            bindingManager.AddExportedType(typeof(FairyGUI.GScrollBar));
            bindingManager.AddExportedType(typeof(FairyGUI.GPath));
            bindingManager.AddExportedType(typeof(FairyGUI.InputEvent));
            bindingManager.AddExportedType(typeof(FairyGUI.DisplayObject));
            bindingManager.AddExportedType(typeof(FairyGUI.Container))
            .AddTSMethodDeclaration("InvalidateBatchingState()");
            bindingManager.AddExportedType(typeof(FairyGUI.Stage));
            bindingManager.AddExportedType(typeof(FairyGUI.Controller));
            bindingManager.AddExportedType(typeof(FairyGUI.GObject));
            bindingManager.AddExportedType(typeof(FairyGUI.NGraphics));
            bindingManager.AddExportedType(typeof(FairyGUI.IFilter));
            bindingManager.AddExportedType(typeof(FairyGUI.IKeyboard));
            // bindingManager.AddExportedType(typeof(FairyGUI.UpdateContext));
            bindingManager.AddExportedType(typeof(FairyGUI.GGraph));
            bindingManager.AddExportedType(typeof(FairyGUI.Shape));
            bindingManager.AddExportedType(typeof(FairyGUI.GGroup));
            bindingManager.AddExportedType(typeof(FairyGUI.GImage));
            bindingManager.AddExportedType(typeof(FairyGUI.GLoader));
            bindingManager.AddExportedType(typeof(FairyGUI.GMovieClip));
            bindingManager.AddExportedType(typeof(FairyGUI.Utils.XMLList));
            bindingManager.AddExportedType(typeof(FairyGUI.Image));
            bindingManager.AddExportedType(typeof(FairyGUI.BlendMode));
            bindingManager.AddExportedType(typeof(FairyGUI.GearXY));
            bindingManager.AddExportedType(typeof(FairyGUI.GearLook));
            bindingManager.AddExportedType(typeof(FairyGUI.GearSize));
            bindingManager.AddExportedType(typeof(FairyGUI.GLoader3D));
            bindingManager.AddExportedType(typeof(FairyGUI.GTree));
            bindingManager.AddExportedType(typeof(FairyGUI.GTreeNode));
            bindingManager.AddExportedType(typeof(FairyGUI.MovieClip));
            bindingManager.AddExportedType(typeof(FairyGUI.MovieClip.Frame));
            bindingManager.AddExportedType(typeof(FairyGUI.TextFormat));
            bindingManager.AddExportedType(typeof(FairyGUI.GTextField));
            bindingManager.AddExportedType(typeof(FairyGUI.GRichTextField));
            bindingManager.AddExportedType(typeof(FairyGUI.GTextInput));
            bindingManager.AddExportedType(typeof(FairyGUI.GComponent))
            .AddTSMethodDeclaration("InvalidateBatchingState()");
            bindingManager.AddExportedType(typeof(FairyGUI.GList))
            .AddTSMethodDeclaration("RemoveChildAt(index: number): GObject");
            bindingManager.AddExportedType(typeof(FairyGUI.GRoot));
            bindingManager.AddExportedType(typeof(FairyGUI.GLabel));
            bindingManager.AddExportedType(typeof(FairyGUI.GButton));
            bindingManager.AddExportedType(typeof(FairyGUI.GComboBox));
            bindingManager.AddExportedType(typeof(FairyGUI.GProgressBar));
            bindingManager.AddExportedType(typeof(FairyGUI.GSlider));
            bindingManager.AddExportedType(typeof(FairyGUI.PopupMenu));
            bindingManager.AddExportedType(typeof(FairyGUI.ScrollPane));
            bindingManager.AddExportedType(typeof(FairyGUI.Transition));
            bindingManager.AddExportedType(typeof(FairyGUI.UIPackage));
            bindingManager.AddExportedType(typeof(FairyGUI.Window));
            bindingManager.AddExportedType(typeof(FairyGUI.GObjectPool));
            bindingManager.AddExportedType(typeof(FairyGUI.Relations));
            bindingManager.AddExportedType(typeof(FairyGUI.Timers));
            bindingManager.AddExportedType(typeof(FairyGUI.GTween));
            bindingManager.AddExportedType(typeof(FairyGUI.GTweener));
            bindingManager.AddExportedType(typeof(FairyGUI.EaseType));
            bindingManager.AddExportedType(typeof(FairyGUI.TweenValue));
            bindingManager.AddExportedType(typeof(FairyGUI.PackageItem));
            bindingManager.AddExportedType(typeof(FairyGUI.UIObjectFactory));
            bindingManager.AddExportedType(typeof(FairyGUI.MaterialManager));
            bindingManager.AddExportedType(typeof(FairyGUI.Margin));
            bindingManager.AddExportedType(typeof(FairyGUI.Utils.XML));
            bindingManager.AddExportedType(typeof(FairyGUI.TextFormat));
            bindingManager.AddExportedType(typeof(FairyGUI.TextFormat.SpecialStyle));

            bindingManager.AddExportedType(typeof(UnityEngine.AudioClip));
            bindingManager.AddExportedType(typeof(UnityEngine.AudioClipLoadType));
            bindingManager.AddExportedType(typeof(UnityEngine.AudioDataLoadState));
            bindingManager.AddExportedType(typeof(UnityEngine.AssetBundle));
            bindingManager.AddExportedType(typeof(UnityEngine.Sprite));
            bindingManager.AddExportedType(typeof(UnityEngine.Texture));
            bindingManager.AddExportedType(typeof(UnityEngine.Texture2D));
            bindingManager.AddExportedType(typeof(UnityEngine.Material));
            bindingManager.AddExportedType(typeof(UnityEngine.RenderMode));
            bindingManager.AddExportedType(typeof(UnityEngine.EventModifiers));
            bindingManager.AddExportedType(typeof(UnityEngine.KeyCode));

            bindingManager.AddExportedType(typeof(System.Collections.Generic.IList <FairyGUI.GObject>));
            bindingManager.AddExportedType(typeof(System.Collections.Generic.List <FairyGUI.PackageItem>));
            bindingManager.AddExportedType(typeof(System.Collections.Generic.List <FairyGUI.UIPackage>));
            bindingManager.AddExportedType(typeof(System.Collections.Generic.List <FairyGUI.GTreeNode>));
            bindingManager.AddExportedType(typeof(System.Collections.Generic.List <int>));
            bindingManager.AddExportedType(typeof(System.Collections.Generic.List <string>));
            bindingManager.AddExportedType(typeof(System.Collections.Generic.IEnumerable <FairyGUI.GPathPoint>));
            // bindingManager.AddExportedType(typeof(System.Collections.Generic.Dictionary<string, string>));
        }
예제 #6
0
        public override void OnPreExporting(BindingManager bindingManager)
        {
            // bindingManager.AddTypePrefixBlacklist("SyntaxTree.");

            // bindingManager.AddExportedType(typeof(System.Threading.Tasks.Task))
            //     .Rename("ATask")
            //     .SetMemberBlocked("IsCompletedSuccessfully");
            // bindingManager.AddExportedType(typeof(System.Threading.Tasks.Task<System.Net.Sockets.Socket>));
            // bindingManager.AddExportedType(typeof(System.Threading.Tasks.Task<int>));

            // bindingManager.AddExportedType(typeof(System.Net.Sockets.Socket));
            // bindingManager.AddExportedType(typeof(System.Net.Sockets.SocketFlags));
            // bindingManager.AddExportedType(typeof(System.Net.Sockets.AddressFamily));
            // bindingManager.AddExportedType(typeof(System.Net.IPAddress));
            // bindingManager.AddExportedType(typeof(System.Net.IPEndPoint));

            bindingManager.AddExportedType(typeof(WaitForSeconds), true);
            bindingManager.AddExportedType(typeof(WaitForEndOfFrame), true);
            bindingManager.AddExportedType(typeof(Time));
            bindingManager.AddExportedType(typeof(Random));
            bindingManager.AddExportedType(typeof(Input));
            bindingManager.AddExportedType(typeof(Debug));
            bindingManager.AddExportedType(typeof(Ray));
            bindingManager.AddExportedType(typeof(Rect));
            bindingManager.AddExportedType(typeof(RaycastHit));
            bindingManager.AddExportedType(typeof(Physics));
            bindingManager.AddExportedType(typeof(Collider));
            bindingManager.AddExportedType(typeof(BoxCollider));
            bindingManager.AddExportedType(typeof(SphereCollider));
            bindingManager.AddExportedType(typeof(Rigidbody));
            bindingManager.AddExportedType(typeof(ParticleSystem));
            bindingManager.AddExportedType(typeof(ParticleSystemRenderer));
            bindingManager.AddExportedType(typeof(ParticleSystem.MainModule));
            bindingManager.AddExportedType(typeof(ParticleSystemSimulationSpace));
            bindingManager.AddExportedType(typeof(System.Net.IPHostEntry)).SystemRuntime();

            bindingManager.AddExportedType(typeof(System.DateTime)).SystemRuntime().EnableOperatorOverloading(false);
            bindingManager.AddExportedType(typeof(System.Enum)).SystemRuntime();
            bindingManager.AddExportedType(typeof(System.IO.FileInfo)).SystemRuntime()
            .SetMemberBlocked("GetAccessControl")
            .SetMemberBlocked("SetAccessControl");
            bindingManager.AddExportedType(typeof(System.IO.File)).SystemRuntime()
            .SetMemberBlocked("GetAccessControl")
            .SetMemberBlocked("SetAccessControl")
            .OnFilter <MethodInfo>(info => info.GetParameters().Length == 4);    // not available in .net standard 2.0

            bindingManager.AddExportedType(typeof(TWrapper <int>));
            bindingManager.AddExportedType(typeof(TWrapper <Vector3>));
            bindingManager.AddExportedType(typeof(DisposableObject)).SetDisposable();

            #if CUSTOM_DEF_FOO
            bindingManager.AddExportedType(typeof(FOO)).AddRequiredDefines("CUSTOM_DEF_FOO", "UNITY_EDITOR");
            #endif
            #if CUSTOM_DEF_BAR
            bindingManager.AddExportedType(typeof(BAR)).AddRequiredDefines("CUSTOM_DEF_BAR");
            #endif
        }
예제 #7
0
        public override void OnPreExporting(BindingManager bindingManager)
        {
            bindingManager.AddExportedType(typeof(GUI)).SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(GUIUtility)).SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(GUILayout)).SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(GUILayoutUtility)).SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(GUILayoutOption));
            bindingManager.AddExportedType(typeof(GUIContent));
            bindingManager.AddExportedType(typeof(GUISkin));
            bindingManager.AddExportedType(typeof(GUIStyle));
            bindingManager.AddExportedType(typeof(TextAnchor));
            bindingManager.AddExportedType(typeof(ScaleMode));
            bindingManager.AddExportedType(typeof(FocusType));
            bindingManager.AddExportedType(typeof(AudioClip));
            bindingManager.AddExportedType(typeof(RectInt));
            bindingManager.AddExportedType(typeof(Bounds));
            bindingManager.AddExportedType(typeof(BoundsInt));
            bindingManager.AddExportedType(typeof(Gradient));
            bindingManager.AddExportedType(typeof(AnimationCurve));
            bindingManager.AddExportedType(typeof(Event));
            bindingManager.AddExportedType(typeof(EventType)).OnFilter <string>(i => char.IsLower(i[0]));
            bindingManager.AddExportedType(typeof(Coroutine));
            bindingManager.AddExportedType(typeof(System.Collections.IEnumerator));
            bindingManager.AddExportedType(typeof(System.Collections.Generic.IEnumerable <string>));

            bindingManager.AddExportedType(typeof(SearchField)).EditorRuntime();
            bindingManager.AddExportedType(typeof(EditorStyles)).EditorRuntime();
            bindingManager.AddExportedType(typeof(GenericMenu)).EditorRuntime();
            bindingManager.AddExportedType(typeof(PrefabAssetType)).EditorRuntime();
            bindingManager.AddExportedType(typeof(PrefabInstanceStatus)).EditorRuntime();
            bindingManager.AddExportedType(typeof(UIOrientation)).EditorRuntime();
            bindingManager.AddExportedType(typeof(MessageType)).EditorRuntime();
            bindingManager.AddExportedType(typeof(Hash128)).EditorRuntime();
            bindingManager.AddExportedType(typeof(ImportAssetOptions)).EditorRuntime();
            bindingManager.AddExportedType(typeof(ScriptingRuntimeVersion)).EditorRuntime();
            bindingManager.AddExportedType(typeof(AssetPostprocessor)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(AssetImporter)).EditorRuntime();
            bindingManager.AddExportedType(typeof(ModelImporter)).EditorRuntime();
            bindingManager.AddExportedType(typeof(AudioImporter)).EditorRuntime();
            bindingManager.AddExportedType(typeof(VideoClipImporter)).EditorRuntime();
            bindingManager.AddExportedType(typeof(TextureImporter)).EditorRuntime();
            bindingManager.AddExportedType(typeof(MouseCursor)).EditorRuntime();
            bindingManager.AddExportedType(typeof(PauseState)).EditorRuntime();
            bindingManager.AddExportedType(typeof(PlayModeStateChange)).EditorRuntime();
            bindingManager.AddExportedType(typeof(ExportPackageOptions)).EditorRuntime();
            bindingManager.AddExportedType(typeof(ForceReserializeAssetsOptions)).EditorRuntime();
            bindingManager.AddExportedType(typeof(StatusQueryOptions)).EditorRuntime();
            bindingManager.AddExportedType(typeof(SerializedObject)).EditorRuntime();
            bindingManager.AddExportedType(typeof(SerializedProperty)).EditorRuntime();
            bindingManager.AddExportedType(typeof(SerializedPropertyType)).EditorRuntime();
            bindingManager.AddExportedType(typeof(BuildPlayerOptions)).EditorRuntime();
            bindingManager.AddExportedType(typeof(BuildAssetBundleOptions)).EditorRuntime();
            bindingManager.AddExportedType(typeof(BuildTarget)).EditorRuntime();
            bindingManager.AddExportedType(typeof(ObjectFactory)).EditorRuntime();
            bindingManager.AddExportedType(typeof(CameraEditor)).EditorRuntime();
            bindingManager.AddExportedType(typeof(CameraEditorUtils)).EditorRuntime();
            bindingManager.AddExportedType(typeof(TransformUtils)).EditorRuntime();
            bindingManager.AddExportedType(typeof(EditorJsonUtility)).EditorRuntime();
            bindingManager.AddExportedType(typeof(GameObjectUtility)).EditorRuntime();
            bindingManager.AddExportedType(typeof(EditorPrefs)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(Handles)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(HandleUtility)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(SceneView)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(MeshUtility)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(PrefabUtility)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(FileUtil)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(UnityEditor.Build.Reporting.BuildReport)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(AssetBundleManifest)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(BuildPipeline)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(AssetDatabase)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(ShaderUtil)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(EditorUtility)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(EditorGUI)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(EditorGUIUtility)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(EditorGUILayout)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(EditorApplication)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(Editor)).EditorRuntime()
            .WriteCrossBindingConstructor();
            bindingManager.AddExportedType(typeof(EditorWindow)).EditorRuntime()
            .SetMemberBlocked("GetWindowWithRect")
            //TODO: 此方法需要接管, 待处理, 暂时屏蔽
            .SetMethodBlocked("GetWindow", typeof(Type), typeof(bool), typeof(string), typeof(bool))
            //TODO: 此方法需要接管, 待处理, 暂时屏蔽
            .SetMethodBlocked("GetWindow", typeof(Type), typeof(bool), typeof(string))
            //TODO: 此方法需要接管, 待处理, 暂时屏蔽
            .SetMethodBlocked("GetWindow", typeof(Type), typeof(bool))
            .AddTSMethodDeclaration("static GetWindow<T extends EditorWindow>(type: { new(): T }): T", "GetWindow", typeof(Type))
            .WriteCrossBindingConstructor()
            .WriteCSMethodOverrideBinding("GetWindow", EditorWindowFix.BindStatic_GetWindow)
            .AddStaticMethod(EditorWindowFix.CreateWindow)
            ;
        }
예제 #8
0
        public override void OnPreExporting(BindingManager bindingManager)
        {
            bindingManager.AddExportedType(typeof(LayerMask));
            bindingManager.AddExportedType(typeof(Color));
            bindingManager.AddExportedType(typeof(Color32));
            bindingManager.AddExportedType(typeof(Vector2));
            bindingManager.AddExportedType(typeof(Vector2Int));
            bindingManager.AddExportedType(typeof(Vector3));
            bindingManager.AddExportedType(typeof(Vector3Int));
            bindingManager.AddExportedType(typeof(Vector4));
            bindingManager.AddExportedType(typeof(Quaternion));
            bindingManager.AddExportedType(typeof(Matrix4x4));
            bindingManager.AddExportedType(typeof(PrimitiveType));
            bindingManager.AddExportedType(typeof(UnityEngine.Object))
            .EnableOperatorOverloading(false)
            ;
            bindingManager.AddExportedType(typeof(GameObject), true);
            bindingManager.AddExportedType(typeof(Camera), true);
            bindingManager.AddExportedType(typeof(Transform), true);
            bindingManager.AddExportedType(typeof(MonoBehaviour), true);

            bindingManager.AddExportedType(typeof(Resources)).SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(QuickJS.Unity.JSBehaviourProperties));
        }
예제 #9
0
        public override void OnPreExporting(BindingManager bindingManager)
        {
            bindingManager.AddExportedType(typeof(WaitForSeconds), true);
            bindingManager.AddExportedType(typeof(WaitForEndOfFrame), true);
            // AddExportedType(typeof(System.Collections.IEnumerator), true);
            bindingManager.AddExportedType(typeof(Time));
            bindingManager.AddExportedType(typeof(Ray));
            bindingManager.AddExportedType(typeof(Rect));
            bindingManager.AddExportedType(typeof(RaycastHit));
            bindingManager.AddExportedType(typeof(Physics)); // 无法自动处理部分重载
            // bindingManager.AddExportedType(typeof(System.Net.Dns));
            bindingManager.AddExportedType(typeof(System.Net.IPHostEntry)).SystemRuntime();

            bindingManager.AddExportedType(typeof(System.Enum)).SystemRuntime();
            bindingManager.AddExportedType(typeof(System.IO.File)).SystemRuntime()
            .SetMemberBlocked("GetAccessControl")
            .SetMemberBlocked("SetAccessControl")
            .OnFilter <MethodInfo>(info => info.GetParameters().Length == 4);    // not available in .net standard 2.0

            bindingManager.AddExportedType(typeof(TWrapper <int>));
            bindingManager.AddExportedType(typeof(TWrapper <Vector3>));
        }
예제 #10
0
 public override void OnPreExporting(BindingManager bindingManager)
 {
     bindingManager.AddExportedType(typeof(Resources)).SetAllConstructorsBlocked();
 }
예제 #11
0
        public override void OnPreExporting(BindingManager bindingManager)
        {
            if (!bindingManager.prefs.editorScripting)
            {
                return;
            }

            bindingManager.AddExportedType(typeof(GUI)).SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(GUIUtility)).SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(GUILayout)).SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(GUILayoutOption));
            bindingManager.AddExportedType(typeof(GUIContent));
            bindingManager.AddExportedType(typeof(GUISkin));
            bindingManager.AddExportedType(typeof(GUIStyle));
            bindingManager.AddExportedType(typeof(ScaleMode));
            bindingManager.AddExportedType(typeof(FocusType));
            bindingManager.AddExportedType(typeof(RectInt));
            bindingManager.AddExportedType(typeof(Bounds));
            bindingManager.AddExportedType(typeof(BoundsInt));
            bindingManager.AddExportedType(typeof(Gradient));
            bindingManager.AddExportedType(typeof(AnimationCurve));
            bindingManager.AddExportedType(typeof(Event));
            bindingManager.AddExportedType(typeof(Coroutine));
            bindingManager.AddExportedType(typeof(System.Collections.IEnumerator));
            bindingManager.AddExportedType(typeof(System.Collections.Generic.IEnumerable <string>));

            bindingManager.AddExportedType(typeof(MessageType)).EditorRuntime();
            bindingManager.AddExportedType(typeof(Hash128)).EditorRuntime();
            bindingManager.AddExportedType(typeof(ImportAssetOptions)).EditorRuntime();
            bindingManager.AddExportedType(typeof(ScriptingRuntimeVersion)).EditorRuntime();
            bindingManager.AddExportedType(typeof(AssetImporter)).EditorRuntime();
            bindingManager.AddExportedType(typeof(ModelImporter)).EditorRuntime();
            bindingManager.AddExportedType(typeof(AudioImporter)).EditorRuntime();
            bindingManager.AddExportedType(typeof(VideoClipImporter)).EditorRuntime();
            bindingManager.AddExportedType(typeof(TextureImporter)).EditorRuntime();
            bindingManager.AddExportedType(typeof(MouseCursor)).EditorRuntime();
            bindingManager.AddExportedType(typeof(PauseState)).EditorRuntime();
            bindingManager.AddExportedType(typeof(PlayModeStateChange)).EditorRuntime();
            bindingManager.AddExportedType(typeof(ExportPackageOptions)).EditorRuntime();
            bindingManager.AddExportedType(typeof(ForceReserializeAssetsOptions)).EditorRuntime();
            bindingManager.AddExportedType(typeof(StatusQueryOptions)).EditorRuntime();
            bindingManager.AddExportedType(typeof(SerializedObject)).EditorRuntime();
            bindingManager.AddExportedType(typeof(SerializedProperty)).EditorRuntime();
            bindingManager.AddExportedType(typeof(SerializedPropertyType)).EditorRuntime();
            bindingManager.AddExportedType(typeof(AssetDatabase)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(EditorGUI)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(EditorGUIUtility)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(EditorGUILayout)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(EditorApplication)).EditorRuntime().SetAllConstructorsBlocked();
            bindingManager.AddExportedType(typeof(EditorWindow)).EditorRuntime()
            .SetMemberBlocked("GetWindowWithRect")
            //TODO: 此方法需要接管, 待处理, 暂时屏蔽
            .SetMethodBlocked("GetWindow", typeof(Type), typeof(bool), typeof(string), typeof(bool))
            //TODO: 此方法需要接管, 待处理, 暂时屏蔽
            .SetMethodBlocked("GetWindow", typeof(Type), typeof(bool), typeof(string))
            //TODO: 此方法需要接管, 待处理, 暂时屏蔽
            .SetMethodBlocked("GetWindow", typeof(Type), typeof(bool))
            .AddTSMethodDeclaration("static GetWindow<T extends UnityEditor.EditorWindow>(type: { new(): T }): T", "GetWindow", typeof(Type))
            .WriteCSConstructorBinding((bindPoint, cg, info) =>
            {
                if (bindPoint == BindingPoints.METHOD_BINDING_FULL)
                {
                    cg.cs.AppendLine("return _js_mono_behaviour_constructor(ctx, new_target);");
                    return(true);
                }

                return(false);
            })
            .WriteCSMethodBinding((bindPoint, cg, info) =>
            {
                if (bindPoint == BindingPoints.METHOD_BINDING_BEFORE_INVOKE)
                {
                    cg.cs.AppendLine("var inject = QuickJS.Unity.EditorWindowFix.js_get_window(ctx, argv[0], arg0);");
                    cg.cs.AppendLine("if (!inject.IsUndefined())");
                    using (cg.cs.CodeBlockScope())
                    {
                        cg.cs.AppendLine("return inject;");
                    }

                    return(true);
                }
                return(false);
            }, "GetWindow", typeof(Type))
            .AddStaticMethod(EditorWindowFix.CreateWindow)
            ;
        }
예제 #12
0
 public override void OnPreExporting(BindingManager bindingManager)
 {
     bindingManager.AddExportedType(typeof(System.Math));
 }