Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble
This commit is contained in:
commit
8a4657c11c
48 files changed
+4180
-2908
No files matched your search
@@ -11,7 +11,7 @@ using Assets.Scripts.Devices;
|
||||
|
||||
public static class App
|
||||
{
|
||||
public static string Host = "http://192.168.0.102:5082/";
|
||||
public static string Host = "http://192.168.0.101:5184/";
|
||||
|
||||
public static string AppVersion = Application.version;
|
||||
|
||||
@@ -76,11 +76,14 @@ public static class App
|
||||
public static float? topRectStartX { get; internal set; }
|
||||
|
||||
public static WeChatController weChatController = WeChatController.Instance;
|
||||
|
||||
public static ImageSelectorController imageSelectorController = ImageSelectorController.Instance;
|
||||
public static Vector2 MobileResolution = new Vector2(844f, 390f);//移动端分辨率
|
||||
public static Vector2 PcResolution = new Vector2(1600f, 900f);//PC端分辨率
|
||||
public static int autoClearTimes = 30;
|
||||
static App()
|
||||
public readonly static double width = Screen.width;
|
||||
public readonly static double height = Screen.height;
|
||||
public readonly static bool isFullScreen = width/height>1.8;
|
||||
static App()
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
//Host = "http://pf.juze.pro/";
|
||||
|
||||
@@ -1,47 +1,46 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Create By Jooki: https://www.yuque.com/jooki
|
||||
/// 使用流程:
|
||||
/// WeChatController是一个单例, 请自行给变量 _className 赋值
|
||||
/// 使用前先调用 Init() 进行初始化,然后调用 IsWeChatAppInstalled() 检查用户设备上是否安装了微信;
|
||||
/// 之后为保险起见调用 IsWeChatAppInstalled() 判断微信是否已经安装;
|
||||
/// 最后就是按照需要分享的消息类型调用对应的方法
|
||||
///
|
||||
/// </summary>
|
||||
public class ImageSelectorController
|
||||
{
|
||||
/// <summary>
|
||||
/// com.unityplugins.wechatshare是在Android Studio中创建的 Module,
|
||||
/// MainActivity 是一个Activity, 对外供C#调用的方法都写在这个Activity内
|
||||
/// </summary>
|
||||
private readonly string _className = "com.unityplugins.imageSelector.MainActivity";
|
||||
private AndroidJavaClass mainActivityClass = null;
|
||||
|
||||
private AndroidJavaObject mainActivityObject = null;
|
||||
#if UNITY_IOS
|
||||
[DllImport("__Internal")]
|
||||
private static extern void IOS_OpenCamera();
|
||||
[DllImport("__Internal")]
|
||||
private static extern void IOS_OpenAlbum();
|
||||
#endif
|
||||
private static ImageSelectorController _instance;
|
||||
public static ImageSelectorController Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = new ImageSelectorController();
|
||||
}
|
||||
#endif
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
private ImageSelectorController()
|
||||
{
|
||||
#if UNITY_ANDROID
|
||||
mainActivityClass = new AndroidJavaClass(_className);
|
||||
// 第一个参数: MainActivity中的方法名
|
||||
// 第二、三个参数: 分别是SendMessageToUnity需要接收的第一和第二个参数,对比上面Java的代码
|
||||
AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
|
||||
mainActivityObject = jc.GetStatic<AndroidJavaObject>("currentActivity");
|
||||
#elif UNITY_IOS
|
||||
//RegisterApp(_APP_ID);
|
||||
#endif
|
||||
}
|
||||
public void Select()
|
||||
{
|
||||
mainActivityClass.CallStatic("Select");
|
||||
#if UNITY_IOS
|
||||
IOS_OpenAlbum();
|
||||
#else
|
||||
mainActivityObject.Call("Select");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,6 @@ public class MainController : BaseScene
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
|
||||
Version = this.transform.Find("GameObject").Find("Version").GetComponent<Text>();
|
||||
Version.text = "V"+App.AppVersion;
|
||||
DeviceCache.Init(PFConstants.DeviceCacheFolder);
|
||||
|
||||
@@ -75,26 +75,32 @@ public class FeedbackController : PFUIPanel
|
||||
main.Find("Time").Find("Value").Find("Text").GetComponent<Text>().text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
GameObject selectObject = null;
|
||||
void AddImage(BaseEventData e,int index)
|
||||
{
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
//App.ImageSelectorController.Select();
|
||||
#else
|
||||
selectObject = ((PointerEventData)e).pointerEnter;
|
||||
App.imageSelectorController.Select();
|
||||
#else
|
||||
var self = ((PointerEventData)e).pointerEnter;
|
||||
Utils.OpenFile((path) =>
|
||||
{
|
||||
if (paths.ContainsValue(path))
|
||||
{
|
||||
Utils.showToast(gameObject, "Picture already exists, please choose another picture");//图片已存在,请选择其他图片
|
||||
return;
|
||||
}
|
||||
self.GetComponent<Image>().sprite = Utils.PngToSprite(path, 110, 110);
|
||||
self.transform.Find("close").gameObject.SetActive(true);
|
||||
paths[self.name] = path;
|
||||
HandlePath(self, path);
|
||||
});
|
||||
#endif
|
||||
|
||||
}
|
||||
void HandlePath(GameObject self,string path)
|
||||
{
|
||||
if (paths.ContainsValue(path))
|
||||
{
|
||||
Utils.showToast(gameObject, "Picture already exists, please choose another picture");//图片已存在,请选择其他图片
|
||||
return;
|
||||
}
|
||||
self.GetComponent<Image>().sprite = Utils.PngToSprite(path, 110, 110);
|
||||
self.transform.Find("close").gameObject.SetActive(true);
|
||||
paths[self.name] = path;
|
||||
}
|
||||
void DelImage(BaseEventData e,Transform self,int index)
|
||||
{
|
||||
self.GetComponent<Image>().sprite = plus;
|
||||
@@ -134,6 +140,11 @@ public class FeedbackController : PFUIPanel
|
||||
public void OnMobileImageSelect(string res)
|
||||
{
|
||||
Debug.Log(res);
|
||||
Utils.showToast(gameObject, res, type: 1);
|
||||
if (res.IndexOf("true,") == 0 && selectObject!=null)
|
||||
{
|
||||
var path = res.Replace("true,", "");
|
||||
HandlePath(selectObject, path);
|
||||
}
|
||||
//Utils.showToast(gameObject, res, type: 1);
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,8 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
UIManager.AddEvent(scroll.gameObject, UnityEngine.EventSystems.EventTriggerType.BeginDrag, b =>
|
||||
{
|
||||
startPos = scroll.horizontalNormalizedPosition;
|
||||
Debug.Log("开始滑动"+startPos);
|
||||
doAni();
|
||||
Debug.Log("开始滑动" + startPos);
|
||||
});
|
||||
UIManager.AddEvent(scroll.gameObject, UnityEngine.EventSystems.EventTriggerType.EndDrag, b =>
|
||||
{
|
||||
@@ -38,7 +39,6 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
{
|
||||
UIManager.AddEvent(L.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick,(b)=>
|
||||
{
|
||||
startPos = scroll.horizontalNormalizedPosition;
|
||||
goLeft();
|
||||
});
|
||||
//L.onClick.AddListener(goLeft);
|
||||
@@ -47,20 +47,29 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
{
|
||||
UIManager.AddEvent(R.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
startPos = scroll.horizontalNormalizedPosition;
|
||||
goRight();
|
||||
});
|
||||
//R.onClick.AddListener(goRight);
|
||||
}
|
||||
}
|
||||
|
||||
private void doAni()
|
||||
private void doAni(bool flag = false)
|
||||
{
|
||||
lightbg.GetComponent<Image>().color = Utils.HexToColorHtml("#ffffff00");
|
||||
lightbg.GetComponent<Image>().gameObject.SetActive(false);
|
||||
int index = GetIndex();
|
||||
content.GetChild(index).GetComponent<QuickLoginUser>().setNoActive();
|
||||
//lightbg.GetComponent<Image>().DOFade(0, 0.15f);
|
||||
if (flag)
|
||||
{
|
||||
lightbg.GetComponent<Image>().gameObject.SetActive(true);
|
||||
lightbg.GetComponent<Image>().DOFade(1, 0.2f);
|
||||
content.GetChild(index).GetComponent<QuickLoginUser>().setActive();
|
||||
}
|
||||
else
|
||||
{
|
||||
lightbg.GetComponent<Image>().color = Utils.HexToColorHtml("#ffffff00");
|
||||
lightbg.GetComponent<Image>().gameObject.SetActive(false);
|
||||
content.GetChild(index).GetComponent<QuickLoginUser>().setNoActive();
|
||||
//lightbg.GetComponent<Image>().DOFade(0, 0.15f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Initial()
|
||||
@@ -105,6 +114,7 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
if (i == 0)
|
||||
{
|
||||
scroll.horizontalNormalizedPosition = startPos;
|
||||
doAni(true);
|
||||
return;
|
||||
}
|
||||
goMove(i);
|
||||
@@ -112,6 +122,7 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
void goLeft()
|
||||
{
|
||||
startPos = scroll.horizontalNormalizedPosition;
|
||||
if (scroll.horizontalNormalizedPosition <= 0 + 0.0001)
|
||||
{
|
||||
return;
|
||||
@@ -120,6 +131,7 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
}
|
||||
void goRight()
|
||||
{
|
||||
startPos = scroll.horizontalNormalizedPosition;
|
||||
if (scroll.horizontalNormalizedPosition + 0.0001 >= 1)
|
||||
{
|
||||
return;
|
||||
@@ -186,14 +198,20 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
string c;
|
||||
if (i == index)
|
||||
{
|
||||
lightbg.GetComponent<Image>().gameObject.SetActive(true);
|
||||
lightbg.GetComponent<Image>().DOFade(1, 0.2f);
|
||||
content.GetChild(i).GetComponent<QuickLoginUser>().setActive();
|
||||
doAni(true);
|
||||
//
|
||||
}
|
||||
else
|
||||
{
|
||||
content.GetChild(i).GetComponent<QuickLoginUser>().setNoActive();
|
||||
if (i < index)
|
||||
{
|
||||
content.GetChild(i).GetComponent<QuickLoginUser>().setNoActiveFunc(goLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
content.GetChild(i).GetComponent<QuickLoginUser>().setNoActiveFunc(goRight);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@@ -100,18 +101,35 @@ public class QuickLoginUser : MonoBehaviour
|
||||
//ColorUtility.TryParseHtmlString("#ffffffff", out Color color);
|
||||
//transform.Find("Avatar").GetComponent<RawImage>().color = color;
|
||||
transform.Find("Avatar").GetComponent<RawImage>().DOFade(1f, 0.3f);
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
transform.GetComponent<Button>().onClick.RemoveAllListeners();
|
||||
transform.GetComponent<Button>().onClick.AddListener(goMain);
|
||||
#else
|
||||
transform.GetComponent<Button>().enabled = true;
|
||||
#endif
|
||||
|
||||
transform.Find("NickNameText").GetComponent<Text>().DOFade(1f, 0.3f);
|
||||
//transform.Find("NickNameText").GetComponent<Text>().enabled = true;
|
||||
transform.Find("BtnDelete").GetComponent<Button>().gameObject.SetActive(true);
|
||||
|
||||
}
|
||||
public void setNoActive()
|
||||
{
|
||||
//ColorUtility.TryParseHtmlString("#ffffff80", out Color color);
|
||||
//transform.Find("Avatar").GetComponent<RawImage>().color = color;
|
||||
transform.Find("Avatar").GetComponent<RawImage>().DOFade(0.5f, 0.3f);
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
transform.GetComponent<Button>().enabled = false;
|
||||
#endif
|
||||
transform.Find("NickNameText").GetComponent<Text>().DOFade(0, 0.3f);//.enabled = false;
|
||||
transform.Find("BtnDelete").GetComponent<Button>().gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
internal void setNoActiveFunc(UnityAction goScroll)
|
||||
{
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
transform.GetComponent<Button>().onClick.RemoveAllListeners();
|
||||
transform.GetComponent<Button>().onClick.AddListener(goScroll);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,6 @@ public class HomeController : PFUIPanel
|
||||
protected override void Start()
|
||||
{
|
||||
base.Start();
|
||||
|
||||
mainNav = this.transform.Find("MainNav").GetComponent<MainNav>();
|
||||
mainNav.ShowExit();
|
||||
var BtnContainer = transform.Find("MainFuncContainer");
|
||||
@@ -131,11 +130,19 @@ public class HomeController : PFUIPanel
|
||||
#else
|
||||
if (App.weChatController.isApplicationAvilible("com.zhixingpai.powerfun", "powerfun"))
|
||||
{
|
||||
Application.OpenURL("powerfun://app");
|
||||
UIManager.ShowConfirm("Switch to PowerFun Workouts?", "We will close the Powerfun and start PowerFun Workouts.", () =>
|
||||
{
|
||||
UIManager.CloseConfirm();
|
||||
Application.OpenURL("powerfun://app");
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Application.OpenURL("http://www.powerfun.com/Download");
|
||||
UIManager.ShowConfirm("未检测到应用", "是否前往官网下载?", () =>
|
||||
{
|
||||
UIManager.CloseConfirm();
|
||||
Application.OpenURL("http://www.powerfun.com/Download");
|
||||
});
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -47,27 +47,35 @@ public class MapListController : PFUIPanel
|
||||
{
|
||||
#if (UNITY_ANDROID || UNITY_IOS)
|
||||
topContainer = transform.Find("Top");
|
||||
var rectTransform = transform.GetComponent<RectTransform>();
|
||||
var offsetMax = rectTransform.offsetMax;
|
||||
rectTransform.offsetMax = new Vector2(0, offsetMax.y);
|
||||
var offsetMin = rectTransform.offsetMin;
|
||||
rectTransform.offsetMin = new Vector2(0, offsetMin.y);
|
||||
var rect = transform.GetComponent<RectTransform>();
|
||||
rect.offsetMax = new Vector2(rect.offsetMax.x, 0);
|
||||
rect.offsetMin = new Vector2(rect.offsetMin.x, 0);
|
||||
//var rectTransform = transform.GetComponent<RectTransform>();
|
||||
//var offsetMax = rectTransform.offsetMax;
|
||||
//rectTransform.offsetMax = new Vector2(0, offsetMax.y);
|
||||
//var offsetMin = rectTransform.offsetMin;
|
||||
//rectTransform.offsetMin = new Vector2(0, offsetMin.y);
|
||||
var widthDelta = (transform.parent.parent.GetComponent<RectTransform>().sizeDelta.x -
|
||||
transform.GetComponent<RectTransform>().sizeDelta.x)/2;
|
||||
Debug.Log(widthDelta);
|
||||
//筛选按钮
|
||||
var topRect = topContainer.GetComponent<RectTransform>();
|
||||
topRect.localPosition = new Vector3(topRect.localPosition.x - widthDelta
|
||||
, topRect.localPosition.y, topRect.localPosition.z);
|
||||
if (!App.topRectStartX.HasValue)
|
||||
{
|
||||
App.topRectStartX = topRect.localPosition.x;
|
||||
}
|
||||
|
||||
var mc = transform.Find("MC");
|
||||
UIManager.AddEvent(transform.Find("Panel/BtnFilter").gameObject, EventTriggerType.PointerClick, b =>
|
||||
UIManager.AddEvent(transform.Find("SwitchMode/BtnFilter").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
topContainer.DOLocalMoveX(App.topRectStartX.Value - topRect.rect.width, 0.3f);
|
||||
topContainer.DOLocalMoveX(App.topRectStartX.Value + topRect.rect.width, 0.3f);
|
||||
mc.gameObject.SetActive(true);
|
||||
mc.GetComponent<CanvasGroup>().alpha = 0;
|
||||
mc.GetComponent<CanvasGroup>().DOFade(1, 0.3f);
|
||||
});
|
||||
UIManager.AddEvent(topContainer.Find("BtnCancel").gameObject, EventTriggerType.PointerClick, b =>
|
||||
UIManager.AddEvent(mc.gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
topContainer.DOLocalMoveX(App.topRectStartX.Value, 0.3f);
|
||||
mc.GetComponent<CanvasGroup>().DOFade(0, 0.3f).onComplete = () =>
|
||||
|
||||
@@ -201,6 +201,10 @@ public class RaceListScript : RaceScript
|
||||
//rectTransform.offsetMax = new Vector2(0, offsetMax.y);
|
||||
//var offsetMin = rectTransform.offsetMin;
|
||||
//rectTransform.offsetMin = new Vector2(0, offsetMin.y);
|
||||
var rect = transform.GetComponent<RectTransform>();
|
||||
rect.offsetMax = new Vector2(rect.offsetMax.x, 0);
|
||||
rect.offsetMin = new Vector2(rect.offsetMin.x, 0);
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
private async Task Login()
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class BigLeftController : MonoBehaviour
|
||||
{
|
||||
public void OnPointerClick()
|
||||
{
|
||||
RouteItem route = transform.parent.GetComponent<RouteItem>();
|
||||
if (route.enter)
|
||||
{
|
||||
route.OnPointerExit(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
route.OnPointerEnter(null);
|
||||
}
|
||||
}
|
||||
|
||||
//public void OnPointerEnter(PointerEventData eventData)
|
||||
//{
|
||||
// transform.parent.GetComponent<RouteItem>().OnPointerEnter(eventData);
|
||||
//}
|
||||
|
||||
//public void OnPointerExit(PointerEventData eventData)
|
||||
//{
|
||||
// transform.parent.GetComponent<RouteItem>().OnPointerExit(eventData);
|
||||
//}
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
transform.GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
OnPointerClick();
|
||||
});
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b3ab3b02366c6242875fcd497f9958e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -15,6 +15,9 @@ public class ResultListPanelController : PFUIPanel
|
||||
{
|
||||
UIManager.SwitchAccount();
|
||||
});
|
||||
var rect = transform.GetComponent<RectTransform>();
|
||||
rect.offsetMax = new Vector2(rect.offsetMax.x, 0);
|
||||
rect.offsetMin = new Vector2(rect.offsetMin.x, 0);
|
||||
}
|
||||
public override void Show()
|
||||
{
|
||||
|
||||
@@ -8,16 +8,18 @@ using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler
|
||||
public class RouteItem : MonoBehaviour
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
,IPointerEnterHandler,IPointerExitHandler
|
||||
#endif
|
||||
{
|
||||
RouteResult routeResult;
|
||||
// Start is called before the first frame update
|
||||
Transform left,row1,row2,right;
|
||||
Transform left,row1,row2,right,rightDot;
|
||||
Transform btnReRide, btnContinue, btnDelete;
|
||||
Transform btnDetail;
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@@ -33,11 +35,11 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
|
||||
{
|
||||
routeResult = result;
|
||||
this.index = index;
|
||||
left = transform.Find("Left");
|
||||
left = transform.Find("BigLeft/Left");
|
||||
row1 = left.Find("Main").Find("Row1");
|
||||
row2 = left.Find("Main").Find("Row2");
|
||||
|
||||
Utils.DisplayImage(transform.Find("CoverImage").GetComponent<RawImage>(), result.RouteImage, true);
|
||||
Utils.DisplayImage(transform.Find("BigLeft/CoverImage").GetComponent<RawImage>(), result.RouteImage, true);
|
||||
|
||||
left.Find("Main").Find("Name").GetComponent<Text>().text = result.RouteName;
|
||||
left.Find("Main").Find("Time").GetComponent<Text>().text = result.CreateTime.ToString("HH:mm:ss dd-MM-yyyy");
|
||||
@@ -82,7 +84,7 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
|
||||
{
|
||||
//btnDelete.gameObject.SetActive(false);
|
||||
//btnDelete.GetComponent<Button>().onClick.AddListener(Delete);
|
||||
UIManager.AddEvent(btnDelete.gameObject, EventTriggerType.PointerClick, (b) => Delete());
|
||||
UIManager.AddEvent(btnDelete.gameObject, EventTriggerType.PointerClick, (b) => Detail());
|
||||
}
|
||||
SetButtonColor(false);
|
||||
transform.Find("RightMatch").gameObject.SetActive(false);
|
||||
@@ -99,12 +101,21 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
|
||||
SetButtonColor(false);
|
||||
transform.Find("Right").gameObject.SetActive(false);
|
||||
}
|
||||
rightDot = transform.Find("RightDot");
|
||||
if (rightDot != null)
|
||||
{
|
||||
UIManager.AddEvent(rightDot.Find("BtnDot").gameObject, EventTriggerType.PointerClick, (b) => OnPointerEnter(null));
|
||||
UIManager.AddEvent(rightDot.Find("BtnDelete").gameObject, EventTriggerType.PointerClick, (b) => Delete());
|
||||
}
|
||||
|
||||
//right.gameObject.SetActive(true);
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
gameObject.GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
Detail();
|
||||
});
|
||||
#else
|
||||
gameObject.GetComponent<Button>().enabled = false;
|
||||
#endif
|
||||
}
|
||||
void Detail()
|
||||
@@ -179,7 +190,7 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
|
||||
}
|
||||
});
|
||||
}
|
||||
#if !(UNITY_ANDROID||UNITY_IOS)
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
void SetButtonColor(bool f)
|
||||
{
|
||||
if (routeResult!=null)
|
||||
@@ -249,6 +260,7 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
|
||||
}
|
||||
}
|
||||
#endif
|
||||
public bool enter { get; private set; }
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
transform.GetComponent<Image>().color = Utils.HexToColorHtml("#23232d");
|
||||
@@ -271,9 +283,14 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
|
||||
row1.Find("Times").GetComponent<Text>().color = Utils.HexToColorHtml("#9E9EAD");
|
||||
row1.Find("Rank").GetComponent<Text>().color = Utils.HexToColorHtml("#9E9EAD");
|
||||
}
|
||||
if (row2 != null)
|
||||
{
|
||||
row2.Find("Device").GetComponent<Text>().color = Utils.HexToColorHtml("#9E9EAD");
|
||||
}
|
||||
titleColor = "#414251";
|
||||
SetButtonColor(false);
|
||||
Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
|
||||
enter = false;
|
||||
}
|
||||
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
@@ -298,8 +315,13 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
|
||||
row1.Find("Times").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
|
||||
row1.Find("Rank").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
|
||||
}
|
||||
if (row2 != null)
|
||||
{
|
||||
row2.Find("Device").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
|
||||
}
|
||||
titleColor = "#5c5c6e";
|
||||
SetButtonColor(true);
|
||||
Cursor.SetCursor(Resources.Load<Texture2D>("Images/PointerButtonHover"), Vector2.zero, CursorMode.Auto);
|
||||
enter = true;
|
||||
}
|
||||
}
|
||||
@@ -429,6 +429,7 @@ public class UIManager : MonoBehaviour
|
||||
|
||||
//panel.gameObject.AddComponent<GameObject>(panelToShow.gameObject);
|
||||
//panelToShow.transform.SetParent(parent.transform);
|
||||
|
||||
parent.AddChild(panelToShow);
|
||||
//panelToShow.gameObject.SetActive(true);
|
||||
panelToShow.Show();
|
||||
|
||||
Reference in new issue
Block a user