瀏覽代碼

Move Props to props

trethaller 7 年之前
父節點
當前提交
b19dd1b058
共有 4 個文件被更改,包括 24 次插入25 次删除
  1. 1 22
      hide/comp/PropsEditor.hx
  2. 19 0
      hide/prefab/Props.hx
  3. 1 1
      hide/prefab/fx/Emitter.hx
  4. 3 2
      hide/tools/TypesCache.hx

+ 1 - 22
hide/comp/PropsEditor.hx

@@ -1,24 +1,5 @@
 package hide.comp;
-
-enum PropType {
-	PInt( ?min : Int, ?max : Int );
-	PFloat( ?min : Float, ?max : Float );
-	PVec( n : Int, ?min : Float, ?max : Float );
-	PBool;
-	PTexture;
-	PChoice( choices : Array<String> );
-	PFile( exts : Array<String> );
-	PUnsupported( debug : String );
-}
-
-typedef PropDef = {
-	name : String,
-	t : PropType,
-	?def: Dynamic,
-	?disp: String
-};
-
-#if editor
+import hide.prefab.Props;
 
 class PropsEditor extends Component {
 
@@ -475,5 +456,3 @@ class PropsField extends Component {
 	}
 
 }
-
-#end

+ 19 - 0
hide/prefab/Props.hx

@@ -0,0 +1,19 @@
+package hide.prefab;
+
+enum PropType {
+	PInt( ?min : Int, ?max : Int );
+	PFloat( ?min : Float, ?max : Float );
+	PVec( n : Int, ?min : Float, ?max : Float );
+	PBool;
+	PTexture;
+	PChoice( choices : Array<String> );
+	PFile( exts : Array<String> );
+	PUnsupported( debug : String );
+}
+
+typedef PropDef = {
+	name : String,
+	t : PropType,
+	?def: Dynamic,
+	?disp: String
+};

+ 1 - 1
hide/prefab/fx/Emitter.hx

@@ -23,7 +23,7 @@ using Lambda;
 }
 
 typedef ParamDef = {
-	> hide.comp.PropsEditor.PropDef,
+	> hide.prefab.Props.PropDef,
 	?animate: Bool,
 	?instance: Bool
 }

+ 3 - 2
hide/tools/TypesCache.hx

@@ -1,5 +1,6 @@
 package hide.tools;
 import hide.comp.PropsEditor;
+import hide.prefab.Props;
 
 enum ModelKind {
 	PrefabDef;
@@ -9,7 +10,7 @@ enum ModelKind {
 typedef TypeModel = {
 	var id : String;
 	var kind : ModelKind;
-	var fields : Array<PropDef>;
+	var fields : Array<hide.prefab.Props.PropDef>;
 	var file : TypeFile;
 }
 
@@ -215,7 +216,7 @@ class TypesCache {
 		}
 	}
 
-	public static function defType( t :  PropType ) : Dynamic {
+	public static function defType( t : PropType ) : Dynamic {
 		switch( t ) {
 		case PInt(min, _):
 			return if( min == null ) 0 else min;