From ccae59d1f2680168f8f105907d54e09ddd6b5cb2 Mon Sep 17 00:00:00 2001
From: wanggang <76527413@qq.com>
Date: Tue, 16 Jul 2019 15:38:47 +0800
Subject: [PATCH] update
Former-commit-id: 609605a8a68ce176a471903cbf2b2002ff5b7d9b
---
labs/IoTClient/Assembly-CSharp.csproj | 1 +
.../Assets/Scenes/VlcPlayerScene.unity | 26 +++++++++----------
labs/IoTClient/Assets/Scripts/ButtonPress.cs | 26 +++++++++++++++++++
.../Assets/Scripts/ButtonPress.cs.meta | 11 ++++++++
.../Assets/Scripts/VlcPlayerController.cs | 17 +++++++++++-
5 files changed, 67 insertions(+), 14 deletions(-)
create mode 100644 labs/IoTClient/Assets/Scripts/ButtonPress.cs
create mode 100644 labs/IoTClient/Assets/Scripts/ButtonPress.cs.meta
diff --git a/labs/IoTClient/Assembly-CSharp.csproj b/labs/IoTClient/Assembly-CSharp.csproj
index efe0d34b..c96e33cf 100644
--- a/labs/IoTClient/Assembly-CSharp.csproj
+++ b/labs/IoTClient/Assembly-CSharp.csproj
@@ -310,6 +310,7 @@
+
diff --git a/labs/IoTClient/Assets/Scenes/VlcPlayerScene.unity b/labs/IoTClient/Assets/Scenes/VlcPlayerScene.unity
index db79ac7e..08571a78 100644
--- a/labs/IoTClient/Assets/Scenes/VlcPlayerScene.unity
+++ b/labs/IoTClient/Assets/Scenes/VlcPlayerScene.unity
@@ -148,9 +148,9 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
- m_AnchoredPosition: {x: -50, y: -30}
- m_SizeDelta: {x: 50, y: 30}
- m_Pivot: {x: 0, y: 0}
+ m_AnchoredPosition: {x: -60, y: -30}
+ m_SizeDelta: {x: 120, y: 60}
+ m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &197350178
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -198,7 +198,7 @@ MonoBehaviour:
m_OnValueChanged:
m_PersistentCalls:
m_Calls:
- - m_Target: {fileID: 0}
+ - m_Target: {fileID: 625678229}
m_MethodName: set_Volume
m_Mode: 0
m_Arguments:
@@ -421,10 +421,10 @@ RectTransform:
m_Father: {fileID: 1627962635}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
- m_AnchorMin: {x: 0, y: 1}
- m_AnchorMax: {x: 0, y: 1}
- m_AnchoredPosition: {x: 10, y: -10}
- m_SizeDelta: {x: 15, y: 15}
+ m_AnchorMin: {x: 0.5, y: 0.5}
+ m_AnchorMax: {x: 0.5, y: 0.5}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 30, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &680623244
MonoBehaviour:
@@ -925,8 +925,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
- m_AnchoredPosition: {x: 60, y: -40}
- m_SizeDelta: {x: 120, y: 80}
+ m_AnchoredPosition: {x: 60, y: -30}
+ m_SizeDelta: {x: 120, y: 60}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1161814043
MonoBehaviour:
@@ -1512,8 +1512,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
- m_AnchoredPosition: {x: -65, y: -15}
- m_SizeDelta: {x: 15, y: 15}
+ m_AnchoredPosition: {x: -160, y: -30}
+ m_SizeDelta: {x: 60, y: 60}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1627962636
MonoBehaviour:
@@ -1558,7 +1558,7 @@ MonoBehaviour:
onValueChanged:
m_PersistentCalls:
m_Calls:
- - m_Target: {fileID: 0}
+ - m_Target: {fileID: 625678229}
m_MethodName: set_Mute
m_Mode: 0
m_Arguments:
diff --git a/labs/IoTClient/Assets/Scripts/ButtonPress.cs b/labs/IoTClient/Assets/Scripts/ButtonPress.cs
new file mode 100644
index 00000000..e656e649
--- /dev/null
+++ b/labs/IoTClient/Assets/Scripts/ButtonPress.cs
@@ -0,0 +1,26 @@
+using UnityEngine;
+using UnityEngine.EventSystems;
+
+public class ButtonPress : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
+{
+ public void OnPointerDown(PointerEventData eventData)
+ {
+ this.Move(eventData.button.ToString(), true);
+ }
+
+ public void OnPointerUp(PointerEventData eventData)
+ {
+ this.Move(eventData.button.ToString(), false);
+ }
+
+ private void Move(string action, bool start)
+ {
+ //var baseUrl = PlayerPrefs
+ if (start)
+ {
+ }
+ else
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/labs/IoTClient/Assets/Scripts/ButtonPress.cs.meta b/labs/IoTClient/Assets/Scripts/ButtonPress.cs.meta
new file mode 100644
index 00000000..b3ee841f
--- /dev/null
+++ b/labs/IoTClient/Assets/Scripts/ButtonPress.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b3ae04fed039aa14a899d2ab7c583abf
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/labs/IoTClient/Assets/Scripts/VlcPlayerController.cs b/labs/IoTClient/Assets/Scripts/VlcPlayerController.cs
index dd7a86d1..2bd9be44 100644
--- a/labs/IoTClient/Assets/Scripts/VlcPlayerController.cs
+++ b/labs/IoTClient/Assets/Scripts/VlcPlayerController.cs
@@ -1,19 +1,34 @@
-using UMP;
+using System;
+using UMP;
using UnityEngine;
using UnityEngine.EventSystems;
+using UnityEngine.UI;
public class VlcPlayerController : MonoBehaviour, IPointerClickHandler
{
public UniversalMediaPlayer player;
+ public Canvas controlCanvas;
private void Start()
{
+ this.controlCanvas.enabled = false;
+ var buttons = controlCanvas.GetComponents