@@ -100,59 +100,41 @@ public override void OnInspectorGUI ()
100
100
}
101
101
102
102
public interface IExportOptions {
103
- ExportModelSettingsSerialize . ExportFormat GetExportFormat ( ) ;
104
- ExportModelSettingsSerialize . Include GetModelAnimIncludeOption ( ) ;
105
- ExportModelSettingsSerialize . LODExportType GetLODExportType ( ) ;
106
- ExportModelSettingsSerialize . ObjectPosition GetObjectPosition ( ) ;
107
- void SetObjectPosition ( ExportModelSettingsSerialize . ObjectPosition objPos ) ;
108
- bool AnimateSkinnedMesh ( ) ;
109
- bool UseMayaCompatibleNames ( ) ;
110
- bool ExportUnrendered ( ) ;
103
+ ExportModelSettingsSerialize . ExportFormat GetExportFormat { get ; set ; }
104
+ ExportModelSettingsSerialize . Include GetModelAnimIncludeOption { get ; set ; }
105
+ ExportModelSettingsSerialize . LODExportType GetLODExportType { get ; set ; }
106
+ ExportModelSettingsSerialize . ObjectPosition GetObjectPosition { get ; set ; }
107
+ bool AnimateSkinnedMesh { get ; set ; }
108
+ bool UseMayaCompatibleNames { get ; set ; }
111
109
}
112
110
113
- public class ExportModelSettings : ScriptableObject , IExportOptions
111
+ public abstract class ExportOptionsSettingsBase < T > : ScriptableObject , IExportOptions where T : ExportOptionsSettingsSerializeBase
114
112
{
115
- public ExportModelSettingsSerialize info ;
113
+ public T info = new T ( ) ;
114
+ ExportModelSettingsSerialize . ExportFormat GetExportFormat { get { return info . exportFormat ; } set { info . exportFormat = value ; } }
115
+ ExportModelSettingsSerialize . Include GetModelAnimIncludeOption { get ; set ; }
116
+ ExportModelSettingsSerialize . LODExportType GetLODExportType { get ; set ; }
117
+ ExportModelSettingsSerialize . ObjectPosition GetObjectPosition { get ; set ; }
118
+ bool AnimateSkinnedMesh { get ; set ; }
119
+ bool UseMayaCompatibleNames { get ; set ; }
120
+ bool ExportUnrendered { get ; set ; }
121
+ }
116
122
117
- public ExportModelSettings ( )
118
- {
119
- info = new ExportModelSettingsSerialize ( ) ;
120
- }
123
+ public class ExportModelSettings : ExportOptionsSettingsBase < ExportModelSettingsSerialize >
124
+ {
125
+ }
121
126
122
- public ExportModelSettingsSerialize . ExportFormat GetExportFormat ( ) {
123
- return info . exportFormat ;
124
- }
125
- public ExportModelSettingsSerialize . Include GetModelAnimIncludeOption ( ) {
126
- return info . include ;
127
- }
128
- public void SetModelAnimIncludeOption ( ExportModelSettingsSerialize . Include include ) {
129
- info . include = include ;
130
- }
131
- public ExportModelSettingsSerialize . LODExportType GetLODExportType ( ) {
132
- return info . lodLevel ;
133
- }
134
- public void SetLODExportType ( ExportModelSettingsSerialize . LODExportType lodType ) {
135
- info . lodLevel = lodType ;
136
- }
137
- public ExportModelSettingsSerialize . ObjectPosition GetObjectPosition ( ) {
138
- return info . objectPosition ;
139
- }
140
- public void SetObjectPosition ( ExportModelSettingsSerialize . ObjectPosition objPos ) {
141
- info . objectPosition = objPos ;
142
- }
143
- public bool AnimateSkinnedMesh ( ) {
144
- return info . animatedSkinnedMesh ;
145
- }
146
- public bool UseMayaCompatibleNames ( ) {
147
- return info . mayaCompatibleNaming ;
148
- }
149
- public bool ExportUnrendered ( ) {
150
- return info . exportUnrendered ;
151
- }
127
+ [ System . Serializable ]
128
+ public abstract class ExportOptionsSettingsSerializeBase
129
+ {
130
+ public ExportModelSettingsSerialize . ExportFormat exportFormat = ExportModelSettingsSerialize . ExportFormat . ASCII ;
131
+ public string rootMotionTransfer = "" ;
132
+ public bool animatedSkinnedMesh = true ;
133
+ public bool mayaCompatibleNaming = true ;
152
134
}
153
135
154
136
[ System . Serializable ]
155
- public class ExportModelSettingsSerialize
137
+ public class ExportModelSettingsSerialize : ExportOptionsSettingsSerializeBase
156
138
{
157
139
public enum ExportFormat { ASCII = 0 , Binary = 1 }
158
140
@@ -162,13 +144,9 @@ public enum ObjectPosition { LocalCentered = 0, WorldAbsolute = 1, Reset = 2 /*
162
144
163
145
public enum LODExportType { All = 0 , Highest = 1 , Lowest = 2 }
164
146
165
- public ExportFormat exportFormat = ExportFormat . ASCII ;
166
147
public Include include = Include . ModelAndAnim ;
167
148
public LODExportType lodLevel = LODExportType . All ;
168
149
public ObjectPosition objectPosition = ObjectPosition . LocalCentered ;
169
- public string rootMotionTransfer = "" ;
170
- public bool animatedSkinnedMesh = true ;
171
- public bool mayaCompatibleNaming = true ;
172
150
public bool exportUnrendered = true ;
173
151
}
174
152
}
0 commit comments