材质修改

This commit is contained in:
康地林 2023-09-18 10:58:15 +08:00
parent e017acf204
commit 04062f18cf
10 changed files with 280 additions and 147 deletions

View File

@ -12,7 +12,6 @@ Material:
m_ValidKeywords: m_ValidKeywords:
- _EMISSION - _EMISSION
- _NORMALMAP - _NORMALMAP
- _SPECGLOSSMAP
m_InvalidKeywords: [] m_InvalidKeywords: []
m_LightmapFlags: 1 m_LightmapFlags: 1
m_EnableInstancingVariants: 0 m_EnableInstancingVariants: 0
@ -60,7 +59,7 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _SpecGlossMap: - _SpecGlossMap:
m_Texture: {fileID: 2800000, guid: c5c247aacad8d25458d64deab8e0b469, type: 3} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
m_Ints: [] m_Ints: []
@ -70,9 +69,9 @@ Material:
- _DetailNormalMapScale: 1 - _DetailNormalMapScale: 1
- _DstBlend: 0 - _DstBlend: 0
- _GlossMapScale: 1 - _GlossMapScale: 1
- _Glossiness: 0.5 - _Glossiness: 1
- _GlossyReflections: 1 - _GlossyReflections: 1
- _Metallic: 0.533 - _Metallic: 0
- _Mode: 0 - _Mode: 0
- _OcclusionStrength: 1 - _OcclusionStrength: 1
- _Parallax: 0.02 - _Parallax: 0.02

View File

@ -11,9 +11,7 @@ Material:
m_Shader: {fileID: 47, guid: 0000000000000000f000000000000000, type: 0} m_Shader: {fileID: 47, guid: 0000000000000000f000000000000000, type: 0}
m_ValidKeywords: m_ValidKeywords:
- _EMISSION - _EMISSION
- _METALLICGLOSSMAP
- _NORMALMAP - _NORMALMAP
- _SPECGLOSSMAP
m_InvalidKeywords: [] m_InvalidKeywords: []
m_LightmapFlags: 1 m_LightmapFlags: 1
m_EnableInstancingVariants: 0 m_EnableInstancingVariants: 0
@ -49,7 +47,7 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _MetallicGlossMap: - _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: d5f54caf270ea3248b7a4b29e2d91922, type: 3} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _OcclusionMap: - _OcclusionMap:
@ -61,7 +59,7 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _SpecGlossMap: - _SpecGlossMap:
m_Texture: {fileID: 2800000, guid: 337bc24cb63a502498f73f3f989a58aa, type: 3} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
m_Ints: [] m_Ints: []
@ -71,7 +69,7 @@ Material:
- _DetailNormalMapScale: 1 - _DetailNormalMapScale: 1
- _DstBlend: 0 - _DstBlend: 0
- _GlossMapScale: 1 - _GlossMapScale: 1
- _Glossiness: 0.5 - _Glossiness: 1
- _GlossyReflections: 1 - _GlossyReflections: 1
- _Metallic: 0 - _Metallic: 0
- _Mode: 0 - _Mode: 0

View File

@ -3234,7 +3234,7 @@ GameObject:
- component: {fileID: 73554405} - component: {fileID: 73554405}
- component: {fileID: 73554408} - component: {fileID: 73554408}
- component: {fileID: 73554407} - component: {fileID: 73554407}
- component: {fileID: 73554406} - component: {fileID: 73554409}
m_Layer: 0 m_Layer: 0
m_Name: "\u94B3\u5F62\u7535\u6D41\u8868" m_Name: "\u94B3\u5F62\u7535\u6D41\u8868"
m_TagString: Untagged m_TagString: Untagged
@ -3263,30 +3263,6 @@ RectTransform:
m_AnchoredPosition: {x: -141, y: 250} m_AnchoredPosition: {x: -141, y: 250}
m_SizeDelta: {x: 203.2128, y: 203.2128} m_SizeDelta: {x: 203.2128, y: 203.2128}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &73554406
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 73554404}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b97fc131199427b429ff1fa4ef30af6f, type: 3}
m_Name:
m_EditorClassIdentifier:
stopValveImage: {fileID: 1948143378}
timeCount: 0
limitTime: 0.1
linearMeasure: 0
index: 0
currentPos: {x: 0, y: 0}
trans: {fileID: 0}
mix: 0
max: 180
X: 0
sum: 0
ZhuanSum: 26
--- !u!114 &73554407 --- !u!114 &73554407
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3325,6 +3301,27 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 73554404} m_GameObject: {fileID: 73554404}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!114 &73554409
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 73554404}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0b7c408bc8b18a74d973d332a824aac6, type: 3}
m_Name:
m_EditorClassIdentifier:
mix: 0
max: 180
initPos: 0
Sum: 0
trans: {fileID: 0}
x: 0
ZhuanSum: 26
isok: 0
btn: {fileID: 1948143381}
--- !u!1001 &74599596 --- !u!1001 &74599596
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -18632,21 +18629,18 @@ MonoBehaviour:
m_GameObject: {fileID: 527382706} m_GameObject: {fileID: 527382706}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b97fc131199427b429ff1fa4ef30af6f, type: 3} m_Script: {fileID: 11500000, guid: 0b7c408bc8b18a74d973d332a824aac6, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
stopValveImage: {fileID: 1752228207}
timeCount: 0
limitTime: 0.1
linearMeasure: 0
index: 0
currentPos: {x: 0, y: 0}
trans: {fileID: 0}
mix: -90 mix: -90
max: 90 max: 90
X: -90 initPos: 0
sum: 90 Sum: 90
trans: {fileID: 0}
x: -90
ZhuanSum: 10 ZhuanSum: 10
isok: 0
btn: {fileID: 1752228209}
--- !u!1 &527421901 --- !u!1 &527421901
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -20753,67 +20747,6 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 322936463316669892, guid: e6024f57cedac6a40be3574b2630b881, type: 3} m_CorrespondingSourceObject: {fileID: 322936463316669892, guid: e6024f57cedac6a40be3574b2630b881, type: 3}
m_PrefabInstance: {fileID: 542974415} m_PrefabInstance: {fileID: 542974415}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1001 &543033771
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 2401820165377604994}
m_Modifications:
- target: {fileID: 6158171241742345501, guid: b3831f69955b0974288d5a6149b06332, type: 3}
propertyPath: m_Name
value: "\u94B3\u5F62\u7535\u6D41\u8868"
objectReference: {fileID: 0}
- target: {fileID: 6158171241742345501, guid: b3831f69955b0974288d5a6149b06332, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8567120291302249890, guid: b3831f69955b0974288d5a6149b06332, type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 8567120291302249890, guid: b3831f69955b0974288d5a6149b06332, type: 3}
propertyPath: m_LocalPosition.x
value: 0.12
objectReference: {fileID: 0}
- target: {fileID: 8567120291302249890, guid: b3831f69955b0974288d5a6149b06332, type: 3}
propertyPath: m_LocalPosition.y
value: 0.46
objectReference: {fileID: 0}
- target: {fileID: 8567120291302249890, guid: b3831f69955b0974288d5a6149b06332, type: 3}
propertyPath: m_LocalPosition.z
value: 0.81
objectReference: {fileID: 0}
- target: {fileID: 8567120291302249890, guid: b3831f69955b0974288d5a6149b06332, type: 3}
propertyPath: m_LocalRotation.w
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8567120291302249890, guid: b3831f69955b0974288d5a6149b06332, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8567120291302249890, guid: b3831f69955b0974288d5a6149b06332, type: 3}
propertyPath: m_LocalRotation.y
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 8567120291302249890, guid: b3831f69955b0974288d5a6149b06332, type: 3}
propertyPath: m_LocalRotation.z
value: -0.7071068
objectReference: {fileID: 0}
- target: {fileID: 8567120291302249890, guid: b3831f69955b0974288d5a6149b06332, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 90
objectReference: {fileID: 0}
- target: {fileID: 8567120291302249890, guid: b3831f69955b0974288d5a6149b06332, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
objectReference: {fileID: 0}
- target: {fileID: 8567120291302249890, guid: b3831f69955b0974288d5a6149b06332, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: b3831f69955b0974288d5a6149b06332, type: 3}
--- !u!1 &543641208 --- !u!1 &543641208
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -47531,16 +47464,6 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 322936463316669892, guid: e6024f57cedac6a40be3574b2630b881, type: 3} m_CorrespondingSourceObject: {fileID: 322936463316669892, guid: e6024f57cedac6a40be3574b2630b881, type: 3}
m_PrefabInstance: {fileID: 1223025199} m_PrefabInstance: {fileID: 1223025199}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &1223518924 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6158171241742345501, guid: b3831f69955b0974288d5a6149b06332, type: 3}
m_PrefabInstance: {fileID: 543033771}
m_PrefabAsset: {fileID: 0}
--- !u!4 &1223518925 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 8567120291302249890, guid: b3831f69955b0974288d5a6149b06332, type: 3}
m_PrefabInstance: {fileID: 543033771}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1223603105 --- !u!1 &1223603105
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -66743,6 +66666,7 @@ GameObject:
- component: {fileID: 1752228206} - component: {fileID: 1752228206}
- component: {fileID: 1752228208} - component: {fileID: 1752228208}
- component: {fileID: 1752228207} - component: {fileID: 1752228207}
- component: {fileID: 1752228209}
m_Layer: 0 m_Layer: 0
m_Name: Image m_Name: Image
m_TagString: Untagged m_TagString: Untagged
@ -66808,6 +66732,50 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1752228205} m_GameObject: {fileID: 1752228205}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!114 &1752228209
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1752228205}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 0
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_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, 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_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 1752228207}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!1001 &1752780400 --- !u!1001 &1752780400
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -74038,6 +74006,7 @@ GameObject:
- component: {fileID: 1948143377} - component: {fileID: 1948143377}
- component: {fileID: 1948143379} - component: {fileID: 1948143379}
- component: {fileID: 1948143378} - component: {fileID: 1948143378}
- component: {fileID: 1948143381}
m_Layer: 0 m_Layer: 0
m_Name: Image m_Name: Image
m_TagString: Untagged m_TagString: Untagged
@ -74103,6 +74072,50 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1948143376} m_GameObject: {fileID: 1948143376}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!114 &1948143381
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1948143376}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 0
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_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, 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_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 1948143378}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!1 &1952119706 --- !u!1 &1952119706
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -75182,10 +75195,10 @@ MonoBehaviour:
- {fileID: 6770620356190950818, guid: 459f4a583dbdc294c8b8fe46bee0e180, type: 3} - {fileID: 6770620356190950818, guid: 459f4a583dbdc294c8b8fe46bee0e180, type: 3}
trans: {fileID: 0} trans: {fileID: 0}
WanStopValve: {fileID: 527382710} WanStopValve: {fileID: 527382710}
QianStopValve: {fileID: 73554406} QianStopValve: {fileID: 73554409}
NiBianQi: {fileID: 696764695} NiBianQi: {fileID: 696764695}
XiangWeiUI: {fileID: 1677353491} XiangWeiUI: {fileID: 1677353491}
temp: {fileID: 1223518924} temp: {fileID: 0}
interactive: [] interactive: []
RedWanYon: {fileID: 0} RedWanYon: {fileID: 0}
BlackWanYon: {fileID: 0} BlackWanYon: {fileID: 0}
@ -93089,7 +93102,6 @@ Transform:
- {fileID: 4250994750885528242} - {fileID: 4250994750885528242}
- {fileID: 4250994751310936222} - {fileID: 4250994751310936222}
- {fileID: 2401820166598484376} - {fileID: 2401820166598484376}
- {fileID: 1223518925}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 83.982, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 83.982, z: 0}

View File

@ -24,8 +24,8 @@ public class GameManager : MonoBehaviour
[SerializeField] SceneData SceneData;//暂时数据 [SerializeField] SceneData SceneData;//暂时数据
[SerializeField] List<GameObject> Inverter; [SerializeField] List<GameObject> Inverter;
[SerializeField] Transform trans; [SerializeField] Transform trans;
public StopValve WanStopValve;//万用表UI旋钮 public StopValveGai WanStopValve;//万用表UI旋钮
public StopValve QianStopValve;//钳形表UI旋钮 public StopValveGai QianStopValve;//钳形表UI旋钮
[SerializeField] GameObject NiBianQi; [SerializeField] GameObject NiBianQi;
[SerializeField] Image XiangWeiUI;//相位UI [SerializeField] Image XiangWeiUI;//相位UI
public GameObject temp; public GameObject temp;

View File

@ -39,7 +39,7 @@ public class ClampAmmetersInteractive : MonoBehaviour
for (int i = 0; i < floats.Count; i++) for (int i = 0; i < floats.Count; i++)
{ {
if (floats[(int)(GameManager.ins.QianStopValve.linearMeasure / 10)]> linearMeasure) if (floats[(int)(GameManager.ins.QianStopValve.Sum / 10)]> linearMeasure)
{ {
GetComponent<Fraction>().CompletedorNot = true; GetComponent<Fraction>().CompletedorNot = true;
} }

View File

@ -3,7 +3,7 @@ using UnityEngine;
using UnityEngine.EventSystems; using UnityEngine.EventSystems;
using UnityEngine.UI; using UnityEngine.UI;
public class StopValve : MonoBehaviour, IBeginDragHandler, IEndDragHandler, IDragHandler public class StopValve : MonoBehaviour, IBeginDragHandler, IEndDragHandler, /*IDragHandler,*/ IPointerClickHandler
{ {
private Vector3 start = new Vector3(0, 0, -80); private Vector3 start = new Vector3(0, 0, -80);
//滑动点到阀门图片中点的向量 //滑动点到阀门图片中点的向量
@ -32,29 +32,42 @@ public class StopValve : MonoBehaviour, IBeginDragHandler, IEndDragHandler, IDra
public void OnBeginDrag(PointerEventData eventData) public void OnBeginDrag(PointerEventData eventData)
{ {
currentPos = transform.position; //currentPos = transform.position;
//sum = (int)linearMeasure;
} }
/// <summary> ///// <summary>
/// 拖拽中 ///// 拖拽中
/// </summary> ///// </summary>
/// <param name="eventData"></param> ///// <param name="eventData"></param>
public void OnDrag(PointerEventData eventData) //public void OnDrag(PointerEventData eventData)
//{
// timeCount += Time.deltaTime;
// if (timeCount > limitTime)
// {
// float x = Input.GetAxis("Mouse X");
// float y = Input.GetAxis("Mouse Y");
// if (x != 0 || y != 0)
// {
// if (x > 0 || y > 0)
// {
// sum = ZhuanSum;
// }
// else if (x < 0 || y < 0)
// {
// sum = -ZhuanSum;
// }
// }
// Debug.Log("旋转的方法"+x+" "+y);
// Deng(sum);
// timeCount = 0;
// }
//}
void Update()
{ {
timeCount += Time.deltaTime; if (true)
if (timeCount > limitTime)
{ {
if (currentPos.x - eventData.position.x > 0)
{
sum += ZhuanSum;
}
if (currentPos.x - eventData.position.x < 0)
{
sum += -ZhuanSum;
}
Debug.Log("旋转的方法");
Deng(sum);
timeCount = 0;
} }
} }
void Deng(float angle) void Deng(float angle)
@ -82,4 +95,38 @@ public class StopValve : MonoBehaviour, IBeginDragHandler, IEndDragHandler, IDra
{ {
timeCount = 0; timeCount = 0;
} }
public void OnPointerClick(PointerEventData eventData)
{
//timeCount += Time.deltaTime;
//if (timeCount > limitTime)
//{
//float x = Input.GetAxis("Mouse X");
//float y = Input.GetAxis("Mouse Y");
//if (x != 0 || y != 0)
//{
// if (x > 0 || y > 0)
// {
// sum = ZhuanSum;
// }
// else if (x < 0 || y < 0)
// {
// sum = -ZhuanSum;
// }
//}
//Debug.Log("旋转的方法" + x + " " + y);
//Deng(sum);
int z = (int)linearMeasure;
if (z % max != 0)
{
z += ZhuanSum;
}
else
{
z = mix;
}
Deng(z);
// timeCount = 0;
//}
}
} }

View File

@ -0,0 +1,66 @@
using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class StopValveGai : MonoBehaviour
{
[SerializeField] int mix;
[SerializeField] int max;
[SerializeField] float initPos;
public float Sum;
public Transform trans;
[SerializeField] float x;
[SerializeField] int ZhuanSum;//要旋转一次的角度
[SerializeField] bool isok = false;
[SerializeField] Button btn;
// Start is called before the first frame update
void Start()
{
btn.onClick.AddListener(() =>
{
if (!isok)
{
if (Sum < max)
{
Sum += ZhuanSum;
}
else
{
isok = true;
}
}
else
{
if (Sum > mix)
{
Sum -= ZhuanSum;
}
else
{
isok = false;
}
}
Deng(Sum);
});
}
void Deng(float angle)
{
float z = Mathf.Clamp(angle, mix, max);
btn.transform.eulerAngles = new Vector3(0, 0, z);
Sum = z;
if (transform.name.Equals("万用表"))
{
trans.DOLocalRotate(new Vector3(x, 0, ~(int)z), 0.01f);
}
else
{
trans.DOLocalRotate(new Vector3(x, ~(int)z, 0), 0.01f);
}
//Debug.Log(Mathf.Clamp(~(int)z, mix, max));
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0b7c408bc8b18a74d973d332a824aac6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -35,12 +35,12 @@
"source": "builtin", "source": "builtin",
"dependencies": { "dependencies": {
"com.unity.ide.visualstudio": "2.0.16", "com.unity.ide.visualstudio": "2.0.16",
"com.unity.ide.rider": "3.0.15", "com.unity.ide.rider": "3.0.16",
"com.unity.ide.vscode": "1.2.5", "com.unity.ide.vscode": "1.2.5",
"com.unity.editorcoroutines": "1.0.0", "com.unity.editorcoroutines": "1.0.0",
"com.unity.performance.profile-analyzer": "1.1.1", "com.unity.performance.profile-analyzer": "1.1.1",
"com.unity.test-framework": "1.1.31", "com.unity.test-framework": "1.1.31",
"com.unity.testtools.codecoverage": "1.0.1" "com.unity.testtools.codecoverage": "1.2.2"
} }
}, },
"com.unity.ide.rider": { "com.unity.ide.rider": {
@ -92,7 +92,7 @@
"url": "https://packages.unity.cn" "url": "https://packages.unity.cn"
}, },
"com.unity.services.core": { "com.unity.services.core": {
"version": "1.4.2", "version": "1.6.0",
"depth": 1, "depth": 1,
"source": "registry", "source": "registry",
"dependencies": { "dependencies": {
@ -121,7 +121,7 @@
"url": "https://packages.unity.cn" "url": "https://packages.unity.cn"
}, },
"com.unity.testtools.codecoverage": { "com.unity.testtools.codecoverage": {
"version": "1.0.1", "version": "1.2.2",
"depth": 1, "depth": 1,
"source": "registry", "source": "registry",
"dependencies": { "dependencies": {

View File

@ -1,2 +1,2 @@
m_EditorVersion: 2021.3.10f1c2 m_EditorVersion: 2021.3.15f1c1
m_EditorVersionWithRevision: 2021.3.10f1c2 (5a059dbcdda5) m_EditorVersionWithRevision: 2021.3.15f1c1 (080beb55ecda)