diff --git a/Assets/OutlineEffect/OutlineEffect/Outline.cs b/Assets/OutlineEffect/OutlineEffect/Outline.cs index 9778fb9..12486c9 100644 --- a/Assets/OutlineEffect/OutlineEffect/Outline.cs +++ b/Assets/OutlineEffect/OutlineEffect/Outline.cs @@ -88,11 +88,8 @@ namespace cakeslice } if (gameObject == this.gameObject) { - if (OutlineEffect.Instance.outlines.Count == 0) - { - OutlineEffect.Instance?.AddOutline(this); - Debug.Log("添加自身"); - } + OutlineEffect.Instance?.AddOutline(this); + Debug.Log("添加自身"); } } diff --git a/Assets/Scenes/TobaccoModelTest.unity b/Assets/Scenes/TobaccoModelTest.unity index da5e7d2..53776dc 100644 --- a/Assets/Scenes/TobaccoModelTest.unity +++ b/Assets/Scenes/TobaccoModelTest.unity @@ -8888,7 +8888,7 @@ GameObject: m_Component: - component: {fileID: 150120500} m_Layer: 0 - m_Name: Point5 + m_Name: Point4 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -17456,8 +17456,7 @@ Transform: m_LocalPosition: {x: 0.021, y: 0.186, z: 0.485} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 1607760248} + m_Children: [] m_Father: {fileID: 543450653446745207} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &311311086 @@ -18725,9 +18724,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 346039668} - - component: {fileID: 346039670} - component: {fileID: 346039669} - - component: {fileID: 346039671} m_Layer: 0 m_Name: Replacebattery2 m_TagString: Untagged @@ -18749,10 +18746,10 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 151959378} - - {fileID: 1636950145} - {fileID: 1114033623} - {fileID: 411635388} - {fileID: 150120500} + - {fileID: 1636950145} - {fileID: 1546098417} - {fileID: 1095857517} - {fileID: 212379586} @@ -18765,7 +18762,7 @@ MonoBehaviour: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 346039667} - m_Enabled: 1 + m_Enabled: 0 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 7d4706b144201524091f3830af405c3c, type: 3} m_Name: @@ -18785,54 +18782,6 @@ MonoBehaviour: - {fileID: 798230194} - {fileID: 1492520517} - {fileID: 564391127} ---- !u!65 &346039670 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 346039667} - m_Material: {fileID: 0} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 1 - m_ProvidesContacts: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Size: {x: 0.9571686, y: 0.8077016, z: 0.4541464} - m_Center: {x: 0.02141571, y: 0.27179468, z: 0.36533195} ---- !u!54 &346039671 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 346039667} - serializedVersion: 4 - m_Mass: 1 - m_Drag: 0 - m_AngularDrag: 0.05 - m_CenterOfMass: {x: 0, y: 0, z: 0} - m_InertiaTensor: {x: 1, y: 1, z: 1} - m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ImplicitCom: 1 - m_ImplicitTensor: 1 - m_UseGravity: 1 - m_IsKinematic: 1 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 --- !u!1 &346672917 GameObject: m_ObjectHideFlags: 0 @@ -19970,7 +19919,7 @@ GameObject: m_Component: - component: {fileID: 364398467} m_Layer: 0 - m_Name: point3 + m_Name: point2 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -19984,8 +19933,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 364398466} serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.052, y: 0.651, z: 1.215} + m_LocalRotation: {x: -0, y: -0, z: -3.8336379e-10, w: 1} + m_LocalPosition: {x: 0.05199881, y: 0.651, z: 1.2150004} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -22114,7 +22063,7 @@ GameObject: m_Component: - component: {fileID: 411635388} m_Layer: 0 - m_Name: Point4 + m_Name: Point3 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -24682,63 +24631,6 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: cdd6af5577c370a4aa1ebad05cdb9508, type: 3} ---- !u!1001 &468315917 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 308516276} - m_Modifications: - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2489703380379606484, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_Name - value: Battay1 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 4466255138e27264da33db90428aa961, type: 3} --- !u!1 &468355452 GameObject: m_ObjectHideFlags: 0 @@ -30080,11 +29972,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 577323248} m_CullTransparentMesh: 1 ---- !u!4 &578111324 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - m_PrefabInstance: {fileID: 600501907} - m_PrefabAsset: {fileID: 0} --- !u!1 &580030314 GameObject: m_ObjectHideFlags: 0 @@ -30303,63 +30190,6 @@ MonoBehaviour: Boxgame: {fileID: 8783056752875549894, guid: 3c858a60db3529f4698ac98e5b04d78b, type: 3} Boxgame2: {fileID: 1918721954697570452, guid: 3c5c67ef5f8f1da40b4a0efd25da6d96, type: 3} Points: {fileID: 582522281} ---- !u!1001 &582890207 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 798230194} - m_Modifications: - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalPosition.y - value: 0.006 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalPosition.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2489703380379606484, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_Name - value: Battay - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} --- !u!1 &583555582 GameObject: m_ObjectHideFlags: 0 @@ -31661,63 +31491,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 598631046} m_CullTransparentMesh: 1 ---- !u!1001 &600501907 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 1492520517} - m_Modifications: - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalPosition.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2489703380379606484, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - propertyPath: m_Name - value: Battay - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} --- !u!1 &601148598 GameObject: m_ObjectHideFlags: 0 @@ -42737,8 +42510,7 @@ Transform: m_LocalPosition: {x: 0.015987396, y: 3.4, z: -0.96630394} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 1745521858} + m_Children: [] m_Father: {fileID: 543450653446745207} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &799050417 stripped @@ -49127,8 +48899,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 901011439} serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.052, y: -0.1, z: 2.637} + m_LocalRotation: {x: -0, y: -0, z: -3.8336379e-10, w: 1} + m_LocalPosition: {x: 0.05199881, y: -0.099999994, z: 2.6370003} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -49359,11 +49131,6 @@ BoxCollider: serializedVersion: 3 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} ---- !u!4 &902355419 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - m_PrefabInstance: {fileID: 1416949046} - m_PrefabAsset: {fileID: 0} --- !u!1 &902985833 GameObject: m_ObjectHideFlags: 0 @@ -59212,7 +58979,7 @@ GameObject: m_Component: - component: {fileID: 1114033623} m_Layer: 0 - m_Name: Point3 + m_Name: Point2 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -59420,8 +59187,6 @@ GameObject: m_Component: - component: {fileID: 1121959448} - component: {fileID: 1121959449} - - component: {fileID: 1121959450} - - component: {fileID: 1121959451} m_Layer: 0 m_Name: Replacebattery1 m_TagString: Untagged @@ -59443,10 +59208,10 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1288255723} - - {fileID: 1751210802} - {fileID: 364398467} - {fileID: 1505851183} - {fileID: 1323125302} + - {fileID: 1751210802} - {fileID: 1475697199} - {fileID: 1178685067} - {fileID: 901011440} @@ -59459,7 +59224,7 @@ MonoBehaviour: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1121959447} - m_Enabled: 1 + m_Enabled: 0 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 7d4706b144201524091f3830af405c3c, type: 3} m_Name: @@ -59479,54 +59244,6 @@ MonoBehaviour: - {fileID: 1227559382} - {fileID: 1176932726} - {fileID: 308516276} ---- !u!65 &1121959450 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1121959447} - m_Material: {fileID: 0} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 1 - m_ProvidesContacts: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Size: {x: 0.8485222, y: 0.44869477, z: 0.3966484} - m_Center: {x: 0.1548214, y: 0.016590714, z: 0.4430437} ---- !u!54 &1121959451 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1121959447} - serializedVersion: 4 - m_Mass: 1 - m_Drag: 0 - m_AngularDrag: 0.05 - m_CenterOfMass: {x: 0, y: 0, z: 0} - m_InertiaTensor: {x: 1, y: 1, z: 1} - m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ImplicitCom: 1 - m_ImplicitTensor: 1 - m_UseGravity: 1 - m_IsKinematic: 1 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 --- !u!1 &1123613269 GameObject: m_ObjectHideFlags: 0 @@ -62834,8 +62551,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1178685066} serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.052, y: -0.1, z: 1.915} + m_LocalRotation: {x: -0, y: -0, z: -3.8336379e-10, w: 1} + m_LocalPosition: {x: 0.05199881, y: -0.099999994, z: 1.9150002} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -65450,8 +65167,7 @@ Transform: m_LocalPosition: {x: 0.021, y: 0.186, z: -0.959} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 902355419} + m_Children: [] m_Father: {fileID: 543450653446745207} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1228325961 @@ -69201,8 +68917,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1288255722} serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.052, y: 0.626, z: 0} + m_LocalRotation: {x: -0, y: -0, z: -3.8336379e-10, w: 1} + m_LocalPosition: {x: 0.05199881, y: 0.62600005, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -70377,7 +70093,7 @@ GameObject: m_Component: - component: {fileID: 1323125302} m_Layer: 0 - m_Name: point5 + m_Name: point4 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -70391,8 +70107,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1323125301} serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.052, y: 0.651, z: 2.637} + m_LocalRotation: {x: -0, y: -0, z: -3.8336379e-10, w: 1} + m_LocalPosition: {x: 0.05199881, y: 0.651, z: 2.6370003} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -74769,63 +74485,6 @@ MonoBehaviour: m_EditorClassIdentifier: color: 1 eraseRenderer: 0 ---- !u!1001 &1416949046 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 1227559382} - m_Modifications: - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2489703380379606484, guid: 4466255138e27264da33db90428aa961, type: 3} - propertyPath: m_Name - value: Battay1 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 4466255138e27264da33db90428aa961, type: 3} --- !u!1 &1419056784 GameObject: m_ObjectHideFlags: 0 @@ -77040,8 +76699,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1475697198} serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.052, y: -0.1, z: 1.215} + m_LocalRotation: {x: -0, y: -0, z: -3.8336379e-10, w: 1} + m_LocalPosition: {x: 0.05199881, y: -0.099999934, z: 1.2150004} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -77832,8 +77491,7 @@ Transform: m_LocalPosition: {x: 0.015987396, y: 3.4, z: -0.277} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 578111324} + m_Children: [] m_Father: {fileID: 543450653446745207} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1493586822 @@ -78771,7 +78429,7 @@ GameObject: m_Component: - component: {fileID: 1505851183} m_Layer: 0 - m_Name: point4 + m_Name: point3 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -78785,8 +78443,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1505851182} serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.052, y: 0.651, z: 1.915} + m_LocalRotation: {x: -0, y: -0, z: -3.8336379e-10, w: 1} + m_LocalPosition: {x: 0.05199881, y: 0.651, z: 1.9150002} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -83125,11 +82783,6 @@ MonoBehaviour: m_EditorClassIdentifier: modifycolor: {fileID: 1607210131} colortext: {fileID: 849966662} ---- !u!4 &1607760248 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 960097094823491891, guid: 4466255138e27264da33db90428aa961, type: 3} - m_PrefabInstance: {fileID: 468315917} - m_PrefabAsset: {fileID: 0} --- !u!1 &1608268054 GameObject: m_ObjectHideFlags: 0 @@ -85129,7 +84782,7 @@ GameObject: m_Component: - component: {fileID: 1636950145} m_Layer: 0 - m_Name: Point2 + m_Name: Point5 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -90247,11 +89900,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1745459843} m_CullTransparentMesh: 1 ---- !u!4 &1745521858 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 960097094823491891, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} - m_PrefabInstance: {fileID: 582890207} - m_PrefabAsset: {fileID: 0} --- !u!1 &1747515460 GameObject: m_ObjectHideFlags: 0 @@ -90420,7 +90068,7 @@ GameObject: m_Component: - component: {fileID: 1751210802} m_Layer: 0 - m_Name: point2 + m_Name: point5 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -90434,8 +90082,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1751210801} serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.052, y: 0.139, z: -0} + m_LocalRotation: {x: -0, y: -0, z: -3.8336379e-10, w: 1} + m_LocalPosition: {x: 0.05199881, y: 0.13900003, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -166870,6 +166518,17 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: ID: 1 + point1: {fileID: 1288255723} + point2: {fileID: 364398467} + point3: {fileID: 1505851183} + point4: {fileID: 1323125302} + point5: {fileID: 1751210802} + point6: {fileID: 1475697199} + point7: {fileID: 1178685067} + point8: {fileID: 901011440} + battery: {fileID: 2489703380379606484, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} + paw: {fileID: 5370486883196953064} + Batspoint: {fileID: 1198250831} --- !u!4 &9016773284040682900 Transform: m_ObjectHideFlags: 0 @@ -166959,6 +166618,17 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: ID: 2 + point1: {fileID: 151959378} + point2: {fileID: 1114033623} + point3: {fileID: 411635388} + point4: {fileID: 150120500} + point5: {fileID: 1636950145} + point6: {fileID: 1546098417} + point7: {fileID: 1095857517} + point8: {fileID: 212379586} + battery: {fileID: 2489703380379606484, guid: a13e9d52252e5c24b8f9ab6a7fcbbe89, type: 3} + paw: {fileID: 8017155123971569211} + Batspoint: {fileID: 883484096} --- !u!1 &9025095810452859374 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/MqttManager.cs b/Assets/Scripts/MqttManager.cs index 726cc17..ff7290f 100644 --- a/Assets/Scripts/MqttManager.cs +++ b/Assets/Scripts/MqttManager.cs @@ -267,7 +267,7 @@ public class MqttManager : MonoSingleton default: break; } - await UniTask.Delay(10); + await UniTask.Delay(15); } else { diff --git a/Assets/Scripts/YL/Batteryanimation.cs b/Assets/Scripts/YL/Batteryanimation.cs index a147373..61fb629 100644 --- a/Assets/Scripts/YL/Batteryanimation.cs +++ b/Assets/Scripts/YL/Batteryanimation.cs @@ -1,18 +1,33 @@ using DefaultNamespace; +using DG.Tweening; using System.Collections; using System.Collections.Generic; using UnityEngine; public class Batteryanimation : MonoBehaviour { + [Header("µç³Øid")] public string ID; + [Header("ËùÓеç³ØËùλÒƵĵãλºÍÐèÒª³õʼ»¯É豸µãλ")] + public Transform point1, point2, point3, point4, point5, point6, point7, point8; + [Header("µç³ØÐèÒª³õʼ»¯")] + public GameObject battery; + [Header("µç³Øצ×Ó")] + public Transform paw; + [Header("ÅжÏÊÇ·ñÓеç³Ø")] + public Transform Batspoint; + /// + /// ³õʼ»¯ÅÐ¶Ï + /// + private bool ispcon = false; + private float speed = 1f; void Start() { - + } void Update() { - + } /// /// ½ÓÊÕµç³ØÊý¾Ý @@ -20,6 +35,160 @@ public class Batteryanimation : MonoBehaviour /// public void Batterydata(Qcbd qcbd) { - Debug.Log("´ó´óµÄµç³Ø"); + if (!ispcon) + { + if (qcbd.BatteryStatus1 != "0") + { + Initbattery(point6); + } + if (qcbd.BatteryStatus2 != "0") + { + Initbattery(point7); + } + if (qcbd.BatteryStatus3 != "0") + { + Initbattery(point8); + } + ispcon = true; + } + if (qcbd.Take0Battery == "True") + { + Takebattery(point1, point5); + } + else if (qcbd.Put0Battery == "True") + { + Putbattery(point1, point5); + } + else if (qcbd.Take1Battery == "True") + { + Batterywithdrawal(point2, point6); + } + else if (qcbd.Put1Battery == "True") + { + Dischargecell(point2, point6); + } + else if (qcbd.Take2Battery == "True") + { + Batterywithdrawal(point3, point7); + } + else if (qcbd.Put2Battery == "True") + { + Dischargecell(point3, point7); + } + else if (qcbd.Take3Battery == "True") + { + Batterywithdrawal(point4, point8); + } + else if (qcbd.Put3Battery == "True") + { + Dischargecell(point4, point8); + } + } + /// + /// µç³Ø³õʼ»¯ + /// + /// + public void Initbattery(Transform pos) + { + if (pos) + { + GameObject battery = Instantiate(this.battery, pos); + battery.transform.SetParent(pos); + } + } + /// + /// ȡС³µµç³Ø + /// + public void Takebattery(Transform pos, Transform pos2) + { + if (pos && pos2) + { + paw.transform.DOMove(pos.position, (Vector3.Distance(paw.transform.position, pos.position) / speed)).SetEase(Ease.InOutQuad).OnComplete(() => + { + paw.transform.DOMove(pos2.position, (Vector3.Distance(paw.transform.position, pos2.position) / speed)).SetEase(Ease.InOutQuad).OnComplete(() => + { + GameObject battery = Instantiate(this.battery, Batspoint); + battery.transform.SetParent(Batspoint); + paw.transform.DOMove(pos.position, (Vector3.Distance(paw.transform.position, pos.position) / speed)).SetEase(Ease.InOutQuad); + }); + }); + } + } + /// + /// ¸øС³µ×°µç³Ø + /// + /// + /// + public void Putbattery(Transform pos, Transform pos2) + { + if (pos && pos2) + { + paw.transform.DOMove(pos.position, (Vector3.Distance(paw.transform.position, pos.position) / speed)).SetEase(Ease.InOutQuad).OnComplete(() => + { + paw.transform.DOMove(pos2.position, (Vector3.Distance(paw.transform.position, pos2.position) / speed)).SetEase(Ease.InOutQuad).OnComplete(() => + { + if (Batspoint.childCount > 0) + { + GameObject battery = Batspoint.transform.GetChild(0).gameObject; + if (battery != null) + { + Destroy(battery); + } + } + paw.transform.DOMove(pos.position, (Vector3.Distance(paw.transform.position, pos.position) / speed)).SetEase(Ease.InOutQuad); + }); + }); + } + } + /// + /// ·Åµç³Ø + /// + public void Dischargecell(Transform pos, Transform pos2) + { + if (pos && pos2) + { + paw.transform.DOMove(pos.position, (Vector3.Distance(paw.transform.position, pos.position) / speed)).SetEase(Ease.InOutQuad).OnComplete(() => + { + paw.transform.DOMove(pos2.position, (Vector3.Distance(paw.transform.position, pos2.position) / speed)).SetEase(Ease.InOutQuad).OnComplete(() => + { + if (Batspoint.childCount > 0 && pos2.childCount == 0) + { + GameObject bat = Batspoint.transform.GetChild(0).gameObject; + bat.transform.SetParent(null); + bat.transform.position = pos2.position; + bat.transform.SetParent(pos2); + } + paw.transform.DOMove(pos.position, (Vector3.Distance(paw.transform.position, pos.position) / speed)).SetEase(Ease.InOutQuad); + }); + }); + } + } + /// + /// È¡µç³Ø + /// + /// + /// + public void Batterywithdrawal(Transform pos, Transform pos2) + { + if (pos && pos2) + { + paw.transform.DOMove(pos.position, (Vector3.Distance(paw.transform.position, pos.position) / speed)).SetEase(Ease.InOutQuad).OnComplete(() => + { + paw.transform.DOMove(pos2.position, (Vector3.Distance(paw.transform.position, pos2.position) / speed)).SetEase(Ease.InOutQuad).OnComplete(() => + { + if (pos2.childCount > 0 && Batspoint.childCount == 0) + { + GameObject bat = pos2.transform.GetChild(0).gameObject; + if (bat != null) + { + bat.transform.SetParent(null); + bat.transform.position = Batspoint.position; + bat.transform.SetParent(Batspoint); + } + } + paw.transform.DOMove(pos.position, (Vector3.Distance(paw.transform.position, pos.position) / speed)).SetEase(Ease.InOutQuad); + }); + }); + } } } diff --git a/Assets/Scripts/YL/Batterychangesystem.cs b/Assets/Scripts/YL/Batterychangesystem.cs index 955f103..a7fe76e 100644 --- a/Assets/Scripts/YL/Batterychangesystem.cs +++ b/Assets/Scripts/YL/Batterychangesystem.cs @@ -71,15 +71,15 @@ public class Batterychangesystem : MonoBehaviour /// public async void OnTriggerEnter(Collider other) { - if (other.gameObject.CompareTag("Car")) - { - await Movepos(Pointchanger, Point1, speed); - await Movepos(Pointchanger, Point2, speed); - GameObject bats = Instantiate(batterys, Batspoint); - await Movepos(Pointchanger, Point1, speed); - await Batteryslot(BatspointList, Pointchanger, bats); + //if (other.gameObject.CompareTag("Car")) + //{ + // await Movepos(Pointchanger, Point1, speed); + // await Movepos(Pointchanger, Point2, speed); + // GameObject bats = Instantiate(batterys, Batspoint); + // await Movepos(Pointchanger, Point1, speed); + // await Batteryslot(BatspointList, Pointchanger, bats); - } + //} } /// /// Åжϵç³Ø²Ûµãλ