Пример #1
0
            public UTimelineWindowTimeControl(Assembly asmTimelineEditor, Assembly asmTimelineEngine)
            {
                timelineWindowTimeControlType  = asmTimelineEditor.GetType("UnityEditor.Timeline.TimelineWindowTimeControl");
                Assert.IsNotNull(dg_get_m_Clip = EditorCommon.CreateGetFieldDelegate <TimelineClip>(timelineWindowTimeControlType.GetField("m_Clip", BindingFlags.NonPublic | BindingFlags.Instance)));

                uTimelineState = new UTimelineState();
            }
Пример #2
0
        public UDisc()
        {
            var asmUnityEditor = Assembly.LoadFrom(InternalEditorUtility.GetEditorAssemblyPath());
            var discType       = asmUnityEditor.GetType("UnityEditorInternal.Disc");

            Assert.IsNotNull(dg_get_s_RotationDist = EditorCommon.CreateGetFieldDelegate <float>(discType.GetField("s_RotationDist", BindingFlags.NonPublic | BindingFlags.Static)));
        }
Пример #3
0
        public UEditorGUIUtility()
        {
            var asmUnityEditor       = Assembly.LoadFrom(InternalEditorUtility.GetEditorAssemblyPath());
            var editorGUIUtilityType = asmUnityEditor.GetType("UnityEditor.EditorGUIUtility");

            Assert.IsNotNull(dg_get_s_LastControlID = EditorCommon.CreateGetFieldDelegate <int>(editorGUIUtilityType.GetField("s_LastControlID", BindingFlags.NonPublic | BindingFlags.Static)));
        }
            public UAnimationWindowControl_2019_1(Assembly asmUnityEditor) : base(asmUnityEditor)
            {
                var animationWindowControlType = asmUnityEditor.GetType("UnityEditorInternal.AnimationWindowControl");

                Assert.IsNotNull(dg_get_m_Graph                 = EditorCommon.CreateGetFieldDelegate <PlayableGraph>(animationWindowControlType.GetField("m_Graph", BindingFlags.NonPublic | BindingFlags.Instance)));
                Assert.IsNotNull(dg_get_m_ClipPlayable          = EditorCommon.CreateGetFieldDelegate <AnimationClipPlayable>(animationWindowControlType.GetField("m_ClipPlayable", BindingFlags.NonPublic | BindingFlags.Instance)));
                Assert.IsNotNull(dg_get_m_CandidateClipPlayable = EditorCommon.CreateGetFieldDelegate <AnimationClipPlayable>(animationWindowControlType.GetField("m_CandidateClipPlayable", BindingFlags.NonPublic | BindingFlags.Instance)));
            }
Пример #5
0
        public UEditorGUIUtility()
        {
            var asmUnityEditor       = Assembly.LoadFrom(InternalEditorUtility.GetEditorAssemblyPath());
            var editorGUIUtilityType = asmUnityEditor.GetType("UnityEditor.EditorGUIUtility");

            Assert.IsNotNull(dg_LoadIcon            = (Func <string, Texture2D>)Delegate.CreateDelegate(typeof(Func <string, Texture2D>), null, editorGUIUtilityType.GetMethod("LoadIcon", BindingFlags.Static | BindingFlags.NonPublic)));
            Assert.IsNotNull(dg_get_s_LastControlID = EditorCommon.CreateGetFieldDelegate <int>(editorGUIUtilityType.GetField("s_LastControlID", BindingFlags.NonPublic | BindingFlags.Static)));
        }
Пример #6
0
        public UParameterControllerEditor()
        {
            var path           = InternalEditorUtility.GetEditorAssemblyPath().Replace("UnityEditor.dll", "UnityEditor.Graphs.dll");
            var asmUnityEditor = Assembly.LoadFrom(path);
            var parameterControllerEditorType = asmUnityEditor.GetType("UnityEditor.Graphs.ParameterControllerEditor");

            Assert.IsNotNull(dg_get_tool = EditorCommon.CreateGetFieldDelegate <object>(parameterControllerEditorType.GetField("tool", BindingFlags.Public | BindingFlags.Static)));
            Assert.IsNotNull(dg_set_m_PreviewAnimator = EditorCommon.CreateSetFieldDelegate <Animator>(parameterControllerEditorType.GetField("m_PreviewAnimator", BindingFlags.NonPublic | BindingFlags.Instance)));
        }
Пример #7
0
        public UTreeView()
        {
            var asmUnityEditor = Assembly.LoadFrom(InternalEditorUtility.GetEditorAssemblyPath());
            var treeViewType   = asmUnityEditor.GetType("UnityEditor.IMGUI.Controls.TreeView");

            Assert.IsNotNull(dg_get_m_TreeView = EditorCommon.CreateGetFieldDelegate <object>(treeViewType.GetField("m_TreeView", BindingFlags.NonPublic | BindingFlags.Instance)));

            uTreeViewController = new UTreeViewController();
        }
Пример #8
0
 public UBodyMaskEditor()
 {
     var asmUnityEditor     = Assembly.LoadFrom(InternalEditorUtility.GetEditorAssemblyPath());
     var bodyMaskEditorType = asmUnityEditor.GetType("UnityEditor.BodyMaskEditor");
     {
         var fi_m_MaskBodyPartPicker = bodyMaskEditorType.GetField("m_MaskBodyPartPicker", BindingFlags.NonPublic | BindingFlags.Static);
         Assert.IsNotNull(dg_get_m_MaskBodyPartPicker = EditorCommon.CreateGetFieldDelegate <Color[]>(fi_m_MaskBodyPartPicker));
     }
 }
Пример #9
0
        public UAnimationWindow_2018_1()
        {
            var asmUnityEditor      = Assembly.LoadFrom(InternalEditorUtility.GetEditorAssemblyPath());
            var animationWindowType = asmUnityEditor.GetType("UnityEditor.AnimationWindow");

            uAnimEditor = uAnimEditor_2018_1 = new UAnimEditor_2018_1(asmUnityEditor);
            uEditorGUIUtility_2018_1 = new UEditorGUIUtility_2018_1();
            Assert.IsNotNull(dg_get_m_LockTracker = EditorCommon.CreateGetFieldDelegate <object>(animationWindowType.GetField("m_LockTracker", BindingFlags.NonPublic | BindingFlags.Instance)));
        }
Пример #10
0
 public UAnimatorControllerTool()
 {
     var path                       = InternalEditorUtility.GetEditorAssemblyPath().Replace("UnityEditor.dll", "UnityEditor.Graphs.dll");
     var asmUnityEditor             = Assembly.LoadFrom(path);
     var animatorControllerToolType = asmUnityEditor.GetType("UnityEditor.Graphs.AnimatorControllerTool");
     {
         var fi_tool = animatorControllerToolType.GetField("tool", BindingFlags.Public | BindingFlags.Static);
         Assert.IsNotNull(dg_get_tool = EditorCommon.CreateGetFieldDelegate <object>(fi_tool));
     }
 }
Пример #11
0
        public UTimeControl(object instance)
        {
            this.instance = instance;

            var asmUnityEditor  = Assembly.LoadFrom(InternalEditorUtility.GetEditorAssemblyPath());
            var timeControlType = asmUnityEditor.GetType("UnityEditor.TimeControl");

            {
                var fi_currentTime = timeControlType.GetField("currentTime");
                dg_get_currentTime = EditorCommon.CreateGetFieldDelegate <float>(fi_currentTime);
                dg_set_currentTime = EditorCommon.CreateSetFieldDelegate <float>(fi_currentTime);
            }
            {
                var pi_nextCurrentTime = timeControlType.GetProperty("nextCurrentTime");
                dg_set_nextCurrentTime = (Action <float>)Delegate.CreateDelegate(typeof(Action <float>), instance, pi_nextCurrentTime.GetSetMethod());
            }
            {
                var fi_startTime = timeControlType.GetField("startTime");
                dg_get_startTime = EditorCommon.CreateGetFieldDelegate <float>(fi_startTime);
                dg_set_startTime = EditorCommon.CreateSetFieldDelegate <float>(fi_startTime);
            }
            {
                var fi_stopTime = timeControlType.GetField("stopTime");
                dg_get_stopTime = EditorCommon.CreateGetFieldDelegate <float>(fi_stopTime);
                dg_set_stopTime = EditorCommon.CreateSetFieldDelegate <float>(fi_stopTime);
            }
            {
                var fi_loop = timeControlType.GetField("loop");
                dg_get_loop = EditorCommon.CreateGetFieldDelegate <bool>(fi_loop);
                dg_set_loop = EditorCommon.CreateSetFieldDelegate <bool>(fi_loop);
            }

            dg_Update = (Action)Delegate.CreateDelegate(typeof(Action), instance, timeControlType.GetMethod("Update"));
            {
                var pi_deltaTime = timeControlType.GetProperty("deltaTime");
                dg_get_deltaTime = (Func <float>)Delegate.CreateDelegate(typeof(Func <float>), instance, pi_deltaTime.GetGetMethod());
                dg_set_deltaTime = (Action <float>)Delegate.CreateDelegate(typeof(Action <float>), instance, pi_deltaTime.GetSetMethod());
            }
            {
                var fi_m_DeltaTimeSet = timeControlType.GetField("m_DeltaTimeSet", BindingFlags.NonPublic | BindingFlags.Instance);
                dg_get_m_DeltaTimeSet = EditorCommon.CreateGetFieldDelegate <bool>(fi_m_DeltaTimeSet);
            }
            {
                var pi_playing = timeControlType.GetProperty("playing");
                dg_get_playing = (Func <bool>)Delegate.CreateDelegate(typeof(Func <bool>), instance, pi_playing.GetGetMethod());
                dg_set_playing = (Action <bool>)Delegate.CreateDelegate(typeof(Action <bool>), instance, pi_playing.GetSetMethod());
            }
        }
Пример #12
0
        public UAnimationWindow_2018_1()
        {
            var asmUnityEditor      = Assembly.LoadFrom(InternalEditorUtility.GetEditorAssemblyPath());
            var animationWindowType = asmUnityEditor.GetType("UnityEditor.AnimationWindow");

            uAnimEditor           = uAnimEditor_2018_1 = new UAnimEditor_2018_1(asmUnityEditor);
            uAnimationWindowState = uAnimationWindowState_2018_1 = new UAnimationWindowState_2018_1(asmUnityEditor);
#if VERYANIMATION_TIMELINE
#if UNITY_2018_3_OR_NEWER
            uTimelineWindow = uTimelineWindow_2018_2 = uTimelineWindow_2018_3 = new UTimelineWindow_2018_3();
#elif UNITY_2018_2_OR_NEWER
            uTimelineWindow = uTimelineWindow_2018_2 = new UTimelineWindow_2018_2();
#endif
#endif
            uEditorGUIUtility_2018_1 = new UEditorGUIUtility_2018_1();
            Assert.IsNotNull(dg_get_m_LockTracker = EditorCommon.CreateGetFieldDelegate <object>(animationWindowType.GetField("m_LockTracker", BindingFlags.NonPublic | BindingFlags.Instance)));
        }
Пример #13
0
        public UAvatarPreview(AnimationClip clip, GameObject gameObject)
        {
            var asmUnityEditor    = Assembly.LoadFrom(InternalEditorUtility.GetEditorAssemblyPath());
            var avatarPreviewType = asmUnityEditor.GetType("UnityEditor.AvatarPreview");

            Assert.IsNotNull(instance        = Activator.CreateInstance(avatarPreviewType, new object[] { null, clip }));
            Assert.IsNotNull(fi_m_PreviewDir = avatarPreviewType.GetField("m_PreviewDir", BindingFlags.NonPublic | BindingFlags.Instance));
            Assert.IsNotNull(fi_m_ZoomFactor = avatarPreviewType.GetField("m_ZoomFactor", BindingFlags.NonPublic | BindingFlags.Instance));
            Assert.IsNotNull(dg_set_fps      = EditorCommon.CreateSetFieldDelegate <int>(avatarPreviewType.GetField("fps")));
            Assert.IsNotNull(dg_get_m_SourcePreviewMotion = EditorCommon.CreateGetFieldDelegate <AnimationClip>(avatarPreviewType.GetField("m_SourcePreviewMotion", BindingFlags.NonPublic | BindingFlags.Instance)));
            Assert.IsNotNull(dg_get_IKOnFeet           = (Func <bool>)Delegate.CreateDelegate(typeof(Func <bool>), instance, avatarPreviewType.GetProperty("IKOnFeet").GetGetMethod()));
            Assert.IsNotNull(dg_get_Animator           = (Func <Animator>)Delegate.CreateDelegate(typeof(Func <Animator>), instance, avatarPreviewType.GetProperty("Animator").GetGetMethod()));
            Assert.IsNotNull(dg_get_ShowIKOnFeetButton = (Func <bool>)Delegate.CreateDelegate(typeof(Func <bool>), instance, avatarPreviewType.GetProperty("ShowIKOnFeetButton").GetGetMethod()));
            Assert.IsNotNull(dg_set_ShowIKOnFeetButton = (Action <bool>)Delegate.CreateDelegate(typeof(Action <bool>), instance, avatarPreviewType.GetProperty("ShowIKOnFeetButton").GetSetMethod()));
            Assert.IsNotNull(dg_get_PreviewObject      = (Func <GameObject>)Delegate.CreateDelegate(typeof(Func <GameObject>), instance, avatarPreviewType.GetProperty("PreviewObject").GetGetMethod()));
            Assert.IsNotNull(dg_get_animationClipType  = (Func <ModelImporterAnimationType>)Delegate.CreateDelegate(typeof(Func <ModelImporterAnimationType>), instance, avatarPreviewType.GetProperty("animationClipType").GetGetMethod()));
            Assert.IsNotNull(dg_DoPreviewSettings      = (Action)Delegate.CreateDelegate(typeof(Action), instance, avatarPreviewType.GetMethod("DoPreviewSettings")));
            Assert.IsNotNull(dg_DoAvatarPreview        = (Action <Rect, GUIStyle>)Delegate.CreateDelegate(typeof(Action <Rect, GUIStyle>), instance, avatarPreviewType.GetMethod("DoAvatarPreview")));
#if UNITY_2018_2_OR_NEWER
            Assert.IsNotNull(dg_OnDestroy = (Action)Delegate.CreateDelegate(typeof(Action), instance, avatarPreviewType.GetMethod("OnDisable")));
#else
            Assert.IsNotNull(dg_OnDestroy = (Action)Delegate.CreateDelegate(typeof(Action), instance, avatarPreviewType.GetMethod("OnDestroy")));
#endif
            Assert.IsNotNull(dg_SetPreview         = (Action <GameObject>)Delegate.CreateDelegate(typeof(Action <GameObject>), instance, avatarPreviewType.GetMethod("SetPreview", BindingFlags.NonPublic | BindingFlags.Instance)));
            Assert.IsNotNull(pi_OnAvatarChangeFunc = avatarPreviewType.GetProperty("OnAvatarChangeFunc"));

            uAnimatorController   = new UAnimatorController();
            uAnimatorStateMachine = new UAnimatorStateMachine();
            uAnimatorState        = new UAnimatorState();

            {
                var fi_timeControl = avatarPreviewType.GetField("timeControl");
                uTimeControl             = new UTimeControl(fi_timeControl.GetValue(instance));
                uTimeControl.startTime   = 0f;
                uTimeControl.stopTime    = clip.length;
                uTimeControl.currentTime = 0f;
            }
            uAvatarPreviewSelection = new UAvatarPreviewSelection(asmUnityEditor);

            pi_OnAvatarChangeFunc.SetValue(instance, Delegate.CreateDelegate(pi_OnAvatarChangeFunc.PropertyType, this, GetType().GetMethod("OnAvatarChangeFunc", BindingFlags.NonPublic | BindingFlags.Instance)), null);
            dg_set_fps(instance, (int)clip.frameRate);
            dg_SetPreview(gameObject);

            AnimationUtility.onCurveWasModified += OnCurveWasModified;
        }
        public UMuscleClipEditorUtilities()
        {
            var asmUnityEditor            = Assembly.LoadFrom(InternalEditorUtility.GetEditorAssemblyPath());
            var muscleClipQualityInfoType = asmUnityEditor.GetType("UnityEditor.MuscleClipQualityInfo");

            Assert.IsNotNull(dg_get_loop            = EditorCommon.CreateGetFieldDelegate <float>(muscleClipQualityInfoType.GetField("loop", BindingFlags.Public | BindingFlags.Instance)));
            Assert.IsNotNull(dg_get_loopOrientation = EditorCommon.CreateGetFieldDelegate <float>(muscleClipQualityInfoType.GetField("loopOrientation", BindingFlags.Public | BindingFlags.Instance)));
            Assert.IsNotNull(dg_get_loopPositionY   = EditorCommon.CreateGetFieldDelegate <float>(muscleClipQualityInfoType.GetField("loopPositionY", BindingFlags.Public | BindingFlags.Instance)));
            Assert.IsNotNull(dg_get_loopPositionXZ  = EditorCommon.CreateGetFieldDelegate <float>(muscleClipQualityInfoType.GetField("loopPositionXZ", BindingFlags.Public | BindingFlags.Instance)));

            var muscleClipEditorUtilitiesType = asmUnityEditor.GetType("UnityEditor.MuscleClipEditorUtilities");

            if (muscleClipEditorUtilitiesType != null)
            {
                mi_GetMuscleClipQualityInfo = muscleClipEditorUtilitiesType.GetMethod("GetMuscleClipQualityInfo", BindingFlags.Public | BindingFlags.Static);
                if (mi_GetMuscleClipQualityInfo != null)
                {
                    Assert.IsNotNull(dg_GetMuscleClipQualityInfo = (Func <AnimationClip, float, float, object>)Delegate.CreateDelegate(typeof(Func <AnimationClip, float, float, object>), null, mi_GetMuscleClipQualityInfo));
                }
            }
        }
Пример #15
0
 public UAnimationWindowState_2017_1(Assembly asmUnityEditor) : base(asmUnityEditor)
 {
     Assert.IsNotNull(mi_StartPreview            = animationWindowStateType.GetMethod("StartPreview"));
     Assert.IsNotNull(mi_StopPreview             = animationWindowStateType.GetMethod("StopPreview"));
     Assert.IsNotNull(dg_get_linkedWithSequencer = EditorCommon.CreateGetFieldDelegate <bool>(animationWindowStateType.GetField("linkedWithSequencer")));
 }