骑行视角手势&移除按钮音效
This commit is contained in:
parent
c8c27bd021
commit
fc55360be0
File diff suppressed because it is too large
Load Diff
@ -352,16 +352,13 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
//移动摄像头
|
//移动摄像头
|
||||||
public void MoveCamera()
|
public void MoveCamera()
|
||||||
{
|
{
|
||||||
if (target != null)
|
if (target != null && mainController.Is3dView && mainController.RotateLock && mainController.currentPlayer.Speed > 0)
|
||||||
{
|
{
|
||||||
if (mainController.Is3dView)
|
Vector3 v = Vector3.zero;
|
||||||
|
v.y += mainController.currentPlayer.currentRotation.eulerAngles.y + 160f;
|
||||||
|
if (mainController.RotateLock)
|
||||||
{
|
{
|
||||||
if(mainController.RotateLock && mainController.currentPlayer.Speed > 0)
|
target.transform.DOLocalRotate(v, 1f, RotateMode.Fast);
|
||||||
{
|
|
||||||
Vector3 v = Vector3.zero;
|
|
||||||
v.y += mainController.currentPlayer.currentRotation.eulerAngles.y + 160f; //target.transform.rotation = playerController.transform.rotation;//new Quaternion(playerController.transform.rotation.x, playerController.transform.rotation.y +1f, playerController.transform.rotation.z, playerController.transform.rotation.w);
|
|
||||||
target.transform.DOLocalRotate(v, 1.5f, RotateMode.FastBeyond360);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -378,7 +375,8 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
//mainController.player.transform.localScale.Set(0.1f, 0.1f, 0.1f);
|
//mainController.player.transform.localScale.Set(0.1f, 0.1f, 0.1f);
|
||||||
player.transform.localScale = m;
|
player.transform.localScale = m;
|
||||||
}
|
}
|
||||||
target.transform.DOLocalMove(mainController.currentPlayer.currentPos, 0.5f); //player.transform.position;// new Vector3((float)Math.Round(player.transform.position.x,1), 0, (float)Math.Round(player.transform.position.z,1));
|
target.transform.position = mainController.currentPlayer.currentPos;
|
||||||
|
//target.transform.DOLocalMove(mainController.currentPlayer.currentPos, 0.5f); //player.transform.position;// new Vector3((float)Math.Round(player.transform.position.x,1), 0, (float)Math.Round(player.transform.position.z,1));
|
||||||
//控制照片移动
|
//控制照片移动
|
||||||
((RectTransform)arrow.transform).position = Camera.main.WorldToScreenPoint(target.transform.position);
|
((RectTransform)arrow.transform).position = Camera.main.WorldToScreenPoint(target.transform.position);
|
||||||
if (mainController.currentPlayer.Speed > 0 && mainController.isStart)
|
if (mainController.currentPlayer.Speed > 0 && mainController.isStart)
|
||||||
|
|||||||
@ -24,6 +24,7 @@ using UnityEngine.UI;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
|
using System.Timers;
|
||||||
|
|
||||||
public class CyclingController : DeviceServiceMonoBase
|
public class CyclingController : DeviceServiceMonoBase
|
||||||
{
|
{
|
||||||
@ -174,6 +175,8 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
|
|
||||||
public bool RotateLock = true;
|
public bool RotateLock = true;
|
||||||
|
|
||||||
|
private bool touchLock = true;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
var uicanvasScaler = UIObject.GetComponent<CanvasScaler>();
|
var uicanvasScaler = UIObject.GetComponent<CanvasScaler>();
|
||||||
@ -233,26 +236,7 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
|
|
||||||
SceneManager.activeSceneChanged += SceneManager_activeSceneChanged;
|
SceneManager.activeSceneChanged += SceneManager_activeSceneChanged;
|
||||||
|
|
||||||
#region 手势移动&PC鼠标的控制
|
HandleTouchAndInput();
|
||||||
|
|
||||||
var rotationRecognizer = new TKOneFingerRotationRecognizer
|
|
||||||
{
|
|
||||||
targetPosition = Camera.main.WorldToScreenPoint(target.position)
|
|
||||||
};
|
|
||||||
rotationRecognizer.gestureRecognizedEvent += (r) =>
|
|
||||||
{
|
|
||||||
RotateLock = false;
|
|
||||||
DOTween.KillAll();
|
|
||||||
if (Is3dView && IsPointerOverGameObject(r.startTouchLocation()))
|
|
||||||
target.transform.Rotate(new Vector3(0, 1, 0), r.deltaRotation);
|
|
||||||
};
|
|
||||||
rotationRecognizer.gestureCompleteEvent += (r) => {
|
|
||||||
RotateLock = true;
|
|
||||||
};
|
|
||||||
TouchKit.addGestureRecognizer(rotationRecognizer);
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
//进入比赛
|
//进入比赛
|
||||||
if (competitionId > 0)
|
if (competitionId > 0)
|
||||||
{
|
{
|
||||||
@ -277,6 +261,92 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
{
|
{
|
||||||
ClearTempFile();
|
ClearTempFile();
|
||||||
}
|
}
|
||||||
|
#region 手势移动&PC鼠标的控制
|
||||||
|
private void HandleTouchAndInput()
|
||||||
|
{
|
||||||
|
var rotationRecognizer = new TKOneFingerRotationRecognizer
|
||||||
|
{
|
||||||
|
targetPosition = Camera.main.WorldToScreenPoint(target.position)
|
||||||
|
};
|
||||||
|
rotationRecognizer.gestureRecognizedEvent += (r) =>
|
||||||
|
{
|
||||||
|
if (Is3dView && IsPointerOverGameObject(r.startTouchLocation()))
|
||||||
|
{
|
||||||
|
RotateLock = false;
|
||||||
|
DOTween.Kill(target);
|
||||||
|
target.transform.Rotate(new Vector3(0, 1, 0), r.deltaRotation);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var timer = new Timer
|
||||||
|
{
|
||||||
|
Interval = 1000
|
||||||
|
};
|
||||||
|
timer.Elapsed += (s, e) =>
|
||||||
|
{
|
||||||
|
RotateLock = true;
|
||||||
|
timer.Stop();
|
||||||
|
};
|
||||||
|
|
||||||
|
rotationRecognizer.gestureCompleteEvent += (r) => {
|
||||||
|
UnityEngine.Debug.Log("gestureCompleteEvent");
|
||||||
|
timer.Start();
|
||||||
|
};
|
||||||
|
|
||||||
|
TouchKit.addGestureRecognizer(rotationRecognizer);
|
||||||
|
//单指
|
||||||
|
var touchRecognizer = new TKAnyTouchRecognizer(new TKRect(0, 0, Screen.width, Screen.height));
|
||||||
|
DateTime startTimpStamp = DateTime.Now;
|
||||||
|
touchRecognizer.onEnteredEvent += (r) =>
|
||||||
|
{
|
||||||
|
startTimpStamp = DateTime.Now;
|
||||||
|
};
|
||||||
|
touchRecognizer.onExitedEvent += (r) =>
|
||||||
|
{
|
||||||
|
if (competitionId == 0 && isStart && IsPointerOverGameObject(r.startTouchLocation()))
|
||||||
|
{
|
||||||
|
var timespan = DateTime.Now - startTimpStamp;
|
||||||
|
UnityEngine.Debug.Log($"{timespan.TotalMilliseconds}");
|
||||||
|
if (timespan.TotalMilliseconds <= 120)
|
||||||
|
{
|
||||||
|
singleUIManager?.ClearPanel(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
TouchKit.addGestureRecognizer(touchRecognizer);
|
||||||
|
//双指
|
||||||
|
var PinchRecognizer = new TKPinchRecognizer();
|
||||||
|
PinchRecognizer.gestureRecognizedEvent += (r) =>
|
||||||
|
{
|
||||||
|
if (Is3dView && IsPointerOverGameObject(PinchRecognizer.startTouchLocation()))
|
||||||
|
{
|
||||||
|
if (cameraList == null)
|
||||||
|
{
|
||||||
|
cameraList = new List<Vector3>();
|
||||||
|
cameraList.Add(near);
|
||||||
|
cameraList.Add(plane);
|
||||||
|
cameraList.Add(far);
|
||||||
|
}
|
||||||
|
var prePos = Camera.main.transform.localPosition;
|
||||||
|
var nextPos = Camera.main.transform.localPosition;
|
||||||
|
if (r.deltaScale < 0)
|
||||||
|
{
|
||||||
|
nextPos = cameraList.Where(c => c.y > Camera.main.transform.localPosition.y).FirstOrDefault();
|
||||||
|
if (nextPos != Vector3.zero)
|
||||||
|
Camera.main.transform.DOLocalMove(nextPos, 0.5f);
|
||||||
|
//StartCoroutine(MoveCamera(prePos, nextPos));
|
||||||
|
}
|
||||||
|
if (r.deltaScale > 0)
|
||||||
|
{
|
||||||
|
nextPos = cameraList.Where(c => c.y < Camera.main.transform.localPosition.y).LastOrDefault();
|
||||||
|
if (nextPos != Vector3.zero)
|
||||||
|
Camera.main.transform.DOLocalMove(nextPos, 0.5f);
|
||||||
|
//StartCoroutine(MoveCamera(prePos, nextPos));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
TouchKit.addGestureRecognizer(PinchRecognizer);
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 检测是否点击UI
|
/// 检测是否点击UI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -299,6 +369,8 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
bool _dragStartedOnUI = false;
|
bool _dragStartedOnUI = false;
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
@ -333,23 +405,14 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
float touchTimer = 0.1f;
|
float touchTimer = 0.1f;
|
||||||
private void FixedUpdate()
|
private void FixedUpdate()
|
||||||
{
|
{
|
||||||
touchTimer -= Time.deltaTime;
|
|
||||||
if (touchTimer <= 0)
|
|
||||||
{
|
|
||||||
#if UNITY_IOS || UNITY_ANDROID
|
|
||||||
HandleTouch();
|
|
||||||
#else
|
|
||||||
HandleMouseScrollWheel();
|
HandleMouseScrollWheel();
|
||||||
#endif
|
|
||||||
touchTimer += 0.1f;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public bool isWatch { get; set; }
|
public bool isWatch { get; set; }
|
||||||
private Vector3 currentCameraPos { get; set; }
|
private Vector3 currentCameraPos { get; set; }
|
||||||
|
|
||||||
Vector3 far = new Vector3(-25, 73, -70);
|
Vector3 far = new Vector3(-18, 53, -48);
|
||||||
Vector3 plane = new Vector3(-15, 43, -40);
|
Vector3 plane = new Vector3(-15, 43, -40);
|
||||||
Vector3 near = new Vector3(-8, 23, -20);
|
Vector3 near = new Vector3(-12, 35, -30);
|
||||||
List<Vector3> cameraList { get; set; }
|
List<Vector3> cameraList { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -373,14 +436,16 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
{
|
{
|
||||||
nextPos = cameraList.Where(c => c.y > Camera.main.transform.localPosition.y).FirstOrDefault();
|
nextPos = cameraList.Where(c => c.y > Camera.main.transform.localPosition.y).FirstOrDefault();
|
||||||
if (nextPos != Vector3.zero)
|
if (nextPos != Vector3.zero)
|
||||||
StartCoroutine(MoveCamera(prePos, nextPos));
|
Camera.main.transform.DOLocalMove(nextPos, 0.5f);
|
||||||
|
//StartCoroutine(MoveCamera(prePos, nextPos));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scrollDelta > 0)
|
if (scrollDelta > 0)
|
||||||
{
|
{
|
||||||
nextPos = cameraList.Where(c => c.y < Camera.main.transform.localPosition.y).LastOrDefault();
|
nextPos = cameraList.Where(c => c.y < Camera.main.transform.localPosition.y).LastOrDefault();
|
||||||
if (nextPos != Vector3.zero)
|
if (nextPos != Vector3.zero)
|
||||||
StartCoroutine(MoveCamera(prePos, nextPos));
|
Camera.main.transform.DOLocalMove(nextPos, 0.5f);
|
||||||
|
//StartCoroutine(MoveCamera(prePos, nextPos));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void HandleTouch()
|
private void HandleTouch()
|
||||||
@ -432,13 +497,15 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
{
|
{
|
||||||
nextPos = cameraList.Where(c => c.y > Camera.main.transform.localPosition.y).FirstOrDefault();
|
nextPos = cameraList.Where(c => c.y > Camera.main.transform.localPosition.y).FirstOrDefault();
|
||||||
if (nextPos != Vector3.zero)
|
if (nextPos != Vector3.zero)
|
||||||
StartCoroutine(MoveCamera(prePos, nextPos));
|
Camera.main.transform.DOLocalMove(nextPos, 0.5f);
|
||||||
|
//StartCoroutine(MoveCamera(prePos, nextPos));
|
||||||
}
|
}
|
||||||
if (offset > 0)
|
if (offset > 0)
|
||||||
{
|
{
|
||||||
nextPos = cameraList.Where(c => c.y < Camera.main.transform.localPosition.y).LastOrDefault();
|
nextPos = cameraList.Where(c => c.y < Camera.main.transform.localPosition.y).LastOrDefault();
|
||||||
if (nextPos != Vector3.zero)
|
if (nextPos != Vector3.zero)
|
||||||
StartCoroutine(MoveCamera(prePos, nextPos));
|
Camera.main.transform.DOLocalMove(nextPos, 0.5f);
|
||||||
|
//StartCoroutine(MoveCamera(prePos, nextPos));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -697,22 +764,12 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
chartDataSourceScript.InitHorizontalScrolling(index);
|
chartDataSourceScript.InitHorizontalScrolling(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator MoveCamera(Vector3 prePos, Vector3 nextPos)
|
|
||||||
{
|
|
||||||
float t = 0;
|
|
||||||
while (t < 0.37f)
|
|
||||||
{
|
|
||||||
t += Time.deltaTime;
|
|
||||||
Vector3 v = Vector3.Lerp(prePos, nextPos, t);
|
|
||||||
Camera.main.transform.localPosition = v;
|
|
||||||
yield return new WaitForEndOfFrame();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//SingleUIManager singleUIManager;
|
//SingleUIManager singleUIManager;
|
||||||
public BaseUIManager singleUIManager;
|
public BaseUIManager singleUIManager;
|
||||||
public void GameStart()
|
public void GameStart()
|
||||||
{
|
{
|
||||||
StartCoroutine(MoveCamera(far, plane));//初始摄像头
|
Camera.main.transform.DOLocalMove(near, 1.5f);
|
||||||
|
//StartCoroutine(MoveCamera(far, near));//初始摄像头
|
||||||
var check = CheckAnt();
|
var check = CheckAnt();
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
check = true;
|
check = true;
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using Assets.Scenes.Ride.Scripts.Model;
|
using Assets.Scenes.Ride.Scripts.Model;
|
||||||
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
@ -89,12 +90,17 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
if (cyclingController.currentPlayer.UserId == item.Id)
|
if (cyclingController.currentPlayer.UserId == item.Id)
|
||||||
{
|
{
|
||||||
nearByItemscript.setHead(item.Headimage);
|
nearByItemscript.setHead(item.Headimage);
|
||||||
|
nearByItemscript.transform.SetAsFirstSibling();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nearByItemscript.transform.SetSiblingIndex((int)Math.Ceiling(item.Near));
|
||||||
}
|
}
|
||||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||||
nearByItemscript.setCountry(cyclingController.GetCountryImageByName(item.Country));
|
nearByItemscript.setCountry(cyclingController.GetCountryImageByName(item.Country));
|
||||||
#endif
|
#endif
|
||||||
nearByItemscript.setDistance(item.Near.ToString() + "KM");
|
nearByItemscript.setDistance(item.Near.ToString() + "KM");
|
||||||
nearByItemscript.transform.SetSiblingIndex((int)item.Near);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,8 +26,8 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
currentlatlong = mainController.GetCenterCoordinate();
|
currentlatlong = mainController.GetCenterCoordinate();
|
||||||
uipanel = mainController.GetUIPanel();
|
uipanel = mainController.GetUIPanel();
|
||||||
trail = FindObjectOfType<TrailRenderer>();
|
trail = FindObjectOfType<TrailRenderer>();
|
||||||
trail.startWidth = 1f;
|
trail.startWidth = 0.5f;
|
||||||
trail.endWidth = 1f;
|
trail.endWidth = 0.5f;
|
||||||
trail.startColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 1f);
|
trail.startColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 1f);
|
||||||
trail.endColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 1f);
|
trail.endColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 1f);
|
||||||
//var color7 = Resources.Load<Material>("UI/Material/color7");
|
//var color7 = Resources.Load<Material>("UI/Material/color7");
|
||||||
@ -60,9 +60,9 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
cadance = mainController.UpdateCadence();
|
cadance = mainController.UpdateCadence();
|
||||||
weight = App.CurrentUser.Weight;
|
weight = App.CurrentUser.Weight;
|
||||||
bicycleWeight = App.CurrentUser.BicycleWeight;
|
bicycleWeight = App.CurrentUser.BicycleWeight;
|
||||||
#if UNITY_EDITOR
|
//#if UNITY_EDITOR
|
||||||
power = 1430;
|
power = 1430;
|
||||||
#endif
|
//#endif
|
||||||
mainController.TrackResistance(currentSlope * App.RideSetting.Sensitivity / 100);
|
mainController.TrackResistance(currentSlope * App.RideSetting.Sensitivity / 100);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@ -203,13 +203,13 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
lineRender.startColor = new Color(1, 1, 1, 0.65f);
|
lineRender.startColor = new Color(1, 1, 1, 0.65f);
|
||||||
|
|
||||||
//设置宽度
|
//设置宽度
|
||||||
lineRender.startWidth = 1.5f;
|
lineRender.startWidth = 1f;
|
||||||
lineRender.endWidth = 1.5f;
|
lineRender.endWidth = 1f;
|
||||||
lineRender.positionCount = dat.Count;
|
lineRender.positionCount = dat.Count;
|
||||||
lineRender.SetPositions(feat.Points[0].ToArray());
|
lineRender.SetPositions(feat.Points[0].ToArray());
|
||||||
lineRender.loop = false;
|
lineRender.loop = false;
|
||||||
lineRender.numCapVertices = 10;
|
lineRender.numCapVertices = 10;
|
||||||
//lineRender.numCornerVertices = 30;
|
lineRender.numCornerVertices = 30;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -231,13 +231,13 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
lineRender.startColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 0.65f);
|
lineRender.startColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 0.65f);
|
||||||
|
|
||||||
//设置宽度
|
//设置宽度
|
||||||
lineRender.startWidth = 1f;
|
lineRender.startWidth = 0.5f;
|
||||||
lineRender.endWidth = 1f;
|
lineRender.endWidth = 0.5f;
|
||||||
lineRender.positionCount = feat.Count;
|
lineRender.positionCount = feat.Count;
|
||||||
lineRender.SetPositions(feat.ToArray());
|
lineRender.SetPositions(feat.ToArray());
|
||||||
lineRender.loop = false;
|
lineRender.loop = false;
|
||||||
lineRender.numCapVertices = 10;
|
lineRender.numCapVertices = 10;
|
||||||
//lineRender.numCornerVertices = 10;
|
lineRender.numCornerVertices = 10;
|
||||||
//
|
//
|
||||||
lineRender.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
|
lineRender.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
|
||||||
lineRender.allowOcclusionWhenDynamic = false;
|
lineRender.allowOcclusionWhenDynamic = false;
|
||||||
|
|||||||
@ -925,12 +925,12 @@ public class UIManager : MonoBehaviour
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (eventTriggerType == EventTriggerType.PointerClick)
|
//if (eventTriggerType == EventTriggerType.PointerClick)
|
||||||
{
|
//{
|
||||||
var audioSource = gameObject.GetComponent<AudioSource>();
|
// var audioSource = gameObject.GetComponent<AudioSource>();
|
||||||
if (audioSource != null)
|
// if (audioSource != null)
|
||||||
audioSource.PlayOneShot(buttonClip);
|
// audioSource.PlayOneShot(buttonClip);
|
||||||
}
|
//}
|
||||||
call(e);
|
call(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -942,17 +942,17 @@ public class UIManager : MonoBehaviour
|
|||||||
{
|
{
|
||||||
cursor = Resources.Load<Texture2D>("Images/PointerButtonHover");
|
cursor = Resources.Load<Texture2D>("Images/PointerButtonHover");
|
||||||
}
|
}
|
||||||
//设置点击音效
|
////设置点击音效
|
||||||
if (buttonClip == null)
|
//if (buttonClip == null)
|
||||||
{
|
//{
|
||||||
buttonClip = Resources.Load<AudioClip>("audio/高科技UI点击触控警告提示反馈APP菜单UI-很酷的应用程序_爱给网_aigei_com");
|
// buttonClip = Resources.Load<AudioClip>("audio/高科技UI点击触控警告提示反馈APP菜单UI-很酷的应用程序_爱给网_aigei_com");
|
||||||
}
|
//}
|
||||||
var audioSource = gameObject.GetComponent<AudioSource>();
|
//var audioSource = gameObject.GetComponent<AudioSource>();
|
||||||
if (audioSource == null)
|
//if (audioSource == null)
|
||||||
{
|
//{
|
||||||
audioSource = gameObject.AddComponent<AudioSource>();
|
// audioSource = gameObject.AddComponent<AudioSource>();
|
||||||
}
|
//}
|
||||||
audioSource.volume = 0.5f;
|
//audioSource.volume = 0.5f;
|
||||||
|
|
||||||
UIManager.AddEvent(gameObject, EventTriggerType.PointerEnter, (e) =>
|
UIManager.AddEvent(gameObject, EventTriggerType.PointerEnter, (e) =>
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user