LiuQilin il y a 7 ans
Parent
commit
de534cd534

+ 342 - 0
Assets/Panel.prefab

@@ -0,0 +1,342 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1001 &100100000
+Prefab:
+  m_ObjectHideFlags: 1
+  serializedVersion: 2
+  m_Modification:
+    m_TransformParent: {fileID: 0}
+    m_Modifications: []
+    m_RemovedComponents: []
+  m_ParentPrefab: {fileID: 0}
+  m_RootGameObject: {fileID: 1338839275615992}
+  m_IsPrefabParent: 1
+--- !u!1 &1068751886612132
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 224977832684939848}
+  - component: {fileID: 222685148270028482}
+  - component: {fileID: 114448897707175658}
+  m_Layer: 5
+  m_Name: Title
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!1 &1338839275615992
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 224597384089362468}
+  - component: {fileID: 222238864335677058}
+  - component: {fileID: 114501709495217876}
+  m_Layer: 5
+  m_Name: Panel
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!1 &1654504510131344
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 224190239401635906}
+  - component: {fileID: 222235463764209680}
+  - component: {fileID: 114002878433859344}
+  m_Layer: 5
+  m_Name: Content
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!1 &1685656166903684
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 224527758619848776}
+  - component: {fileID: 222326605321166382}
+  - component: {fileID: 114759974216822980}
+  - component: {fileID: 114506942635537576}
+  m_Layer: 5
+  m_Name: Button
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!114 &114002878433859344
+MonoBehaviour:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1654504510131344}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
+  m_RaycastTarget: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+  m_FontData:
+    m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
+    m_FontSize: 14
+    m_FontStyle: 0
+    m_BestFit: 0
+    m_MinSize: 10
+    m_MaxSize: 40
+    m_Alignment: 0
+    m_AlignByGeometry: 0
+    m_RichText: 1
+    m_HorizontalOverflow: 0
+    m_VerticalOverflow: 0
+    m_LineSpacing: 1
+  m_Text: New Text
+--- !u!114 &114448897707175658
+MonoBehaviour:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1068751886612132}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
+  m_RaycastTarget: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+  m_FontData:
+    m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
+    m_FontSize: 14
+    m_FontStyle: 0
+    m_BestFit: 0
+    m_MinSize: 10
+    m_MaxSize: 40
+    m_Alignment: 0
+    m_AlignByGeometry: 0
+    m_RichText: 1
+    m_HorizontalOverflow: 0
+    m_VerticalOverflow: 0
+    m_LineSpacing: 1
+  m_Text: New Text
+--- !u!114 &114501709495217876
+MonoBehaviour:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1338839275615992}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+  m_Sprite: {fileID: 0}
+  m_Type: 0
+  m_PreserveAspect: 0
+  m_FillCenter: 1
+  m_FillMethod: 4
+  m_FillAmount: 1
+  m_FillClockwise: 1
+  m_FillOrigin: 0
+--- !u!114 &114506942635537576
+MonoBehaviour:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1685656166903684}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Navigation:
+    m_Mode: 3
+    m_SelectOnUp: {fileID: 0}
+    m_SelectOnDown: {fileID: 0}
+    m_SelectOnLeft: {fileID: 0}
+    m_SelectOnRight: {fileID: 0}
+  m_Transition: 1
+  m_Colors:
+    m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
+    m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
+    m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
+    m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
+    m_ColorMultiplier: 1
+    m_FadeDuration: 0.1
+  m_SpriteState:
+    m_HighlightedSprite: {fileID: 0}
+    m_PressedSprite: {fileID: 0}
+    m_DisabledSprite: {fileID: 0}
+  m_AnimationTriggers:
+    m_NormalTrigger: Normal
+    m_HighlightedTrigger: Highlighted
+    m_PressedTrigger: Pressed
+    m_DisabledTrigger: Disabled
+  m_Interactable: 1
+  m_TargetGraphic: {fileID: 114759974216822980}
+  m_OnClick:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
+      Culture=neutral, PublicKeyToken=null
+--- !u!114 &114759974216822980
+MonoBehaviour:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1685656166903684}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+  m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
+  m_Type: 1
+  m_PreserveAspect: 0
+  m_FillCenter: 1
+  m_FillMethod: 4
+  m_FillAmount: 1
+  m_FillClockwise: 1
+  m_FillOrigin: 0
+--- !u!222 &222235463764209680
+CanvasRenderer:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1654504510131344}
+--- !u!222 &222238864335677058
+CanvasRenderer:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1338839275615992}
+--- !u!222 &222326605321166382
+CanvasRenderer:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1685656166903684}
+--- !u!222 &222685148270028482
+CanvasRenderer:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1068751886612132}
+--- !u!224 &224190239401635906
+RectTransform:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1654504510131344}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 224597384089362468}
+  m_RootOrder: 1
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 160, y: 30}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!224 &224527758619848776
+RectTransform:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1685656166903684}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 224597384089362468}
+  m_RootOrder: 2
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 160, y: 30}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!224 &224597384089362468
+RectTransform:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1338839275615992}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children:
+  - {fileID: 224977832684939848}
+  - {fileID: 224190239401635906}
+  - {fileID: 224527758619848776}
+  m_Father: {fileID: 0}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 100, y: 100}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!224 &224977832684939848
+RectTransform:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1068751886612132}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 224597384089362468}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 160, y: 30}
+  m_Pivot: {x: 0.5, y: 0.5}

+ 8 - 0
Assets/Panel.prefab.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c32731d4b49fbd146ae54a3978501d8c
+timeCreated: 1513924906
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 264 - 104
Assets/Resource/Logo.unity

@@ -91,6 +91,104 @@ NavMeshSettings:
     cellSize: 0.16666666
     accuratePlacement: 0
   m_NavMeshData: {fileID: 0}
+--- !u!224 &3457372 stripped
+RectTransform:
+  m_PrefabParentObject: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+    type: 2}
+  m_PrefabInternal: {fileID: 1311681672}
+--- !u!1 &16072523
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 16072527}
+  - component: {fileID: 16072526}
+  - component: {fileID: 16072525}
+  - component: {fileID: 16072524}
+  m_Layer: 5
+  m_Name: Canvas
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!114 &16072524
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 16072523}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_IgnoreReversedGraphics: 1
+  m_BlockingObjects: 0
+  m_BlockingMask:
+    serializedVersion: 2
+    m_Bits: 4294967295
+--- !u!114 &16072525
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 16072523}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_UiScaleMode: 0
+  m_ReferencePixelsPerUnit: 100
+  m_ScaleFactor: 1
+  m_ReferenceResolution: {x: 800, y: 600}
+  m_ScreenMatchMode: 0
+  m_MatchWidthOrHeight: 0
+  m_PhysicalUnit: 3
+  m_FallbackScreenDPI: 96
+  m_DefaultSpriteDPI: 96
+  m_DynamicPixelsPerUnit: 1
+--- !u!223 &16072526
+Canvas:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 16072523}
+  m_Enabled: 1
+  serializedVersion: 2
+  m_RenderMode: 0
+  m_Camera: {fileID: 0}
+  m_PlaneDistance: 100
+  m_PixelPerfect: 0
+  m_ReceivesEvents: 1
+  m_OverrideSorting: 0
+  m_OverridePixelPerfect: 0
+  m_SortingBucketNormalizedSize: 0
+  m_SortingLayerID: 0
+  m_SortingOrder: 0
+  m_TargetDisplay: 0
+--- !u!224 &16072527
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 16072523}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 0, y: 0, z: 0}
+  m_Children:
+  - {fileID: 3457372}
+  m_Father: {fileID: 0}
+  m_RootOrder: 4
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0, y: 0}
+  m_AnchorMax: {x: 0, y: 0}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 0, y: 0}
+  m_Pivot: {x: 0, y: 0}
 --- !u!1 &465425181
 GameObject:
   m_ObjectHideFlags: 0
@@ -229,110 +327,6 @@ CanvasRenderer:
   m_PrefabParentObject: {fileID: 0}
   m_PrefabInternal: {fileID: 0}
   m_GameObject: {fileID: 722194761}
---- !u!1001 &760090006
-Prefab:
-  m_ObjectHideFlags: 0
-  serializedVersion: 2
-  m_Modification:
-    m_TransformParent: {fileID: 0}
-    m_Modifications:
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_LocalPosition.x
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_LocalPosition.y
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_LocalPosition.z
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_LocalRotation.x
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_LocalRotation.y
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_LocalRotation.z
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_LocalRotation.w
-      value: 1
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_RootOrder
-      value: 4
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_AnchoredPosition.x
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_AnchoredPosition.y
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_SizeDelta.x
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_SizeDelta.y
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_AnchorMin.x
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_AnchorMin.y
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_AnchorMax.x
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_AnchorMax.y
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_Pivot.x
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 224229560457679016, guid: 8647d80b558fa724a84d05f9e6aee9bc,
-        type: 2}
-      propertyPath: m_Pivot.y
-      value: 0
-      objectReference: {fileID: 0}
-    - target: {fileID: 1948781497737682, guid: 8647d80b558fa724a84d05f9e6aee9bc, type: 2}
-      propertyPath: m_Name
-      value: Canvas (1)
-      objectReference: {fileID: 0}
-    m_RemovedComponents: []
-  m_ParentPrefab: {fileID: 100100000, guid: 8647d80b558fa724a84d05f9e6aee9bc, type: 2}
-  m_IsPrefabParent: 0
 --- !u!1 &841147520
 GameObject:
   m_ObjectHideFlags: 0
@@ -513,6 +507,172 @@ Transform:
   m_Father: {fileID: 0}
   m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1001 &1311681672
+Prefab:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  m_Modification:
+    m_TransformParent: {fileID: 16072527}
+    m_Modifications:
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_LocalPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_LocalPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_LocalPosition.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_LocalRotation.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_LocalRotation.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_LocalRotation.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_LocalRotation.w
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_RootOrder
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_AnchoredPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_AnchoredPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_SizeDelta.x
+      value: 100
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_SizeDelta.y
+      value: 100
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_AnchorMin.x
+      value: 0.5
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_AnchorMin.y
+      value: 0.5
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_AnchorMax.x
+      value: 0.5
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_AnchorMax.y
+      value: 0.5
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_Pivot.x
+      value: 0.5
+      objectReference: {fileID: 0}
+    - target: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      propertyPath: m_Pivot.y
+      value: 0.5
+      objectReference: {fileID: 0}
+    - target: {fileID: 1338839275615992, guid: c32731d4b49fbd146ae54a3978501d8c, type: 2}
+      propertyPath: m_Name
+      value: Panel
+      objectReference: {fileID: 0}
+    m_RemovedComponents: []
+  m_ParentPrefab: {fileID: 100100000, guid: c32731d4b49fbd146ae54a3978501d8c, type: 2}
+  m_IsPrefabParent: 0
+--- !u!1 &1334439472
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 1334439475}
+  - component: {fileID: 1334439474}
+  - component: {fileID: 1334439473}
+  m_Layer: 0
+  m_Name: EventSystem
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!114 &1334439473
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1334439472}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_HorizontalAxis: Horizontal
+  m_VerticalAxis: Vertical
+  m_SubmitButton: Submit
+  m_CancelButton: Cancel
+  m_InputActionsPerSecond: 10
+  m_RepeatDelay: 0.5
+  m_ForceModuleActive: 0
+--- !u!114 &1334439474
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1334439472}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_FirstSelected: {fileID: 0}
+  m_sendNavigationEvents: 1
+  m_DragThreshold: 5
+--- !u!4 &1334439475
+Transform:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1334439472}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_RootOrder: 5
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &1511433816
 GameObject:
   m_ObjectHideFlags: 0

+ 1 - 1
Assets/Resource/Prefab/PrefabUI/FashionShowCloseBox.prefab.meta

@@ -4,5 +4,5 @@ timeCreated: 1513823130
 licenseType: Pro
 NativeFormatImporter:
   userData: 
-  assetBundleName: 
+  assetBundleName: ui
   assetBundleVariant: 

+ 2 - 1
Assets/Script/Object/Player.cs

@@ -1369,6 +1369,8 @@ public class Player : Regist , IPointerClickHandler
 
     public void DisplayInUI(float scale)
     {
+        UGUIScale = scale;
+        scale *= ResourceManager.Get<Canvas>(CanvasLabel.Canvas).scaleFactor;
         MeshFilter[] meshFilters = UAC.GetComponentsInChildren<MeshFilter>(true);
         MeshRenderer[] meshRenderers = UAC.GetComponentsInChildren<MeshRenderer>(true);
         for (int i = 0; i < meshRenderers.Length; i++)
@@ -1385,7 +1387,6 @@ public class Player : Regist , IPointerClickHandler
             DeactiveShadow();
         }
         IsDisplayInUGUI = true;
-        UGUIScale = scale;
         ResetDepth();
     }
 

+ 1 - 1
Assets/Script/Social/FashionShowCloseBox.cs

@@ -173,7 +173,7 @@ public class FashionShowCloseBox : VirtualScrollRectItem
 
     public void SetNextCell(FashionShowData data)
     {
-        float scale = UnusedCells.Count == 5 ? 50 : 20;
+        float scale = UnusedCells.Count == 5 ? 37.5f : 17.5f;
         FashionShowCloseCell cell = UnusedCells.Forward(0, true);
         cell.Init(scale, data);
     }

+ 14 - 2
Assets/Script/Social/FashionShowEditPage.cs

@@ -238,8 +238,18 @@ public class FashionShowEditPage : Regist
             CloseItem closeItem = PlayerManager.CloseItemDictionary[closeID];
             closeItem.ChangeDress(DisplayPlayer, false);
         }
-        DelayCall.Call(1, () => { DisplayPlayer.ResetDepth(); DisplayPlayer.DisplayInUI(50); });
-
+        DelayCall.Call(1, () => { DisplayPlayer.ResetDepth(); DisplayPlayer.DisplayInUI(37.5f); });
+
+        int cuteRate = int.Parse(FashionShowData.CuteRate);
+        int gloryRate = int.Parse(FashionShowData.GloryRate);
+        int graceRate = int.Parse(FashionShowData.GraceRate);
+        int simpleRate = int.Parse(FashionShowData.SimpleRate);
+        int vividRate = int.Parse(FashionShowData.VividRate);
+        CuteSlider.value = cuteRate == 0 ? 1 : cuteRate;
+        GlorySlider.value = cuteRate == 0 ? 1 : gloryRate;
+        GraceSlider.value = cuteRate == 0 ? 1 : graceRate;
+        SimpleSlider.value = cuteRate == 0 ? 1 : simpleRate;
+        VividSlider.value = cuteRate == 0 ? 1 : vividRate;
         CuteValue.text = FashionShowData.CuteRate == "0" ? "--" : FashionShowData.CuteRate;
         GloryValue.text = FashionShowData.GloryRate == "0" ? "--" : FashionShowData.GloryRate;
         GraceValue.text = FashionShowData.GraceRate == "0" ? "--" : FashionShowData.GraceRate;
@@ -634,10 +644,12 @@ public class FashionShowEditPage : Regist
         if (level >= UnlockLevel)
         {
             GardenFashionShowButtonParent.SetActive(true);
+            DressroomFashionShowButton.SetActive(true);
         }
         else
         {
             GardenFashionShowButtonParent.SetActive(false);
+            DressroomFashionShowButton.SetActive(false);
         }
     }
 

+ 17 - 0
Assets/TestLabel.cs

@@ -0,0 +1,17 @@
+using UnityEngine;
+using UnityEngine.UI;
+using System.Collections.Generic;
+
+public class TestLabel
+{
+	#region Config
+
+	//StartMark-Used by LabelUtility-Do not remove
+	public static string Panel = "Panel";
+	public static string Title = "Title";
+	public static string Content = "Content";
+	public static string Button = "Button";
+	//EndMark-Used by LabelUtility-Do not remove
+
+	#endregion
+}

+ 12 - 0
Assets/TestLabel.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: f7fb805300eb1a943a9198efb382841e
+timeCreated: 1513936121
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 32 - 0
Assets/TestScript.cs

@@ -0,0 +1,32 @@
+using UnityEngine;
+using UnityEngine.UI;
+using System.Collections.Generic;
+
+public class TestScript : MonoBehaviour
+{
+	#region Config
+
+	//StartMark-Used by LabelUtility-Do not remove
+	private Text Title;
+	private Text Content;
+	private Button Button;
+	private Button Panel;
+	//EndMark-Used by LabelUtility-Do not remove
+
+	#endregion
+
+	private void Regist()
+	{
+		//RegistStartMark-Used by LabelUtility-Do not remove
+		Dictionary<string, Transform> childDictionary = new Dictionary<string, Transform>();
+		Auxiliary.CompileDic(transform, childDictionary);
+		Title = childDictionary[TestLabel.Title].GetComponent<Text>();
+		Content = childDictionary[TestLabel.Content].GetComponent<Text>();
+		Button = childDictionary[TestLabel.Button].GetComponent<Button>();
+		Panel = childDictionary[TestLabel.Panel].GetComponent<Button>();
+		//RegistEndMark-Used by LabelUtility-Do not remove
+	}
+
+	//EventStartMark-Used by LabelUtility-Do not remove
+	//EventEndMark-Used by LabelUtility-Do not remove
+}

+ 12 - 0
Assets/TestScript.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 12e87b20af07e454dbd88462d0bdcd72
+timeCreated: 1513936122
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 301 - 118
Assets/Tookits/LabelUtility/Editor/LabelSetDrawer.cs

@@ -1,149 +1,332 @@
+using System.Reflection;
+
 namespace labelUtility
 {
 
 
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
+    using System;
+    using System.Collections;
+    using System.Collections.Generic;
+    using UnityEditor;
+    using UnityEngine;
 
-[CustomPropertyDrawer(typeof(LabelSet))]
-public class LabelSetDrawer : PropertyDrawer
-{
-    #region Config
-
-    private float LineSpan = 2;
-    private float LineHeight = 16;
-    private float ButtonSpan = 4;
-    private float ButtonHeight = 32;
-
-    private LabelSet Instance;
-    private SerializedProperty Name;
-    private SerializedProperty LabelScriptPath;
-    private SerializedProperty LabelScriptName;
-    private SerializedProperty LabePrefix;
-    private SerializedProperty LabelScript;
-    private SerializedProperty ComponentScriptPath;
-    private SerializedProperty ComponentScriptName;
-    private SerializedProperty ComponentPrefix;
-    private SerializedProperty NameExcludeString;
-    private SerializedProperty RegistString;
-    //private SerializedProperty RegistPrefix;
-    //    private SerializedProperty RegistSuffix;
-    private SerializedProperty RegistExtraLines;
-    private SerializedProperty ComponentScript;
-    private SerializedProperty Languages;
-    private SerializedProperty Prefabs;
-    private SerializedProperty ComponentPurviews;
-    
-    #endregion
-
-    public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
+    [CustomPropertyDrawer(typeof(LabelSet))]
+    public class LabelSetDrawer : PropertyDrawer
     {
-        Instance = (LabelSet) InstanceUtility.GetObject(fieldInfo, property);
+        #region Config
 
-        return Instance.TotalHeight;
-    }
+        private float LineSpan = 2;
+        private float LineHeight = 16;
+        private float ButtonSpan = 4;
+        private float ButtonHeight = 32;
 
-    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
-    {
-        Instance = (LabelSet) InstanceUtility.GetObject(fieldInfo, property);
-        Name = property.FindPropertyRelative("Name");
-        LabelScriptPath = property.FindPropertyRelative("LabelScriptPath");
-        LabelScriptName = property.FindPropertyRelative("LabelScriptName");
-        LabePrefix = property.FindPropertyRelative("LabePrefix");
-        LabelScript = property.FindPropertyRelative("LabelScript");
-        ComponentScriptPath = property.FindPropertyRelative("ComponentScriptPath");
-        ComponentScriptName = property.FindPropertyRelative("ComponentScriptName");
-        ComponentPrefix = property.FindPropertyRelative("ComponentPrefix");
-        NameExcludeString = property.FindPropertyRelative("NameExcludeString");
+        private LabelSet Instance;
+        private SerializedProperty Name;
+        private SerializedProperty UtilityType;
+        private SerializedProperty LabelScriptPath;
+        private SerializedProperty LabelScriptName;
+        private SerializedProperty LabePrefix;
+        private SerializedProperty LabelScript;
+        private SerializedProperty ComponentScriptPath;
+        private SerializedProperty ComponentScriptName;
+        private SerializedProperty DerivedString;
+        private SerializedProperty RegistMethodString;
+        private SerializedProperty ComponentPrefix;
+        private SerializedProperty NameExcludeString;
+        private SerializedProperty RegistString;
+        private SerializedProperty RegistExtraLines;
+        private SerializedProperty ComponentScript;
+        private SerializedProperty Languages;
+        private SerializedProperty Prefabs;
+        private SerializedProperty Types;
+        private SerializedProperty RegistTargets;
+
+        private bool RegistTargetsChangeFlag;
+        private List<RegistTarget> registTargets = new List<RegistTarget>();
+
+        #endregion
+
+        public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
+        {
+            Instance = (LabelSet) InstanceUtility.GetObject(fieldInfo, property);
+
+            return Instance.TotalHeight;
+        }
+
+        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
+        {
+            Instance = (LabelSet) InstanceUtility.GetObject(fieldInfo, property);
+            Name = property.FindPropertyRelative("Name");
+            UtilityType = property.FindPropertyRelative("UtilityType");
+            LabelScriptPath = property.FindPropertyRelative("LabelScriptPath");
+            LabelScriptName = property.FindPropertyRelative("LabelScriptName");
+            LabePrefix = property.FindPropertyRelative("LabePrefix");
+            LabelScript = property.FindPropertyRelative("LabelScript");
+            ComponentScriptPath = property.FindPropertyRelative("ComponentScriptPath");
+            ComponentScriptName = property.FindPropertyRelative("ComponentScriptName");
+            DerivedString = property.FindPropertyRelative("DerivedString");
+            RegistMethodString = property.FindPropertyRelative("RegistMethodString");
+
+            ComponentPrefix = property.FindPropertyRelative("ComponentPrefix");
+            NameExcludeString = property.FindPropertyRelative("NameExcludeString");
 
             RegistString = property.FindPropertyRelative("RegistString");
-        //RegistPrefix = property.FindPropertyRelative("RegistPrefix");
-        //RegistSuffix = property.FindPropertyRelative("RegistSuffix");
-        RegistExtraLines = property.FindPropertyRelative("RegistExtraLines");
-        ComponentScript = property.FindPropertyRelative("ComponentScript");
-        Languages = property.FindPropertyRelative("Languages");
-        Prefabs = property.FindPropertyRelative("Prefabs");
-        ComponentPurviews = property.FindPropertyRelative("ComponentPurviews");
+            RegistExtraLines = property.FindPropertyRelative("RegistExtraLines");
+            ComponentScript = property.FindPropertyRelative("ComponentScript");
+            Languages = property.FindPropertyRelative("Languages");
+            Prefabs = property.FindPropertyRelative("Prefabs");
+            Types = property.FindPropertyRelative("RegistTypes");
+            RegistTargets = property.FindPropertyRelative("RegistTargets");
+
+            if (RegistTargetsChangeFlag)
+            {
+                if (Instance.RegistTargets == registTargets)
+                {
+                    RegistTargetsChangeFlag = false;
+                }
+                else
+                {
+                    Instance.RegistTargets = registTargets;
+                }
+            }
+
+            float originY = position.y;
+
+            position.height = LineHeight;
+            Instance.FoldOut = EditorGUI.Foldout(position, Instance.FoldOut, new GUIContent(Instance.Name));
+            position.y += LineHeight + LineSpan;
+
+            if (Instance.FoldOut)
+            {
+                EditorGUI.indentLevel++;
+                position = DrawProperty(position, Name);
+                position = DrawProperty(position, UtilityType);
+
+                bool drawRegistArea = Instance.UtilityType == labelUtility.UtilityType.Regist;
+                bool drawXmlArea = Instance.UtilityType == labelUtility.UtilityType.XmlLabel;
+                bool drawLabelArea = Instance.UtilityType == labelUtility.UtilityType.Regist || Instance.UtilityType == labelUtility.UtilityType.XmlLabel || Instance.UtilityType == labelUtility.UtilityType.PrefabLabel;
+
+                if (drawLabelArea)
+                {
+                    if (Instance.LabelScript == null)
+                    {
+                        position = DrawProperty(position, LabelScriptPath);
+                        position = DrawProperty(position, LabelScriptName);
+                        position = DrawProperty(position, LabePrefix);
+                    }
+                    position = DrawProperty(position, LabelScript);
+                }
 
+                if (drawRegistArea)
+                {
+                    if (Instance.ComponentScript == null)
+                    {
+                        position = DrawProperty(position, ComponentScriptPath);
+                        position = DrawProperty(position, ComponentScriptName);
+                        position = DrawProperty(position, DerivedString);
+                        position = DrawProperty(position, RegistMethodString);
+                    }
+                    position = DrawProperty(position, ComponentScript);
 
-        float originY = position.y;
+                    position = DrawProperty(position, ComponentPrefix);
+                    position = DrawProperty(position, NameExcludeString);
+                    position = DrawProperty(position, RegistString);
+                    position = DrawPropertys(position, RegistExtraLines, LineHeight + LineSpan);
+                }
 
-        position.height = LineHeight;
-        Instance.FoldOut = EditorGUI.Foldout(position, Instance.FoldOut, new GUIContent(Instance.Name));
-        position.y += LineHeight + LineSpan;
+                if (drawXmlArea)
+                {
+                    position = DrawPropertys(position, Languages, LineHeight + LineSpan);
+                }
+                else if (drawLabelArea)
+                {
+                    EditorGUI.BeginChangeCheck();
+                    position = DrawPropertys(position, Prefabs, LineHeight + LineSpan);
+                    position = DrawButton(position, "Refresh", () => { registTargets = RefreshRegistTargets(); }, LineHeight);
+                    if (EditorGUI.EndChangeCheck())
+                    {
+                        registTargets = RefreshRegistTargets();
+                    }
+                }
 
-        if (Instance.FoldOut)
+                if (drawRegistArea)
+                {
+                    if (Instance.LabelScript == null && Instance.ComponentScript == null)
+                    {
+                        position = DrawButton(position, "Create And Regist", () =>
+                        {
+                            LabelUtility.CreateLabelScript(Instance, false, true);
+                            LabelUtility.CreateComponentScript(Instance, false, true);
+                        });
+                    }
+
+                    if (Instance.LabelScript == null)
+                    {
+                        position = DrawButton(position, "Create Label Script", () => { LabelUtility.CreateLabelScript(Instance); });
+                    }
+                    if (Instance.ComponentScript == null)
+                    {
+                        position = DrawButton(position, "Create Component Script", () => { LabelUtility.CreateComponentScript(Instance); });
+                    }
+                }
+                else if (drawLabelArea)
+                {
+                    if (Instance.LabelScript == null)
+                    {
+                        position = DrawButton(position, "Create Label Script", () => { LabelUtility.CreateLabelScript(Instance); });
+                    }
+                }
+
+                if (drawRegistArea)
+                {
+                    EditorGUI.BeginChangeCheck();
+                    position = DrawPropertys(position, Types, LineHeight + LineSpan);
+                    if (EditorGUI.EndChangeCheck())
+                    {
+                        registTargets = RefreshRegistTargets();
+                    }
+                    position = DrawPropertys(position, RegistTargets, (LineHeight + LineSpan)*6);
+                    position = DrawButton(position, "Create Components From Prefab", () => { LabelUtility.CreateComponentsFromPrefab(Instance); });
+                }
+
+                if (drawXmlArea)
+                {
+                    position = DrawButton(position, "Create Label From LanguageXml", () => { LabelUtility.CreateLabelFromLanguageXml(Instance); }); //todo Ôö¼Ó
+                }
+                else if (drawLabelArea)
+                {
+                    position = DrawButton(position, "Create Label From Prefab", () => { LabelUtility.CreateLabelFromPrefab(Instance); });
+                }
+            }
+
+            Instance.TotalHeight = position.y - originY;
+        }
+
+        private List<RegistTarget> RefreshRegistTargets()
         {
-            EditorGUI.indentLevel++;
-            position = DrawProperty(position, Name);
-            position = DrawProperty(position, LabelScriptPath);
-            position = DrawProperty(position, LabelScriptName);
-            position = DrawProperty(position, LabePrefix);
-            position = DrawProperty(position, LabelScript);
-            position = DrawProperty(position, ComponentScriptPath);
-            position = DrawProperty(position, ComponentScriptName);
-            position = DrawProperty(position, ComponentPrefix);
-            position = DrawProperty(position, NameExcludeString);
-            position = DrawProperty(position, RegistString);
-            //    position = DrawProperty(position, RegistPrefix);
-            //position = DrawProperty(position, RegistSuffix);
-            position = DrawPropertys(position, RegistExtraLines);
-            position = DrawProperty(position, ComponentScript);
-            position = DrawPropertys(position, Languages);
-            position = DrawPropertys(position, Prefabs);
-            position = DrawButton(position, "Create Label Script", () => { LabelUtility.CreateLabelScript(Instance); });
-            position = DrawButton(position, "Create Component Script", () => { LabelUtility.CreateComponentScript(Instance); });
-            position = DrawButton(position, "Create Label From Prefab", () => { LabelUtility.CreateLabelFromPrefab(Instance); });
-            position = DrawButton(position, "Create Label From LanguageXml", () => { LabelUtility.CreateLabelFromLanguageXml(Instance); }); //todo Ôö¼Ó
-            position = DrawPropertys(position, ComponentPurviews);
-            position = DrawButton(position, "Create Components From Prefab", () => { LabelUtility.CreateComponentsFromPrefab(Instance); });
+            RegistTargetsChangeFlag = true;
+            List<GameObject> prefabs = new List<GameObject>();
+            for (int i = 0; i < Prefabs.arraySize; i++)
+            {
+                UnityEngine.Object obj = Prefabs.GetArrayElementAtIndex(i).objectReferenceValue;
+                if (obj == null) continue;
+                GameObject go = (GameObject) obj;
+                if (prefabs.Contains(go)) continue;
+                prefabs.Add(go);
+            }
+            List<ComponentType> componentTypes = new List<ComponentType>();
+            for (int i = 0; i < Types.arraySize; i++)
+            {
+                ComponentType componentType = (ComponentType) Types.GetArrayElementAtIndex(i).enumValueIndex;
+                if (componentType == ComponentType.None) continue;
+                if (componentTypes.Contains(componentType)) continue;
+                componentTypes.Add(componentType);
+            }
+            List<Type> types = GetTypes(componentTypes);
+            List<RegistTarget> registTargets = new List<RegistTarget>();
+            for (int i = 0; i < types.Count; i++)
+            {
+                foreach (var prefab in prefabs)
+                {
+                    if (prefab == null) continue;
+                    foreach (var transform in prefab.GetComponentsInChildren<Transform>(true))
+                    {
+                        Component component = transform.GetComponent(types[i]);
+                        if (component == null) continue;
+                        RegistTarget registTarget = GetRegistTarget(transform, componentTypes[i]);
+                        if (registTarget == null)
+                        {
+                            registTarget = new RegistTarget();
+                            registTarget.Transform = transform;
+                            registTarget.Type = componentTypes[i];
+                            registTarget.Name = string.IsNullOrEmpty(Instance.NameExcludeString) ? $"{transform.name}" : $"{transform.name.Replace(Instance.NameExcludeString, "")}";
+                        }
+                        registTargets.Add(registTarget);
+                    }
+                }
+            }
+            //foreach (var registTarget in registTargets)
+            //{
+            //    Debug.Log($"{registTarget.Type} {registTarget.Name}");
+            //}
+            registTargets.AddRange(GetForceRegistTargets());
+            return registTargets;
         }
 
-        Instance.TotalHeight = position.y - originY;
-    }
+        private RegistTarget GetRegistTarget(Transform transform, ComponentType type)
+        {
+            foreach (var registTarget in Instance.RegistTargets)
+            {
+                if (registTarget.Transform == transform && registTarget.Type == type)
+                {
+                    return registTarget;
+                }
+            }
+            return null;
+        }
 
-    private Rect DrawButton(Rect position, string name, Action OnClick)
-    {
-        Rect contentPosition = position;
-        contentPosition.height = ButtonHeight;
-        if (GUI.Button(contentPosition, name))
+        private List<RegistTarget> GetForceRegistTargets()
         {
-            OnClick.Invoke();
+            List<RegistTarget> tempRegistTargets = new List<RegistTarget>();
+            foreach (var registTarget in Instance.RegistTargets)
+            {
+                if (registTarget.Force)
+                {
+                    tempRegistTargets.Add(registTarget);
+                }
+            }
+            return tempRegistTargets;
         }
-        position.y += ButtonHeight + ButtonSpan;
-        return position;
-    }
 
-    private Rect DrawProperty(Rect position, SerializedProperty property)
-    {
-        Rect contentPosition = position;
-        contentPosition.height = LineHeight;
-        contentPosition = EditorGUI.PrefixLabel(contentPosition, new GUIContent(property.displayName));
-        EditorGUI.PropertyField(contentPosition, property, GUIContent.none);
-        position.y += LineHeight + LineSpan;
-        return position;
-    }
+        private List<Type> GetTypes(List<ComponentType> componentTypes)
+        {
+            List<Type> types = new List<Type>();
+            foreach (var componentType in componentTypes)
+            {
+                types.Add(LabelUtility.GetType(componentType));
+            }
+            return types;
+        }
 
-    private Rect DrawPropertys(Rect position, SerializedProperty property)
-    {
-        Rect contentPosition = position;
-        contentPosition.height = LineHeight;
-        contentPosition = EditorGUI.PrefixLabel(contentPosition, new GUIContent(property.displayName));
-        EditorGUI.PropertyField(contentPosition, property, GUIContent.none, true);
-        if (property.isExpanded)
+        private Rect DrawButton(Rect position, string name, Action OnClick, float? buttonHeight = null)
         {
-            position.y += (LineHeight + LineSpan)*(property.arraySize + 2);
+            Rect contentPosition = position;
+            contentPosition.height = buttonHeight ?? ButtonHeight;
+            if (GUI.Button(contentPosition, name))
+            {
+                OnClick.Invoke();
+            }
+            position.y += ButtonHeight + ButtonSpan;
+            return position;
         }
-        else
+
+        private Rect DrawProperty(Rect position, SerializedProperty property)
         {
+            Rect contentPosition = position;
+            contentPosition.height = LineHeight;
+            contentPosition = EditorGUI.PrefixLabel(contentPosition, new GUIContent(property.displayName));
+            EditorGUI.PropertyField(contentPosition, property, GUIContent.none);
             position.y += LineHeight + LineSpan;
+            return position;
+        }
+
+        private Rect DrawPropertys(Rect position, SerializedProperty property, float itemHeight)
+        {
+            Rect contentPosition = position;
+            contentPosition.height = LineHeight;
+            contentPosition = EditorGUI.PrefixLabel(contentPosition, new GUIContent(property.displayName));
+            EditorGUI.PropertyField(contentPosition, property, GUIContent.none, true);
+            if (property.isExpanded)
+            {
+                position.y += itemHeight * property.arraySize + (LineHeight + LineSpan)*2;
+            }
+            else
+            {
+                position.y += LineHeight + LineSpan;
+            }
+            return position;
         }
-        return position;
     }
-}
 
 
 }

+ 60 - 56
Assets/Tookits/LabelUtility/Editor/LabelUtilityWindow.cs

@@ -2,79 +2,83 @@ namespace labelUtility
 {
 
 
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text.RegularExpressions;
-using UnityEditor;
-using UnityEngine;
-
-public class LabelUtilityWindow : EditorWindow
-{
-    #region Config
+    using System;
+    using System.Collections;
+    using System.Collections.Generic;
+    using System.IO;
+    using System.Linq;
+    using System.Text.RegularExpressions;
+    using UnityEditor;
+    using UnityEngine;
+
+    public class LabelUtilityWindow : EditorWindow
+    {
+        #region Config
 
         protected Vector2 ScrollPosition;
-    protected LabelUtility Instance;
+        protected LabelUtility Instance;
 
-    protected SerializedProperty LabelSets;
+        protected SerializedProperty LabelSets;
+        protected SerializedProperty DllNames;
+        protected SerializedProperty EventStrings;
+        
+        protected SerializedObject SerializedObject;
 
-    protected SerializedObject SerializedObject;
+        #endregion
 
-    #endregion
+        [MenuItem("DashGame/LabelUtility")]
+        protected static void ShowWindow()
+        {
+            Type inspectorType = Type.GetType("UnityEditor.InspectorWindow,UnityEditor.dll");
 
-    [MenuItem("DashGame/LabelUtility")]
-    protected static void ShowWindow()
-    {
-        Type inspectorType = Type.GetType("UnityEditor.InspectorWindow,UnityEditor.dll");
+            LabelUtilityWindow window = GetWindow<LabelUtilityWindow>(inspectorType);
 
-        LabelUtilityWindow window = GetWindow<LabelUtilityWindow>(inspectorType);
+            window.titleContent = new GUIContent("LabelUtility");
+            window.Show();
+        }
 
-        window.titleContent = new GUIContent("LabelUtility");
-        window.Show();
-    }
+        private void OnEnable()
+        {
+            Instance = InstanceManager.SearchInstance<LabelUtility>();
 
-    private void OnEnable()
-    {
-        Instance = InstanceManager.SearchInstance<LabelUtility>();
-   
-        SerializedObject = new SerializedObject(Instance);
+            SerializedObject = new SerializedObject(Instance);
 
-        LabelSets = SerializedObject.FindProperty("LabelSets");
-    }
+            LabelSets = SerializedObject.FindProperty("LabelSets");
+            DllNames = SerializedObject.FindProperty("DllNames");
+            EventStrings = SerializedObject.FindProperty("EventStrings");
+            
+        }
 
-    private void OnGUI()
-    {
-        SerializedObject.Update();
+        private void OnGUI()
+        {
+            SerializedObject.Update();
 
             ScrollPosition = EditorGUILayout.BeginScrollView(ScrollPosition);
-        EditorGUILayout.PropertyField(LabelSets, new GUIContent("LabelSets"), true);
-
-        //if (GUILayout.Button("CreateLabelScript"))
-        //{
-        //    LabelUtility.CreateLabelScript(Instance.LabelSets[0]);
-        //}
-
-        //if (GUILayout.Button("CreateComponentScript"))
-        //{
-        //    LabelUtility.CreateComponentScript(Instance.LabelSets[0]);
-        //}
 
-        //if (GUILayout.Button("CreateLabelFromPrefab"))
-        //{
-        //    LabelUtility.CreateLabelFromPrefab(Instance.LabelSets[0]);
-        //}
-
-        //if (GUILayout.Button("CreateComponentsFromPrefab"))
-        //{
-        //    LabelUtility.CreateComponentsFromPrefab(Instance.LabelSets[0], InitPurview.Text, InitPurview.Button, InitPurview.SpriteRenderer);
-        //}
+            if (!Instance.DllNames.Valid())
+            {
+                Instance.DllNames = new List<string>();
+                Instance.DllNames.Add("UnityEngine");
+                Instance.DllNames.Add("UnityEngine.UI");
+            }
+            if (!Instance.EventStrings.Valid())
+            {
+                Instance.EventStrings = new List<ComponentEventString>();
+                ComponentEventString eventString = new ComponentEventString();
+                eventString.ComponentType = ComponentType.Button;
+                eventString.Strings = new List<string>();
+                eventString.Strings.Add("On#NEWNAMEClick");
+                Instance.EventStrings.Add(eventString);
+            }
+            EditorGUILayout.PropertyField(DllNames, new GUIContent("DllNames"), true);
+            EditorGUILayout.PropertyField(EventStrings, new GUIContent("EventStrings"), true);
+            EditorGUILayout.PropertyField(LabelSets, new GUIContent("LabelSets"), true);
 
             EditorGUILayout.EndScrollView();
-        SerializedObject.ApplyModifiedProperties();
+
+            SerializedObject.ApplyModifiedProperties();
+        }
     }
-}
 
 
 }

+ 3 - 1
Assets/Tookits/LabelUtility/Editor/InstanceManager.cs → Assets/Tookits/LabelUtility/InstanceManager.cs

@@ -2,7 +2,8 @@ namespace labelUtility
 {
 
 
-using System.Collections.Generic;
+#if UNITY_EDITOR
+    using System.Collections.Generic;
 
     using UnityEngine;
     using UnityEditor;
@@ -32,6 +33,7 @@ public class InstanceManager
         return Directory.GetFiles(Application.dataPath, pattern, SearchOption.AllDirectories);
     }
 }
+#endif
 
 
 }

+ 0 - 0
Assets/Tookits/LabelUtility/Editor/InstanceManager.cs.meta → Assets/Tookits/LabelUtility/InstanceManager.cs.meta


+ 230 - 107
Assets/Tookits/LabelUtility/LabelUtility.cs

@@ -18,10 +18,29 @@ namespace labelUtility
     using UnityEngine.UI;
 
     [Serializable]
+    public class RegistTarget
+    {
+        public string Name;
+        public bool Force;
+        public bool Ignore;
+        public Transform Transform;
+        public ComponentType Type;
+    }
+
+    [Serializable]
+    public class ComponentEventString
+    {
+        public ComponentType ComponentType;
+        public List<string> Strings;
+    }
+
+    [Serializable]
     public class LabelSet //todo 更新
     {
         public string Name;
 
+        public UtilityType UtilityType;
+
         public string LabelScriptPath;
         public string LabelScriptName;
         public string LabePrefix = "public static string";
@@ -29,10 +48,10 @@ namespace labelUtility
 
         public string ComponentScriptPath;
         public string ComponentScriptName;
+        public string DerivedString;
+        public string RegistMethodString;
         public string ComponentPrefix = "private";
         public string NameExcludeString;
-        //public string RegistPrefix;
-        //public string RegistSuffix;
         public string RegistString;
         public List<string> RegistExtraLines;
         public TextAsset ComponentScript;
@@ -42,11 +61,14 @@ namespace labelUtility
 
         public bool FoldOut;
         public float TotalHeight;
-        public List<ComponentPurview> ComponentPurviews = new List<ComponentPurview>();
+        public List<ComponentType> RegistTypes = new List<ComponentType>();
+        public List<RegistTarget> RegistTargets = new List<RegistTarget>();
     }
 
-    public enum ComponentPurview //todo 更新
+    [Serializable]
+    public enum ComponentType //todo 更新
     {
+        None,
         Text,
         Slider,
         Image,
@@ -58,41 +80,126 @@ namespace labelUtility
         VirtualScrollRectPlus,
     }
 
+    public enum UtilityType
+    {
+        XmlLabel,
+        PrefabLabel,
+        Regist,
+    }
+
     public class LabelUtility : MonoBehaviour
     {
         #region Config
 
+        public List<string> DllNames;
+        public List<ComponentEventString> EventStrings;
         public List<LabelSet> LabelSets;
 
         public static string StartMark = "//StartMark-Used by LabelUtility-Do not remove"; //todo 更新
         public static string EndMark = "//EndMark-Used by LabelUtility-Do not remove"; //todo 更新
         public static string RegistStartMark = "//RegistStartMark-Used by LabelUtility-Do not remove"; //todo 更新
         public static string RegistEndMark = "//RegistEndMark-Used by LabelUtility-Do not remove"; //todo 更新
+        public static string EventStartMark = "//EventStartMark-Used by LabelUtility-Do not remove"; //todo 更新
+        public static string EventEndMark = "//EventEndMark-Used by LabelUtility-Do not remove"; //todo 更新
         public static string Prefix = "public static string ";
 
         #endregion
 
-        public static void CreateLabelScript(LabelSet labelSet)
+        public static void CreateLabelScript(LabelSet labelSet, bool showWarning = true, bool auto = false)
         {
-            if (!EditorUtility.DisplayDialog("注意", "新建LabelScript?", "确定", "取消"))
+            if (showWarning)
             {
-                return;
+                if (!EditorUtility.DisplayDialog("注意", "新建LabelScript?", "确定", "取消"))
+                {
+                    return;
+                }
+            }
+
+            if (!auto)
+            {
+                auto = EditorUtility.DisplayDialog("提示", "是否自动提取标签", "确定", "取消");
+            }
+
+            string scriptContent = "";
+            foreach (var dllName in InstanceManager.SearchInstance<LabelUtility>().DllNames)
+            {
+                scriptContent += $"using {dllName};\r\n";
             }
+            scriptContent += "\r\n";
+            scriptContent += $"public class {labelSet.LabelScriptName}";
+            scriptContent += "\r\n";
+            scriptContent += $"{{\r\n\t#region Config\r\n\r\n\t{StartMark}\r\n\t{EndMark}\r\n\r\n\t#endregion\r\n}}";
+
+            labelSet.LabelScript = CreateScript(labelSet.LabelScriptName, labelSet.LabelScriptPath, scriptContent);
 
-            labelSet.LabelScript = CreateScript(labelSet.LabelScriptName, labelSet.LabelScriptPath);
+            if (auto)
+            {
+                if (labelSet.UtilityType == UtilityType.XmlLabel)
+                {
+                    CreateLabelFromLanguageXml(labelSet, false);
+                }
+                else if (labelSet.UtilityType == UtilityType.Regist || labelSet.UtilityType == UtilityType.PrefabLabel)
+                {
+                    CreateLabelFromPrefab(labelSet, false);
+                }
+            }
         }
 
-        public static void CreateComponentScript(LabelSet labelSet)
+        public static void CreateComponentScript(LabelSet labelSet, bool showWarning = true, bool regist = false)
         {
-            if (!EditorUtility.DisplayDialog("注意", "新建ComponentScript?", "确定", "取消"))
+            if (showWarning)
             {
-                return;
+                if (!EditorUtility.DisplayDialog("注意", "新建ComponentScript?", "确定", "取消"))
+                {
+                    return;
+                }
+            }
+
+            if (!regist)
+            {
+                regist = EditorUtility.DisplayDialog("提示", "是否自动注册", "确定", "取消");
             }
 
-            labelSet.ComponentScript = CreateScript(labelSet.ComponentScriptName, labelSet.ComponentScriptPath);
+            string scriptContent = "";
+            foreach (var dllName in InstanceManager.SearchInstance<LabelUtility>().DllNames)
+            {
+                scriptContent += $"using {dllName};\r\n";
+            }
+            scriptContent += "\r\n";
+            scriptContent += $"public class {labelSet.ComponentScriptName}";
+            if (string.IsNullOrEmpty(labelSet.DerivedString))
+            {
+                scriptContent += "\r\n";
+            }
+            else
+            {
+                scriptContent += $" : {labelSet.DerivedString}\r\n";
+            }
+            scriptContent += $"{{\r\n\t#region Config\r\n\r\n\t{StartMark}\r\n\t{EndMark}\r\n\r\n\t#endregion\r\n";
+            scriptContent += "\r\n";
+            if (!string.IsNullOrEmpty(labelSet.RegistMethodString))
+            {
+                scriptContent += $"\t{labelSet.RegistMethodString}\r\n\t{{\r\n";
+                scriptContent += $"\t\t{RegistStartMark}\r\n";
+                scriptContent += $"\t\t{RegistEndMark}\r\n";
+                scriptContent += $"\t}}\r\n";
+            }
+
+            scriptContent += "\r\n";
+            scriptContent += $"\t{EventStartMark}\r\n";
+            scriptContent += $"\t{EventEndMark}\r\n";
+
+            scriptContent += $"}}";
+
+            labelSet.ComponentScript = CreateScript(labelSet.ComponentScriptName, labelSet.ComponentScriptPath, scriptContent);
+
+            if (regist)
+            {
+                CreateComponentsFromPrefab(labelSet, false);
+            }
         }
 
-        private static TextAsset CreateScript(string scriptName, string scriptPath)
+        private static TextAsset CreateScript(string scriptName, string scriptPath, string content)
         {
             string directory = scriptPath.TrimEnd('/', '\\') + "/";
 
@@ -117,20 +224,28 @@ namespace labelUtility
                 throw new Exception($"已经存在一个 {fullPath}");
             }
 
-            string scriptContent = $"public class {scriptName}\r\n{{\r\n\t#region Config\r\n\r\n\t{StartMark}\r\n\t{EndMark}\r\n\r\n\t#endregion\r\n}}";
-            File.WriteAllText(fullPath, scriptContent);
+            File.WriteAllText(fullPath, content);
             AssetDatabase.Refresh();
             return AssetDatabase.LoadAssetAtPath<TextAsset>(fullPath);
         }
 
 
-        public static void CreateLabelFromPrefab(LabelSet labelSet) //todo 更新
+        public static void CreateLabelFromPrefab(LabelSet labelSet, bool showWarning = true) //todo 更新
         {
-            if (!EditorUtility.DisplayDialog("注意", "重新生成Prefab Label?", "确定", "取消"))
+            if (labelSet.LabelScript == null)
             {
+                Debug.LogError("LabelScript is null");
                 return;
             }
 
+            if (showWarning)
+            {
+                if (!EditorUtility.DisplayDialog("注意", "重新生成Prefab Label?", "确定", "取消"))
+                {
+                    return;
+                }
+            }
+
             List<string> labels = new List<string>();
             List<Transform> transforms = GetAllTransformFromPrefab(labelSet.Prefabs);
             foreach (var transform in transforms)
@@ -140,13 +255,22 @@ namespace labelUtility
             InsertLineToScript(StartMark, EndMark, labelSet.LabelScript, labels);
         }
 
-        public static void CreateLabelFromLanguageXml(LabelSet labelSet) //todo 更新
+        public static void CreateLabelFromLanguageXml(LabelSet labelSet, bool showWarning = true) //todo 更新
         {
-            if (!EditorUtility.DisplayDialog("注意", "重新生成LanguageXml Label?", "确定", "取消"))
+            if (labelSet.LabelScript == null)
             {
+                Debug.LogError("LabelScript is null");
                 return;
             }
 
+            if (showWarning)
+            {
+                if (!EditorUtility.DisplayDialog("注意", "重新生成LanguageXml Label?", "确定", "取消"))
+                {
+                    return;
+                }
+            }
+
             List<string> labels = new List<string>();
             foreach (var language in labelSet.Languages)
             {
@@ -181,124 +305,123 @@ namespace labelUtility
         }
 
 
-        public static void CreateComponentsFromPrefab(LabelSet labelSet)  //todo 更新
+        public static Type GetType(ComponentType componentType)
         {
-            if (!EditorUtility.DisplayDialog("注意", "重新生成PrefabComponent?", "确定", "取消"))
+            Assembly assembly = Assembly.Load("UnityEngine.UI");
+            Type type = assembly.GetType($"UnityEngine.UI.{componentType}");
+            if (type == null)
             {
-                return;
+                assembly = Assembly.Load("UnityEngine");
+                type = assembly.GetType($"UnityEngine.{componentType}");
             }
-
-            List <string> typeNames = new List<string>();
-            foreach (var purview in labelSet.ComponentPurviews)
+            if (type == null)
             {
-                typeNames.Add(purview.ToString());
+                assembly = Assembly.Load("Assembly-CSharp");
+                type = assembly.GetType($"{componentType}");
             }
-            List <Transform> transforms = GetAllTransformFromPrefab(labelSet.Prefabs);
-            Dictionary<string, List<string>> namesDictionary = new Dictionary<string, List<string>>();
-            foreach (var name in typeNames)
+            return type;
+        }
+
+
+        public static void CreateComponentsFromPrefab(LabelSet labelSet, bool showWarning = true)  //todo 更新
+        {
+            if (labelSet.ComponentScript == null)
             {
-                namesDictionary.Add(name, new List<string>());
+                Debug.LogError("ComponentScript is null");
+                return;
             }
-            foreach (var kv in namesDictionary)
+
+            if (showWarning)
             {
-                Assembly assembly = Assembly.Load("UnityEngine.UI");
-                Type type = assembly.GetType($"UnityEngine.UI.{kv.Key}");
-                //Debug.Log($"UnityEngine.UI.{kv.Key}");
-                if (type == null)
-                {
-                    assembly = Assembly.Load("UnityEngine");
-                    type = assembly.GetType($"UnityEngine.{kv.Key}");
-                }
-                if (type == null)
-                {
-                    assembly = Assembly.Load("Assembly-CSharp");
-                    type = assembly.GetType($"{kv.Key}");
-                }
-                foreach (var transform in transforms)
+                if (!EditorUtility.DisplayDialog("注意", "重新生成PrefabComponent?", "确定", "取消"))
                 {
-                    if (transform.GetComponent(type) == null) continue;
-                    namesDictionary[kv.Key].Add(transform.name);
+                    return;
                 }
             }
-            List<string> names = new List<string>();
-            List<string> components = new List<string>();
+
+            List<string> defineStrings = new List<string>();
             List<string> registStrings = new List<string>();
+            List<string> eventStrings = new List<string>();
             registStrings.AddRange(labelSet.RegistExtraLines);
-            foreach (var kv in namesDictionary)
+            foreach (var registTarget in labelSet.RegistTargets)
             {
-                foreach (var name in kv.Value)
+                if (registTarget.Ignore) continue;
+                defineStrings.Add($"{labelSet.ComponentPrefix} {registTarget.Type} {registTarget.Transform.name};");
+                string registString = labelSet.RegistString.Replace("#NAME", registTarget.Transform.name).Replace("#TYPE", registTarget.Type.ToString()).Replace("#NEWNAME", registTarget.Name);
+                if (labelSet.LabelScript != null)
+                {
+                    registString = registString.Replace("#LABEL", labelSet.LabelScript.name);
+                }
+                registStrings.Add(registString);
+
+                foreach (var eventString in InstanceManager.SearchInstance<LabelUtility>().EventStrings)
                 {
-                    names.Add(name);
-                    string newName = string.IsNullOrEmpty(labelSet.NameExcludeString) ? name : name.Replace(labelSet.NameExcludeString, "");
-                    components.Add($"{labelSet.ComponentPrefix} {kv.Key} {newName};");
-                    registStrings.Add(labelSet.RegistString.Replace("#NAME", name).Replace("#TYPE", kv.Key).Replace("#NEWNAME", newName));
+                    if (eventString.ComponentType == registTarget.Type)
+                    {
+                        for (int i = 0; i < eventString.Strings.Count; i++)
+                        {
+                            eventStrings.Add($"{labelSet.ComponentPrefix} {eventString.Strings[i].Replace("#NEWNAME", registTarget.Name)}");
+                            eventStrings.Add("{");
+                            eventStrings.Add("}");
+                        }
+                    }
                 }
             }
-            //for (int i = 0; i < names.Count; i++)
-            //{
-            //    components.Add(names[i].Substring(names[i].IndexOf(' ') + 1));
-            //}
-            InsertLineToScript(StartMark, EndMark, labelSet.ComponentScript, components);
+            InsertLineToScript(StartMark, EndMark, labelSet.ComponentScript, defineStrings);
             InsertLineToScript(RegistStartMark, RegistEndMark, labelSet.ComponentScript, registStrings);
 
-            //List<string> names = new List<string>();
-            //List<string> textNames = new List<string>();
-            //List<string> sliderNames = new List<string>();
-            //List<string> imageNames = new List<string>();
-            //List<string> buttonNames = new List<string>();
-            //List<string> transformNames = new List<string>();
-            //List<string> rectTransformNames = new List<string>();
-            //List<string> spriteRendererNames = new List<string>();
-            //List<Transform> transforms = GetAllTransformFromPrefab(labelSet.Prefabs);
-            //foreach (var transform in transforms)
+            //List <string> typeNames = new List<string>();
+            //foreach (var purview in labelSet.RegistTypes)
             //{
-            //    if (labelSet.ComponentPurviews.Contains(ComponentPurview.Text) && transform.GetComponent<Text>() != null)
-            //    {
-            //        textNames.Add($"Text {transform.name}");
-            //    }
-            //    if (labelSet.ComponentPurviews.Contains(ComponentPurview.Slider) && transform.GetComponent<Slider>() != null)
-            //    {
-            //        sliderNames.Add($"Slider {transform.name}");
-            //    }
-            //    if (labelSet.ComponentPurviews.Contains(ComponentPurview.Image) && transform.GetComponent<Image>() != null)
-            //    {
-            //        sliderNames.Add($"Image {transform.name}");
-            //    }
-            //    if (labelSet.ComponentPurviews.Contains(ComponentPurview.Button) && transform.GetComponent<Button>() != null)
-            //    {
-            //        buttonNames.Add($"Button {transform.name}");
-            //    }
-            //    if (labelSet.ComponentPurviews.Contains(ComponentPurview.Transform) && transform.GetComponent<Transform>() != null)
+            //    typeNames.Add(purview.ToString());
+            //}
+            //List <Transform> transforms = GetAllTransformFromPrefab(labelSet.Prefabs);
+            //Dictionary<string, List<string>> namesDictionary = new Dictionary<string, List<string>>();
+            //foreach (var name in typeNames)
+            //{
+            //    namesDictionary.Add(name, new List<string>());
+            //}
+            //foreach (var kv in namesDictionary)
+            //{
+            //    Assembly assembly = Assembly.Load("UnityEngine.UI");
+            //    Type type = assembly.GetType($"UnityEngine.UI.{kv.Key}");
+            //    if (type == null)
             //    {
-            //        transformNames.Add($"Transform {transform.name}");
+            //        assembly = Assembly.Load("UnityEngine");
+            //        type = assembly.GetType($"UnityEngine.{kv.Key}");
             //    }
-            //    if (labelSet.ComponentPurviews.Contains(ComponentPurview.RectTransform) && transform.GetComponent<RectTransform>() != null)
+            //    if (type == null)
             //    {
-            //        rectTransformNames.Add($"RectTransform {transform.name}");
+            //        assembly = Assembly.Load("Assembly-CSharp");
+            //        type = assembly.GetType($"{kv.Key}");
             //    }
-            //    if (labelSet.ComponentPurviews.Contains(ComponentPurview.SpriteRenderer) && transform.GetComponent<SpriteRenderer>() != null)
+            //    foreach (var transform in transforms)
             //    {
-            //        spriteRendererNames.Add($"SpriteRenderer {transform.name}");
+            //        if (transform.GetComponent(type) == null) continue;
+            //        namesDictionary[kv.Key].Add(transform.name);
             //    }
             //}
-            //names.AddRange(textNames);
-            //names.AddRange(sliderNames);
-            //names.AddRange(imageNames);
-            //names.AddRange(buttonNames);
-            //names.AddRange(transformNames);
-            //names.AddRange(rectTransformNames);
-            //names.AddRange(spriteRendererNames);
+            //List<string> names = new List<string>();
             //List<string> components = new List<string>();
-            //for (int i = 0; i < names.Count; i++)
-            //{
-            //    string name = string.IsNullOrEmpty(labelSet.NameExcludeString) ? names[i] : names[i].Replace(labelSet.NameExcludeString, "");
-            //    components.Add($"{labelSet.ComponentPrefix} {name};");
-            //}
-            //for (int i = 0; i < names.Count; i++)
+            //List<string> registStrings = new List<string>();
+            //registStrings.AddRange(labelSet.RegistExtraLines);
+            //foreach (var kv in namesDictionary)
             //{
-            //    components.Add(names[i].Substring(names[i].IndexOf(' ') + 1));
+            //    foreach (var name in kv.Value)
+            //    {
+            //        names.Add(name);
+            //        string newName = string.IsNullOrEmpty(labelSet.NameExcludeString) ? name : name.Replace(labelSet.NameExcludeString, "");
+            //        components.Add($"{labelSet.ComponentPrefix} {kv.Key} {newName};");
+            //        string registString = labelSet.RegistString.Replace("#NAME", name).Replace("#TYPE", kv.Key).Replace("#NEWNAME", newName);
+            //        if (labelSet.LabelScript != null)
+            //        {
+            //            registString = registString.Replace("#LABEL", labelSet.LabelScript.name);
+            //        }
+            //        registStrings.Add(registString);
+            //    }
             //}
-            //InsertLineToScript(labelSet.ComponentScript, components);
+            //InsertLineToScript(StartMark, EndMark, labelSet.ComponentScript, components);
+            //InsertLineToScript(RegistStartMark, RegistEndMark, labelSet.ComponentScript, registStrings);
         }
 
         private static void InsertLineToScript(string startMark, string endMark, TextAsset textAsset, List<string> insertLines)

+ 108 - 34
Assets/Tookits/LabelUtility/LabelUtility.prefab

@@ -51,14 +51,25 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: c191ef3fc5b89274696e54e8d5314e1a, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  DllNames:
+  - UnityEngine
+  - UnityEngine.UI
+  - System.Collections.Generic
+  EventStrings:
+  - ComponentType: 4
+    Strings:
+    - On#NEWNAMEClick
   LabelSets:
   - Name: CanvasLabel
+    UtilityType: 1
     LabelScriptPath: 
     LabelScriptName: 
     LabePrefix: public static string
     LabelScript: {fileID: 11500000, guid: 1615e3353e063d443bf237fb8aade024, type: 3}
     ComponentScriptPath: 
     ComponentScriptName: 
+    DerivedString: 
+    RegistMethodString: 
     ComponentPrefix: 
     NameExcludeString: 
     RegistString: 
@@ -69,14 +80,42 @@ MonoBehaviour:
     - {fileID: 1948781497737682, guid: 8647d80b558fa724a84d05f9e6aee9bc, type: 2}
     FoldOut: 0
     TotalHeight: 18
-    ComponentPurviews: 
+    RegistTypes: 
+    RegistTargets:
+    - Name: Title
+      Force: 0
+      Ignore: 0
+      Transform: {fileID: 224977832684939848, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      Type: 1
+    - Name: Content
+      Force: 0
+      Ignore: 0
+      Transform: {fileID: 224190239401635906, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      Type: 1
+    - Name: Button
+      Force: 0
+      Ignore: 0
+      Transform: {fileID: 224527758619848776, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      Type: 4
+    - Name: Button
+      Force: 1
+      Ignore: 0
+      Transform: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      Type: 4
   - Name: LanguageLabel
+    UtilityType: 0
     LabelScriptPath: 
     LabelScriptName: 
     LabePrefix: public static string
     LabelScript: {fileID: 11500000, guid: 3420c8d0e7f483a46942a0adcfbee477, type: 3}
     ComponentScriptPath: 
     ComponentScriptName: 
+    DerivedString: 
+    RegistMethodString: 
     ComponentPrefix: 
     NameExcludeString: 
     RegistString: 
@@ -87,43 +126,78 @@ MonoBehaviour:
     Prefabs: []
     FoldOut: 0
     TotalHeight: 18
-    ComponentPurviews: 
-  - Name: "\u6807\u51C6\u6CE8\u518C"
-    LabelScriptPath: Assets\Script\Social
-    LabelScriptName: FashionShowHomePage
+    RegistTypes: 
+    RegistTargets:
+    - Name: Title
+      Force: 0
+      Ignore: 0
+      Transform: {fileID: 224977832684939848, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      Type: 1
+    - Name: Content
+      Force: 0
+      Ignore: 0
+      Transform: {fileID: 224190239401635906, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      Type: 1
+    - Name: Button
+      Force: 0
+      Ignore: 0
+      Transform: {fileID: 224527758619848776, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      Type: 4
+    - Name: Button
+      Force: 1
+      Ignore: 0
+      Transform: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      Type: 4
+  - Name: "\u6D4B\u8BD5"
+    UtilityType: 2
+    LabelScriptPath: Assets
+    LabelScriptName: TestLabel
     LabePrefix: public static string
-    LabelScript: {fileID: 11500000, guid: 84afe1ead5009a24fb5a645aef7ea54e, type: 3}
-    ComponentScriptPath: Assets\Script\Social
-    ComponentScriptName: FashionShowHomePage
-    ComponentPrefix: private static
-    NameExcludeString: Pi_
-    RegistString: '#NEWNAME = ResourceManager.Get<#TYPE>(CanvasLabel.#NAME);'
-    RegistExtraLines: []
-    ComponentScript: {fileID: 11500000, guid: 61545dcf531e73c4b8ceda481bd9c427, type: 3}
-    Languages:
-    - {fileID: 4900000, guid: 6bf784d003b5c104e94531afb827212a, type: 3}
-    Prefabs:
-    - {fileID: 1554867056471436, guid: d188b439f9f798d45b5d3a39f93f10b3, type: 2}
-    FoldOut: 0
-    TotalHeight: 18
-    ComponentPurviews: 000000000300000008000000
-  - Name: "Prefab\u6CE8\u518C"
-    LabelScriptPath: Assets\Script\Social
-    LabelScriptName: FashionShowCloseBoxLabel
-    LabePrefix: public static string
-    LabelScript: {fileID: 11500000, guid: f189d7b1e96a86d4a8d9a2f171af4625, type: 3}
-    ComponentScriptPath: Assets\Script\Social
-    ComponentScriptName: FashionShowCloseBox
-    ComponentPrefix: private static
+    LabelScript: {fileID: 11500000, guid: f7fb805300eb1a943a9198efb382841e, type: 3}
+    ComponentScriptPath: Assets
+    ComponentScriptName: TestScript
+    DerivedString: MonoBehaviour
+    RegistMethodString: private void Regist()
+    ComponentPrefix: private
     NameExcludeString: 
-    RegistString: '#NEWNAME = childDictionary[FashionShowCloseBoxLabel.#NAME].GetComponent<#TYPE>();'
+    RegistString: '#NAME = childDictionary[#LABEL.#NAME].GetComponent<#TYPE>();'
     RegistExtraLines:
     - Dictionary<string, Transform> childDictionary = new Dictionary<string, Transform>();
     - Auxiliary.CompileDic(transform, childDictionary);
-    ComponentScript: {fileID: 11500000, guid: 1fd8076ee2aa93a4fa6c17e7d4aafa5e, type: 3}
-    Languages: []
+    ComponentScript: {fileID: 11500000, guid: 12e87b20af07e454dbd88462d0bdcd72, type: 3}
+    Languages:
+    - {fileID: 4900000, guid: 6bf784d003b5c104e94531afb827212a, type: 3}
     Prefabs:
-    - {fileID: 1266546654056180, guid: 7f826c7f4c27c8d44afe9f47f9705a59, type: 2}
+    - {fileID: 1338839275615992, guid: c32731d4b49fbd146ae54a3978501d8c, type: 2}
     FoldOut: 1
-    TotalHeight: 612
-    ComponentPurviews: 0000000003000000
+    TotalHeight: 918
+    RegistTypes: 0100000004000000
+    RegistTargets:
+    - Name: Title
+      Force: 0
+      Ignore: 0
+      Transform: {fileID: 224977832684939848, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      Type: 1
+    - Name: Content
+      Force: 0
+      Ignore: 0
+      Transform: {fileID: 224190239401635906, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      Type: 1
+    - Name: Button
+      Force: 0
+      Ignore: 0
+      Transform: {fileID: 224527758619848776, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      Type: 4
+    - Name: Button
+      Force: 1
+      Ignore: 0
+      Transform: {fileID: 224597384089362468, guid: c32731d4b49fbd146ae54a3978501d8c,
+        type: 2}
+      Type: 4

+ 4 - 7
第五期.txt

@@ -1,12 +1,11 @@
-搭配秀音效
+22级有个空档
 
-私信Bug
+搭配秀功能音效
+
+搭配秀主页Drawcall
 
 LabelUtility
 {
-  自动添加命名空间
-  找不到标记自动添加一组
-  可以手动添加需要的组件(自动寻找组件修改为自动添加需要组件)
   将可以公用的字符串定义为全局静态变量
   如果有Button 自动注册addlistener 自动添加OnClick方法
         Text 自动添加多语言
@@ -18,8 +17,6 @@ ExcelUtility
   导出完成后的回调(导出了语言文档自动更新语言标签)
 }
 
-LTween 当前帧立即执行 延后一帧执行
-
 
 //关闭DebugMode 开启CatchException