refactor():重构编辑系统,不再需要添加额外的脚本作为可编辑的入口了
This commit is contained in:
@@ -13,7 +13,6 @@ GameObject:
|
|||||||
- component: {fileID: 3694179230033504797}
|
- component: {fileID: 3694179230033504797}
|
||||||
- component: {fileID: 470645613676258024}
|
- component: {fileID: 470645613676258024}
|
||||||
- component: {fileID: 8187785643586722023}
|
- component: {fileID: 8187785643586722023}
|
||||||
- component: {fileID: 7940149935342460565}
|
|
||||||
- component: {fileID: 5829756071943867929}
|
- component: {fileID: 5829756071943867929}
|
||||||
- component: {fileID: 3049630257319171134}
|
- component: {fileID: 3049630257319171134}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
@@ -136,18 +135,6 @@ BoxCollider:
|
|||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Size: {x: 1, y: 1, z: 1}
|
m_Size: {x: 1, y: 1, z: 1}
|
||||||
m_Center: {x: 0, y: 0, z: 0}
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
--- !u!114 &7940149935342460565
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 7739979277884825363}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 7986c88b8e1d4944832af56e23188597, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
--- !u!114 &5829756071943867929
|
--- !u!114 &5829756071943867929
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@@ -13,7 +13,6 @@ GameObject:
|
|||||||
- component: {fileID: 242555714111735108}
|
- component: {fileID: 242555714111735108}
|
||||||
- component: {fileID: 4435893386940746007}
|
- component: {fileID: 4435893386940746007}
|
||||||
- component: {fileID: 2552293626926492943}
|
- component: {fileID: 2552293626926492943}
|
||||||
- component: {fileID: 3427371979469557628}
|
|
||||||
- component: {fileID: 1157280543463811332}
|
- component: {fileID: 1157280543463811332}
|
||||||
- component: {fileID: 9140300362975493256}
|
- component: {fileID: 9140300362975493256}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
@@ -136,18 +135,6 @@ SphereCollider:
|
|||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Radius: 0.5
|
m_Radius: 0.5
|
||||||
m_Center: {x: 0, y: 0, z: 0}
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
--- !u!114 &3427371979469557628
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 7979385610396712053}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 7986c88b8e1d4944832af56e23188597, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
--- !u!114 &1157280543463811332
|
--- !u!114 &1157280543463811332
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@@ -12,7 +12,6 @@ GameObject:
|
|||||||
- component: {fileID: 8222817459474332972}
|
- component: {fileID: 8222817459474332972}
|
||||||
- component: {fileID: 8915067524543900667}
|
- component: {fileID: 8915067524543900667}
|
||||||
- component: {fileID: 2933073816800901446}
|
- component: {fileID: 2933073816800901446}
|
||||||
- component: {fileID: 2654927572387158689}
|
|
||||||
- component: {fileID: 162156210837205425}
|
- component: {fileID: 162156210837205425}
|
||||||
- component: {fileID: 4434834246038522293}
|
- component: {fileID: 4434834246038522293}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
@@ -108,18 +107,6 @@ BoxCollider:
|
|||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Size: {x: 1, y: 1, z: 1}
|
m_Size: {x: 1, y: 1, z: 1}
|
||||||
m_Center: {x: 0, y: 0, z: 0}
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
--- !u!114 &2654927572387158689
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2052340463965227198}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 7986c88b8e1d4944832af56e23188597, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
--- !u!114 &162156210837205425
|
--- !u!114 &162156210837205425
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@@ -12,7 +12,6 @@ GameObject:
|
|||||||
- component: {fileID: 1966939443082034528}
|
- component: {fileID: 1966939443082034528}
|
||||||
- component: {fileID: 1791426126632920350}
|
- component: {fileID: 1791426126632920350}
|
||||||
- component: {fileID: 6559594074799131378}
|
- component: {fileID: 6559594074799131378}
|
||||||
- component: {fileID: 2740601845815088892}
|
|
||||||
- component: {fileID: 605469399670797709}
|
- component: {fileID: 605469399670797709}
|
||||||
- component: {fileID: 6634784627554641663}
|
- component: {fileID: 6634784627554641663}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
@@ -108,18 +107,6 @@ BoxCollider:
|
|||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Size: {x: 1, y: 1, z: 1}
|
m_Size: {x: 1, y: 1, z: 1}
|
||||||
m_Center: {x: 0, y: 0, z: 0}
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
--- !u!114 &2740601845815088892
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2729643726423589850}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 7986c88b8e1d4944832af56e23188597, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
--- !u!114 &605469399670797709
|
--- !u!114 &605469399670797709
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -133,7 +120,6 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
Interactable: 1
|
Interactable: 1
|
||||||
isActive: 1
|
|
||||||
--- !u!114 &6634784627554641663
|
--- !u!114 &6634784627554641663
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@@ -43,7 +43,6 @@ GameObject:
|
|||||||
- component: {fileID: 7587903706495042174}
|
- component: {fileID: 7587903706495042174}
|
||||||
- component: {fileID: 9191155306757799119}
|
- component: {fileID: 9191155306757799119}
|
||||||
- component: {fileID: 8846970934275178021}
|
- component: {fileID: 8846970934275178021}
|
||||||
- component: {fileID: 1219148107627415208}
|
|
||||||
- component: {fileID: 8496958603087533895}
|
- component: {fileID: 8496958603087533895}
|
||||||
- component: {fileID: 7351527485767933101}
|
- component: {fileID: 7351527485767933101}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
@@ -140,18 +139,6 @@ BoxCollider:
|
|||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Size: {x: 1, y: 1, z: 1}
|
m_Size: {x: 1, y: 1, z: 1}
|
||||||
m_Center: {x: 0, y: 0, z: 0}
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
--- !u!114 &1219148107627415208
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 5873928673589519195}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 7986c88b8e1d4944832af56e23188597, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
--- !u!114 &8496958603087533895
|
--- !u!114 &8496958603087533895
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -183,3 +170,4 @@ MonoBehaviour:
|
|||||||
emitDirection: {x: 0, y: 0, z: 1}
|
emitDirection: {x: 0, y: 0, z: 1}
|
||||||
emitForce: 10
|
emitForce: 10
|
||||||
emitInterval: 1
|
emitInterval: 1
|
||||||
|
destroyDelay: 5
|
||||||
|
@@ -12,7 +12,6 @@ GameObject:
|
|||||||
- component: {fileID: 4763900636075465414}
|
- component: {fileID: 4763900636075465414}
|
||||||
- component: {fileID: 6839980979269427984}
|
- component: {fileID: 6839980979269427984}
|
||||||
- component: {fileID: 6900514999789347776}
|
- component: {fileID: 6900514999789347776}
|
||||||
- component: {fileID: 5480938290288266788}
|
|
||||||
- component: {fileID: 3969518804808817043}
|
- component: {fileID: 3969518804808817043}
|
||||||
- component: {fileID: 4936355834716623489}
|
- component: {fileID: 4936355834716623489}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
@@ -108,18 +107,6 @@ BoxCollider:
|
|||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Size: {x: 1, y: 1, z: 1}
|
m_Size: {x: 1, y: 1, z: 1}
|
||||||
m_Center: {x: 0, y: 0, z: 0}
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
--- !u!114 &5480938290288266788
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 6227019518059310355}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 7986c88b8e1d4944832af56e23188597, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
--- !u!114 &3969518804808817043
|
--- !u!114 &3969518804808817043
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
46
Assets/Prefab/Gameplay/Manager/EditableManager.prefab
Normal file
46
Assets/Prefab/Gameplay/Manager/EditableManager.prefab
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &5733440185495106210
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1741528481904243288}
|
||||||
|
- component: {fileID: 2771123290872083115}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: EditableManager
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &1741528481904243288
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5733440185495106210}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 1341.3049, y: 771.7224, z: 0.19054106}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &2771123290872083115
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5733440185495106210}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 9704373d6ec1409bb4e26e4b16324c40, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 580e72e098ea0074795102df8d1f812e
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -12,7 +12,6 @@ GameObject:
|
|||||||
- component: {fileID: 1875558020952416763}
|
- component: {fileID: 1875558020952416763}
|
||||||
- component: {fileID: 6958443043046651409}
|
- component: {fileID: 6958443043046651409}
|
||||||
- component: {fileID: 3036000835194628394}
|
- component: {fileID: 3036000835194628394}
|
||||||
- component: {fileID: 9057593411103083886}
|
|
||||||
- component: {fileID: 7384438008133576482}
|
- component: {fileID: 7384438008133576482}
|
||||||
- component: {fileID: 2187320556207737093}
|
- component: {fileID: 2187320556207737093}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
@@ -108,18 +107,6 @@ BoxCollider:
|
|||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Size: {x: 1, y: 1, z: 1}
|
m_Size: {x: 1, y: 1, z: 1}
|
||||||
m_Center: {x: 0, y: 0, z: 0}
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
--- !u!114 &9057593411103083886
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1079693037897703353}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 7986c88b8e1d4944832af56e23188597, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
--- !u!114 &7384438008133576482
|
--- !u!114 &7384438008133576482
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@@ -14,7 +14,6 @@ GameObject:
|
|||||||
- component: {fileID: 8785614081330407045}
|
- component: {fileID: 8785614081330407045}
|
||||||
- component: {fileID: 220912239936987690}
|
- component: {fileID: 220912239936987690}
|
||||||
- component: {fileID: -7803032184951374842}
|
- component: {fileID: -7803032184951374842}
|
||||||
- component: {fileID: 4542395966412092557}
|
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: PressurePlate
|
m_Name: PressurePlate
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -139,15 +138,3 @@ MonoBehaviour:
|
|||||||
m_Bits: 4294967295
|
m_Bits: 4294967295
|
||||||
plateSize: {x: 1.2, y: 0.4, z: 1.2}
|
plateSize: {x: 1.2, y: 0.4, z: 1.2}
|
||||||
plateOffset: {x: 0, y: 0.5, z: 0}
|
plateOffset: {x: 0, y: 0.5, z: 0}
|
||||||
--- !u!114 &4542395966412092557
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2191333364839819432}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 7986c88b8e1d4944832af56e23188597, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
|
@@ -1559,6 +1559,74 @@ PrefabInstance:
|
|||||||
m_AddedGameObjects: []
|
m_AddedGameObjects: []
|
||||||
m_AddedComponents: []
|
m_AddedComponents: []
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: b3e24e2df98d14e4ebc08cc68c071afa, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: b3e24e2df98d14e4ebc08cc68c071afa, type: 3}
|
||||||
|
--- !u!1001 &2706680471642920534
|
||||||
|
PrefabInstance:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TransformParent: {fileID: 0}
|
||||||
|
m_Modifications:
|
||||||
|
- target: {fileID: 1741528481904243288, guid: 580e72e098ea0074795102df8d1f812e,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalPosition.x
|
||||||
|
value: 1341.3049
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1741528481904243288, guid: 580e72e098ea0074795102df8d1f812e,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalPosition.y
|
||||||
|
value: 771.7224
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1741528481904243288, guid: 580e72e098ea0074795102df8d1f812e,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalPosition.z
|
||||||
|
value: 0.19054106
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1741528481904243288, guid: 580e72e098ea0074795102df8d1f812e,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.w
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1741528481904243288, guid: 580e72e098ea0074795102df8d1f812e,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1741528481904243288, guid: 580e72e098ea0074795102df8d1f812e,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1741528481904243288, guid: 580e72e098ea0074795102df8d1f812e,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalRotation.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1741528481904243288, guid: 580e72e098ea0074795102df8d1f812e,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1741528481904243288, guid: 580e72e098ea0074795102df8d1f812e,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1741528481904243288, guid: 580e72e098ea0074795102df8d1f812e,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5733440185495106210, guid: 580e72e098ea0074795102df8d1f812e,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_Name
|
||||||
|
value: EditableManager
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_RemovedGameObjects: []
|
||||||
|
m_AddedGameObjects: []
|
||||||
|
m_AddedComponents: []
|
||||||
|
m_SourcePrefab: {fileID: 100100000, guid: 580e72e098ea0074795102df8d1f812e, type: 3}
|
||||||
--- !u!1001 &7020889523296792185
|
--- !u!1001 &7020889523296792185
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -1704,6 +1772,7 @@ SceneRoots:
|
|||||||
- {fileID: 1279118200}
|
- {fileID: 1279118200}
|
||||||
- {fileID: 769057572}
|
- {fileID: 769057572}
|
||||||
- {fileID: 7233731901126413131}
|
- {fileID: 7233731901126413131}
|
||||||
|
- {fileID: 2706680471642920534}
|
||||||
- {fileID: 410087041}
|
- {fileID: 410087041}
|
||||||
- {fileID: 1274249804}
|
- {fileID: 1274249804}
|
||||||
- {fileID: 7020889523296792185}
|
- {fileID: 7020889523296792185}
|
||||||
|
@@ -4,7 +4,7 @@ using UnityEngine;
|
|||||||
using Script.Gameplay.Interface;
|
using Script.Gameplay.Interface;
|
||||||
using Script.Gameplay.Connect;
|
using Script.Gameplay.Connect;
|
||||||
|
|
||||||
namespace Script.Gameplay.Facility
|
namespace Script.Gameplay.Edit
|
||||||
{
|
{
|
||||||
public class ButtonInteractController : MonoBehaviour, IInteractable, IEditableComponent, IConnectable, ISignalSender
|
public class ButtonInteractController : MonoBehaviour, IInteractable, IEditableComponent, IConnectable, ISignalSender
|
||||||
{
|
{
|
@@ -1,7 +1,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Script.Gameplay.Interface;
|
using Script.Gameplay.Interface;
|
||||||
|
|
||||||
namespace Script.Gameplay.Facility
|
namespace Script.Gameplay.Edit
|
||||||
{
|
{
|
||||||
[RequireComponent(typeof(Collider))]
|
[RequireComponent(typeof(Collider))]
|
||||||
public class ColliderEditableController : MonoBehaviour, IEditableComponent
|
public class ColliderEditableController : MonoBehaviour, IEditableComponent
|
@@ -5,7 +5,7 @@ using UnityEngine;
|
|||||||
using Script.Gameplay.Interface;
|
using Script.Gameplay.Interface;
|
||||||
using Script.Gameplay.Connect;
|
using Script.Gameplay.Connect;
|
||||||
|
|
||||||
namespace Script.Gameplay.Facility
|
namespace Script.Gameplay.Edit
|
||||||
{
|
{
|
||||||
public class DoorInteractController : MonoBehaviour, IInteractable, IEditableComponent, IConnectable
|
public class DoorInteractController : MonoBehaviour, IInteractable, IEditableComponent, IConnectable
|
||||||
{
|
{
|
23
Assets/Script/Gameplay/Edit/EditableManager.cs
Normal file
23
Assets/Script/Gameplay/Edit/EditableManager.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using Core;
|
||||||
|
using UnityEngine;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Script.Gameplay.Interface;
|
||||||
|
|
||||||
|
namespace Script.Gameplay.Edit
|
||||||
|
{
|
||||||
|
public class EditableManager : MonoSingleton<EditableManager>
|
||||||
|
{
|
||||||
|
public static List<IEditableComponent> GetEditableComponents(GameObject target)
|
||||||
|
{
|
||||||
|
var components = new List<IEditableComponent>();
|
||||||
|
foreach (var mb in target.GetComponentsInChildren<MonoBehaviour>(true))
|
||||||
|
{
|
||||||
|
if (mb is IEditableComponent editableComponent)
|
||||||
|
{
|
||||||
|
components.Add(editableComponent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return components;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
3
Assets/Script/Gameplay/Edit/EditableManager.cs.meta
Normal file
3
Assets/Script/Gameplay/Edit/EditableManager.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9704373d6ec1409bb4e26e4b16324c40
|
||||||
|
timeCreated: 1761035435
|
@@ -4,7 +4,7 @@ using UnityEngine;
|
|||||||
using Script.Gameplay.Connect;
|
using Script.Gameplay.Connect;
|
||||||
using Script.Gameplay.Interface;
|
using Script.Gameplay.Interface;
|
||||||
|
|
||||||
namespace Script.Gameplay.Facility
|
namespace Script.Gameplay.Edit
|
||||||
{
|
{
|
||||||
public class EmitterController : MonoBehaviour, IEditableComponent, IConnectable
|
public class EmitterController : MonoBehaviour, IEditableComponent, IConnectable
|
||||||
{
|
{
|
@@ -1,7 +1,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Script.Gameplay.Interface;
|
using Script.Gameplay.Interface;
|
||||||
|
|
||||||
namespace Script.Gameplay.Facility
|
namespace Script.Gameplay.Edit
|
||||||
{
|
{
|
||||||
public abstract class InteractableBaseController : MonoBehaviour, IInteractable
|
public abstract class InteractableBaseController : MonoBehaviour, IInteractable
|
||||||
{
|
{
|
@@ -3,7 +3,7 @@ using UnityEngine;
|
|||||||
using Script.Gameplay.Interface;
|
using Script.Gameplay.Interface;
|
||||||
using Script.Gameplay.Connect;
|
using Script.Gameplay.Connect;
|
||||||
|
|
||||||
namespace Script.Gameplay.Facility
|
namespace Script.Gameplay.Edit
|
||||||
{
|
{
|
||||||
public class LeverInteractController : MonoBehaviour, IInteractable, IEditableComponent, IConnectable, ISignalSender
|
public class LeverInteractController : MonoBehaviour, IInteractable, IEditableComponent, IConnectable, ISignalSender
|
||||||
{
|
{
|
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Script.Gameplay.Connect;
|
using Script.Gameplay.Connect;
|
||||||
|
|
||||||
namespace Script.Gameplay.Facility
|
namespace Script.Gameplay.Edit
|
||||||
{
|
{
|
||||||
// 号码枚举类型
|
// 号码枚举类型
|
||||||
public enum NumberType
|
public enum NumberType
|
@@ -3,7 +3,7 @@ using UnityEngine;
|
|||||||
using Script.Gameplay.Interface;
|
using Script.Gameplay.Interface;
|
||||||
using Script.Gameplay.Connect;
|
using Script.Gameplay.Connect;
|
||||||
|
|
||||||
namespace Script.Gameplay.Facility
|
namespace Script.Gameplay.Edit
|
||||||
{
|
{
|
||||||
public class PressurePlateController : MonoBehaviour, IEditableComponent, IConnectable, ISignalSender
|
public class PressurePlateController : MonoBehaviour, IEditableComponent, IConnectable, ISignalSender
|
||||||
{
|
{
|
@@ -1,7 +1,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Script.Gameplay.Interface;
|
using Script.Gameplay.Interface;
|
||||||
|
|
||||||
namespace Script.Gameplay.Facility
|
namespace Script.Gameplay.Edit
|
||||||
{
|
{
|
||||||
[RequireComponent(typeof(Rigidbody))]
|
[RequireComponent(typeof(Rigidbody))]
|
||||||
public class RigidbodyEditableController : MonoBehaviour, IEditableComponent
|
public class RigidbodyEditableController : MonoBehaviour, IEditableComponent
|
@@ -1,44 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Script.Gameplay.Player;
|
|
||||||
using UnityEngine;
|
|
||||||
using Script.Gameplay.Interface;
|
|
||||||
|
|
||||||
namespace Script.Gameplay.Facility
|
|
||||||
{
|
|
||||||
public class FacilityEditableController : MonoBehaviour, IEditable
|
|
||||||
{
|
|
||||||
public void OnGazeEnter(PlayerEditController editor)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnGazeExit(PlayerEditController editor)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void BeginEdit()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void EndEdit()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<IEditableComponent> GetEditableComponents()
|
|
||||||
{
|
|
||||||
var components = new List<IEditableComponent>();
|
|
||||||
foreach (var mb in GetComponentsInChildren<MonoBehaviour>(true))
|
|
||||||
{
|
|
||||||
if (mb is IEditableComponent editableComponent)
|
|
||||||
{
|
|
||||||
components.Add(editableComponent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return components;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,3 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 7986c88b8e1d4944832af56e23188597
|
|
||||||
timeCreated: 1760664530
|
|
@@ -1,16 +1,16 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Script.Gameplay.Player;
|
using Script.Gameplay.Player;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Script.Gameplay.Facility;
|
// using Script.Gameplay.Facility;
|
||||||
|
|
||||||
namespace Script.Gameplay.Interface
|
namespace Script.Gameplay.Interface
|
||||||
{
|
{
|
||||||
public interface IEditable
|
// public interface IEditable
|
||||||
{
|
// {
|
||||||
void OnGazeEnter(PlayerEditController editor); // 玩家开始注视时触发
|
// void OnGazeEnter(PlayerEditController editor); // 玩家开始注视时触发
|
||||||
void OnGazeExit(PlayerEditController editor); // 玩家停止注视时触发
|
// void OnGazeExit(PlayerEditController editor); // 玩家停止注视时触发
|
||||||
void BeginEdit();
|
// void BeginEdit();
|
||||||
void EndEdit();
|
// void EndEdit();
|
||||||
List<IEditableComponent> GetEditableComponents();
|
// List<IEditableComponent> GetEditableComponents();
|
||||||
}
|
// }
|
||||||
}
|
}
|
@@ -12,11 +12,11 @@ namespace Script.Gameplay.Player
|
|||||||
[SerializeField] private FirstPersonRaycaster raycaster; // 新增:第一人称射线检测器
|
[SerializeField] private FirstPersonRaycaster raycaster; // 新增:第一人称射线检测器
|
||||||
public bool IsEnableEditing = true; // 是否启用编辑功能
|
public bool IsEnableEditing = true; // 是否启用编辑功能
|
||||||
private bool isEditing = false; // 当前是否处于编辑状态
|
private bool isEditing = false; // 当前是否处于编辑状态
|
||||||
public event Action<IEditable> OnBeginEditTarget;
|
public event Action<GameObject> OnBeginEditTarget;
|
||||||
public event Action<IEditable> OnEndEditTarget;
|
public event Action<GameObject> OnEndEditTarget;
|
||||||
|
|
||||||
private IEditable currentTarget; // 射线命中的当前可编辑对象(用于按键交互)
|
private GameObject currentTarget; // 射线命中的当前可编辑对象(用于按键交互)
|
||||||
private IEditable previousGazedTarget; // 上一次注视的对象(用于注视进入/离开事件)
|
private GameObject previousGazedTarget; // 上一次注视的对象(用于注视进入/离开事件)
|
||||||
|
|
||||||
private InputManager inputManager;
|
private InputManager inputManager;
|
||||||
|
|
||||||
@@ -43,20 +43,27 @@ namespace Script.Gameplay.Player
|
|||||||
void DetectInteractable()
|
void DetectInteractable()
|
||||||
{
|
{
|
||||||
if (raycaster == null) return;
|
if (raycaster == null) return;
|
||||||
|
|
||||||
GameObject lookAtObj = raycaster.CurrentLookAtObject;
|
GameObject lookAtObj = raycaster.CurrentLookAtObject;
|
||||||
IEditable hitEditable = lookAtObj != null ? lookAtObj.GetComponent<IEditable>() : null;
|
if(lookAtObj == null) return;
|
||||||
|
|
||||||
|
GameObject hitEditable = null;
|
||||||
|
if (lookAtObj.GetComponent<IEditableComponent>() != null)
|
||||||
|
{
|
||||||
|
hitEditable = lookAtObj;
|
||||||
|
}
|
||||||
|
|
||||||
// 如果命中对象与之前注视的不一样,触发进入/离开事件
|
// 如果命中对象与之前注视的不一样,触发进入/离开事件
|
||||||
if (hitEditable != previousGazedTarget)
|
if (hitEditable != previousGazedTarget)
|
||||||
{
|
{
|
||||||
if (previousGazedTarget != null)
|
if (previousGazedTarget != null)
|
||||||
{
|
{
|
||||||
previousGazedTarget.OnGazeExit(this);
|
// previousGazedTarget.OnGazeExit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hitEditable != null)
|
if (hitEditable != null)
|
||||||
{
|
{
|
||||||
hitEditable.OnGazeEnter(this);
|
// hitEditable.OnGazeEnter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
previousGazedTarget = hitEditable;
|
previousGazedTarget = hitEditable;
|
||||||
@@ -65,11 +72,6 @@ namespace Script.Gameplay.Player
|
|||||||
currentTarget = hitEditable;
|
currentTarget = hitEditable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEditable GetCurrentTarget()
|
|
||||||
{
|
|
||||||
return currentTarget;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void EditTarget()
|
private void EditTarget()
|
||||||
{
|
{
|
||||||
if (isEditing)
|
if (isEditing)
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Core;
|
using Core;
|
||||||
|
using Script.Gameplay.Edit;
|
||||||
using Script.Gameplay.Interface;
|
using Script.Gameplay.Interface;
|
||||||
using Script.Gameplay.Player;
|
using Script.Gameplay.Player;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -26,13 +27,13 @@ namespace UI
|
|||||||
ControllerLocator.Instance.TryGetWait<PlayerEditController>(OnGetPlayerEditController);
|
ControllerLocator.Instance.TryGetWait<PlayerEditController>(OnGetPlayerEditController);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnBeginEdit(IEditable target)
|
public void OnBeginEdit(GameObject target)
|
||||||
{
|
{
|
||||||
this.gameObject.SetActive(true);
|
this.gameObject.SetActive(true);
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
ClearComponentUI();
|
ClearComponentUI();
|
||||||
GenerateComponentUI(GetEditableComponentsFromEditable(target));
|
GenerateComponentUI(EditableManager.GetEditableComponents(target));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -43,7 +44,7 @@ namespace UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnEndEdit(IEditable target)
|
public void OnEndEdit(GameObject target)
|
||||||
{
|
{
|
||||||
this.gameObject.SetActive(false);
|
this.gameObject.SetActive(false);
|
||||||
|
|
||||||
@@ -63,19 +64,6 @@ namespace UI
|
|||||||
//Debug.Log("PlayerEditViewer obtained PlayerEditController.");
|
//Debug.Log("PlayerEditViewer obtained PlayerEditController.");
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<IEditableComponent> GetEditableComponentsFromEditable(IEditable target)
|
|
||||||
{
|
|
||||||
if (target == null)
|
|
||||||
{
|
|
||||||
Debug.Log($"editable is null in {nameof(PlayerEditViewer)}");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return target.GetEditableComponents()
|
|
||||||
.Where(c => c != null)
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ClearComponentUI()
|
private void ClearComponentUI()
|
||||||
{
|
{
|
||||||
foreach (var viewer in componentViewers)
|
foreach (var viewer in componentViewers)
|
||||||
|
Reference in New Issue
Block a user