This commit is contained in:
lujiajian 2025-01-17 17:45:19 +08:00
parent 58810fdeff
commit f31078df4f
20 changed files with 4535 additions and 823 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,81 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u706F\u5149 1"
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ValidKeywords:
- _EMISSION
m_InvalidKeywords: []
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.14142135
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.588, g: 0.588, b: 0.588, a: 1}
- _EmissionColor: {r: 0.7490196, g: 0.5137255, b: 0, a: 1}
m_BuildTextureStacks: []

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 348848297d1f2dc49a763b9f984c8653
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,81 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u706F\u5149 2"
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ValidKeywords:
- _EMISSION
m_InvalidKeywords: []
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.14142135
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.588, g: 0.588, b: 0.588, a: 1}
- _EmissionColor: {r: 0.7490196, g: 0.5137255, b: 0, a: 1}
m_BuildTextureStacks: []

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: d1038259346ab044eb557dfb09d06b97
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,81 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u706F\u5149 3"
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ValidKeywords:
- _EMISSION
m_InvalidKeywords: []
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.14142135
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.588, g: 0.588, b: 0.588, a: 1}
- _EmissionColor: {r: 0.7490196, g: 0.5137255, b: 0, a: 1}
m_BuildTextureStacks: []

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 5c1dcb4e1699e9e4eb080c802c7d631a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,80 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u7535\u89C6\u5C4F\u5E55"
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 2800000, guid: e1fe6ac5ee7adf5479c8ab873b99394c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.14142135
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.007843138, g: 0.007843138, b: 0.003921569, a: 1}
- _EmissionColor: {r: 1.0717734, g: 1.0717734, b: 1.0717734, a: 1}
m_BuildTextureStacks: []

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: deb464ee377856e4fa30187659bda458
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,97 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u7A7A\u8C03\u5C4F\u5E55_COLD"
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 2800000, guid: aecd240c56ecead42ae6bd3eb151bf98, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Standard:
m_Texture: {fileID: 2800000, guid: aecd240c56ecead42ae6bd3eb151bf98, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Switch:
m_Texture: {fileID: 2800000, guid: d358ace2a99ccf5458716599b9ae3cbb, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _texcoord:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.14142135
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Open: 0
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _TexSwitch: 0
- _ToggleSwitch0: 0
- _UVSec: 0
- _ZWrite: 1
- __dirty: 0
m_Colors:
- _Col: {r: 2, g: 2, b: 2, a: 0}
- _Color: {r: 0, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 4.0000005, g: 4.0000005, b: 4.0000005, a: 1}
m_BuildTextureStacks: []

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: d2574b23cffd0cd418ebdaf27db78cde
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,97 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: "\u7A7A\u8C03\u5C4F\u5E55_HOT"
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 2800000, guid: d358ace2a99ccf5458716599b9ae3cbb, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Standard:
m_Texture: {fileID: 2800000, guid: aecd240c56ecead42ae6bd3eb151bf98, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Switch:
m_Texture: {fileID: 2800000, guid: d358ace2a99ccf5458716599b9ae3cbb, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _texcoord:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.14142135
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Open: 0
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _TexSwitch: 0
- _ToggleSwitch0: 0
- _UVSec: 0
- _ZWrite: 1
- __dirty: 0
m_Colors:
- _Col: {r: 2, g: 2, b: 2, a: 0}
- _Color: {r: 0, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 4.0000005, g: 4.0000005, b: 4.0000005, a: 1}
m_BuildTextureStacks: []

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 7767ebbf811dcb94ab3f7beeed584402
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -11,6 +11,7 @@ GameObject:
- component: {fileID: 6584817809350125257}
- component: {fileID: 6848903540835194896}
- component: {fileID: 5451757505271434424}
- component: {fileID: 8834495198554237040}
m_Layer: 0
m_Name: "\u667A\u80FD\u7A97\u5E18"
m_TagString: Untagged
@ -100,3 +101,20 @@ BoxCollider:
serializedVersion: 2
m_Size: {x: 4.64893, y: 0.12397376, z: 3.0000007}
m_Center: {x: 0, y: -0.0000001713634, z: 0}
--- !u!111 &8834495198554237040
Animation:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6030464457490701924}
m_Enabled: 1
serializedVersion: 3
m_Animation: {fileID: 7400000, guid: 18adac65422b5ed4d908f4651af6183d, type: 2}
m_Animations:
- {fileID: 7400000, guid: 21f4d50de179b774f8e9cc94337cce15, type: 2}
- {fileID: 7400000, guid: 18adac65422b5ed4d908f4651af6183d, type: 2}
m_WrapMode: 0
m_PlayAutomatically: 1
m_AnimatePhysics: 0
m_CullingType: 0

File diff suppressed because it is too large Load Diff

View File

@ -2,15 +2,16 @@ using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UIElements;
/// <summary>
/// 当前选择的区域
/// </summary>
public enum Region
{
None,
environment,//环境控制
connected_Devices,//设备互联与系统控制
maintenance//智能家电与维护
,//环境控制
,//设备互联与系统控制
//智能家电与维护
}
/// <summary>
/// 家具类型
@ -18,9 +19,10 @@ public enum Region
public enum Typeoffurniture
{
None,
light,
curtain,
airconditioning
,//灯
,//窗帘
,//空调
//窗户
}
/// <summary>
/// 点击后显示对应的UI
@ -44,6 +46,14 @@ public class ClickModelType : MonoBehaviour
/// </summary>
public GameObject curtainPanel;
/// <summary>
/// 窗户控制面板
/// </summary>
public GameObject windowPanel;
/// <summary>
/// 空调控制面板
/// </summary>
public GameObject AirPanel;
/// <summary>
/// 当前区域类型
/// </summary>
public Transform regionType;
@ -51,13 +61,13 @@ public class ClickModelType : MonoBehaviour
{
switch (region)
{
case Region.environment:
case Region.:
regionType = GameObject.Find("环境控制区域").transform;
break;
case Region.connected_Devices:
case Region.:
regionType = GameObject.Find("设备互联与系统控制").transform;
break;
case Region.maintenance:
case Region.:
regionType = GameObject.Find("智能家电与维护").transform;
break;
}
@ -72,23 +82,45 @@ public class ClickModelType : MonoBehaviour
}
public void OnMouseDown()
{
if (SelectModel.Instance.region == region && typeoffurniture == Typeoffurniture.light)
if (SelectModel.Instance.region == region && typeoffurniture == Typeoffurniture.)
{
Control_Light.Instance.LightsModel = new List<Transform>();
windowPanel.SetActive(false);
curtainPanel.SetActive(false);
LightPanel.SetActive(true);
AirPanel.SetActive(false);
List<ClickModelType> clickModelTypes = FindObjectsOfType<ClickModelType>().ToList();
for (int i = 0; i < clickModelTypes.Count; i++)
{
if (SelectModel.Instance.region == clickModelTypes[i].region && clickModelTypes[i].typeoffurniture == Typeoffurniture.light)
if (SelectModel.Instance.region == clickModelTypes[i].region && clickModelTypes[i].typeoffurniture == Typeoffurniture.)
{
Control_Light.Instance.LightsModel.Add(clickModelTypes[i].transform);
}
}
}
if (SelectModel.Instance.region == region && typeoffurniture == Typeoffurniture.curtain)
if (SelectModel.Instance.region == region && typeoffurniture == Typeoffurniture.)
{
windowPanel.SetActive(false);
curtainPanel.SetActive(true);
LightPanel.SetActive(false);
AirPanel.SetActive(false);
Control_Curtain.Instance.curtain = transform;
}
if (SelectModel.Instance.region == region && typeoffurniture == Typeoffurniture.)
{
windowPanel.SetActive(true);
curtainPanel.SetActive(false);
LightPanel.SetActive(false);
AirPanel.SetActive(false);
Control_Windows.Instance.window = transform;
}
if (SelectModel.Instance.region == region && typeoffurniture == Typeoffurniture.)
{
windowPanel.SetActive(false);
curtainPanel.SetActive(false);
LightPanel.SetActive(false);
AirPanel.SetActive(true);
Control_Air.Instance.airobject = transform;
}
}
}

View File

@ -1,6 +1,8 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using Unity.VisualScripting.Antlr3.Runtime;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
@ -9,11 +11,6 @@ using UnityEngine.UI;
public class Control_Air : MonoBehaviour
{
public static Control_Air Instance;
/// <summary>
/// 制冷制热模式材质球 0.制冷 1.制热
/// </summary>
public List<Material> ModelMatarils = new List<Material>();
/// <summary>
/// ÖÆÀä°´Å¥
/// </summary>
@ -25,48 +22,150 @@ public class Control_Air : MonoBehaviour
/// <summary>
/// ζÈ+
/// </summary>
public Button Add;
public Button TempAdd;
/// <summary>
/// ζÈ-
/// </summary>
public Button Sub;
public Button TempSub;
/// <summary>
/// 温度度数
/// 风速+
/// </summary>
public TextMeshProUGUI temperature;
public Button WindAdd;
/// <summary>
/// 风速-
/// </summary>
public Button WindSub;
/// <summary>
/// 打开空调
/// </summary>
public Button Open;
/// <summary>
/// 是否开启空调
/// </summary>
bool isOpen;
/// <summary>
/// 点击的空调
/// </summary>
public Transform airobject;
private void Awake()
{
Instance = this;
}
void Start()
{
Open.onClick.AddListener(() =>
{
isOpen = !isOpen;
OpenAir(isOpen);
});
Cool.onClick.AddListener(() =>
{
temperature.text = "16";
GetComponent<MeshRenderer>().material = ModelMatarils[0];
OpenAir(true);
});
Warm.onClick.AddListener(() =>
{
temperature.text = "26";
GetComponent<MeshRenderer>().material = ModelMatarils[1];
SetWarm();
});
Add.onClick.AddListener(() =>
TempAdd.onClick.AddListener(() =>
{
if (int.Parse(temperature.text) < 32)
{
temperature.text = (int.Parse(temperature.text) + 1).ToString();
}
AddTemp();
});
Sub.onClick.AddListener(() =>
TempSub.onClick.AddListener(() =>
{
if (int.Parse(temperature.text) > 16)
{
temperature.text = (int.Parse(temperature.text) - 1).ToString();
}
SubTemp();
});
WindAdd.onClick.AddListener(() =>
{
AddWind();
});
WindSub.onClick.AddListener(() =>
{
SubWind();
});
}
void Update()
/// <summary>
/// 打开空调 默认为制冷
/// </summary>
private void OpenAir(bool isopen)
{
if (isopen)
{
Canvas chirendcanvas = airobject.GetComponentInChildren<Canvas>();
Open.GetComponentInChildren<TextMeshProUGUI>().text = "关闭空调";
chirendcanvas.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
List<TextMeshProUGUI> chirendmessage = chirendcanvas.GetComponentsInChildren<TextMeshProUGUI>().ToList();
airobject.GetChild(0).GetComponentInChildren<MeshRenderer>().material.EnableKeyword("_EMISSION");
chirendmessage[0].text = "16";//温度
chirendmessage[2].text = ">";//风速
chirendmessage[3].text = "制冷";//温度
}
else
{
Canvas chirendcanvas = airobject.GetComponentInChildren<Canvas>();
Open.GetComponentInChildren<TextMeshProUGUI>().text = "打开空调";
chirendcanvas.transform.localScale = new Vector3(0, 0, 0);
airobject.GetChild(0).GetComponentInChildren<MeshRenderer>().material.DisableKeyword("_EMISSION");
}
}
/// <summary>
/// 设置制暖
/// </summary>
private void SetWarm()
{
Canvas chirendcanvas = airobject.GetComponentInChildren<Canvas>();
List<TextMeshProUGUI> chirendmessage = chirendcanvas.GetComponentsInChildren<TextMeshProUGUI>().ToList();
airobject.GetChild(0).GetComponentInChildren<MeshRenderer>().material.EnableKeyword("_EMISSION");
chirendmessage[0].text = "26";
chirendmessage[2].text = ">";//风速
chirendmessage[3].text = "制热";//模式
}
/// <summary>
/// 温度+
/// </summary>
private void AddTemp()
{
Canvas chirendcanvas = airobject.GetComponentInChildren<Canvas>();
List<TextMeshProUGUI> chirendmessage = chirendcanvas.GetComponentsInChildren<TextMeshProUGUI>().ToList();
if (int.Parse(chirendmessage[0].text) < 32)
{
chirendmessage[0].text = (int.Parse(chirendmessage[0].text) + 1).ToString();
}
}
/// <summary>
/// 温度-
/// </summary>
private void SubTemp()
{
Canvas chirendcanvas = airobject.GetComponentInChildren<Canvas>();
List<TextMeshProUGUI> chirendmessage = chirendcanvas.GetComponentsInChildren<TextMeshProUGUI>().ToList();
if (int.Parse(chirendmessage[0].text) > 16)
{
chirendmessage[0].text = (int.Parse(chirendmessage[0].text) - 1).ToString();
}
}
/// <summary>
/// 风速+
/// </summary>
private void AddWind()
{
Canvas chirendcanvas = airobject.GetComponentInChildren<Canvas>();
List<TextMeshProUGUI> chirendmessage = chirendcanvas.GetComponentsInChildren<TextMeshProUGUI>().ToList();
if (chirendmessage[2].text.Length < 3)
{
chirendmessage[2].text += ">";
}
}
/// <summary>
/// 风速-
/// </summary>
private void SubWind()
{
Canvas chirendcanvas = airobject.GetComponentInChildren<Canvas>();
List<TextMeshProUGUI> chirendmessage = chirendcanvas.GetComponentsInChildren<TextMeshProUGUI>().ToList();
if (chirendmessage[2].text.Length > 1)
{
chirendmessage[2].text = chirendmessage[2].text.Substring(0, chirendmessage[2].text.Length - 1);
}
}
}

View File

@ -3,7 +3,9 @@ using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 打开窗帘/窗户
/// </summary>
public class Control_Curtain : MonoBehaviour
{
public static Control_Curtain Instance;
@ -23,32 +25,31 @@ public class Control_Curtain : MonoBehaviour
{
opencurtain.onClick.AddListener(() =>
{
StartCoroutine(Opencurtain());
Opencurtains();
});
}
public void Opencurtains()
{
Opencurtain();
}
/// <summary>
/// 开关窗帘
/// </summary>
/// <returns></returns>
IEnumerator Opencurtain()
void Opencurtain()
{
if (curtain.GetComponent<SkinnedMeshRenderer>().GetBlendShapeWeight(0) == 0)
{
opencurtain.GetComponentInChildren<TextMeshProUGUI>().text = "拉开窗帘";
for (int i = 1; i < 101; i++)
{
curtain.GetComponent<SkinnedMeshRenderer>().SetBlendShapeWeight(0, i);
yield return new WaitForSeconds(0.025f);
}
curtain.GetComponent<Animation>().Play("窗帘开");
}
else if (curtain.GetComponent<SkinnedMeshRenderer>().GetBlendShapeWeight(0) == 100)
{
opencurtain.GetComponentInChildren<TextMeshProUGUI>().text = "拉起窗帘";
for (int i = 100; i >= 0; i--)
{
curtain.GetComponent<SkinnedMeshRenderer>().SetBlendShapeWeight(0, i);
yield return new WaitForSeconds(0.025f);
}
curtain.GetComponent<Animation>().Play("窗帘关");
}
}
}

View File

@ -20,17 +20,17 @@ public class SelectModel : MonoBehaviour
{
environment.onClick.AddListener(() =>
{
region = Region.environment;
region = Region.;
gameObject.SetActive(false);
});
connected_Devices.onClick.AddListener(() =>
{
region = Region.connected_Devices;
region = Region.;
gameObject.SetActive(false);
});
maintenance.onClick.AddListener(() =>
{
region = Region.maintenance;
region = Region.;
gameObject.SetActive(false);
});
}

File diff suppressed because one or more lines are too long