public static bool SerializeJBehaviourType(AnimBool[] fadeGroup, ILTypeInstance instance) { //如果JBehaviour var jBehaviourType = Init.Appdomain.LoadedTypes["JEngine.Core.JBehaviour"]; var t = instance.Type.ReflectionType; if (t.IsSubclassOf(jBehaviourType.ReflectionType)) { var f = t.GetField("_instanceID", BindingFlags.NonPublic); if (!(f is null)) { GUI.enabled = false; var id = f.GetValue(instance).ToString(); EditorGUILayout.TextField("InstanceID", id); GUI.enabled = true; } string frameModeStr = "FrameMode"; string frequencyStr = "Frequency"; string pausedStr = "Paused"; string totalTimeStr = "TotalTime"; string loopDeltaTimeStr = "LoopDeltaTime"; string loopCountsStr = "LoopCounts"; string timeScaleStr = "TimeScale"; fadeGroup[0].target = EditorGUILayout.Foldout(fadeGroup[0].target, "JBehaviour Stats", true); if (EditorGUILayout.BeginFadeGroup(fadeGroup[0].faded)) { var fm = t.GetField(frameModeStr, BindingFlags.Public); bool frameMode = !(fm is null) && EditorGUILayout.Toggle(frameModeStr, (bool)fm.GetValue(instance)); fm?.SetValue(instance, frameMode); var fq = t.GetField(frequencyStr, BindingFlags.Public); if (!(fq is null)) { int frequency = EditorGUILayout.IntField(frequencyStr, (int)fq.GetValue(instance)); fq.SetValue(instance, frequency); } GUI.enabled = false; var paused = t.GetField(pausedStr, BindingFlags.NonPublic); if (!(paused is null)) { EditorGUILayout.Toggle(pausedStr, (bool)paused.GetValue(instance)); } var totalTime = t.GetField(totalTimeStr, BindingFlags.Public); if (!(totalTime is null)) { EditorGUILayout.FloatField(totalTimeStr, (float)totalTime.GetValue(instance)); } var loopDeltaTime = t.GetField(loopDeltaTimeStr, BindingFlags.Public); if (!(loopDeltaTime is null)) { EditorGUILayout.FloatField(loopDeltaTimeStr, (float)loopDeltaTime.GetValue(instance)); } var loopCounts = t.GetField(loopCountsStr, BindingFlags.Public); if (!(loopCounts is null)) { EditorGUILayout.LongField(loopCountsStr, (long)loopCounts.GetValue(instance)); } GUI.enabled = true; var timeScale = t.GetField(timeScaleStr, BindingFlags.Public); if (!(timeScale is null)) { var ts = EditorGUILayout.FloatField(timeScaleStr, (float)timeScale.GetValue(instance)); timeScale.SetValue(instance, ts); } } EditorGUILayout.EndFadeGroup(); if (instance.Type.FieldMapping.Count > 0) { EditorGUILayout.Space(10); EditorGUILayout.HelpBox(String.Format(Setting.GetString(SettingString.MemberVariables), t.Name), MessageType.Info); } return(true); } return(false); }