合计修正版本暂存
This commit is contained in:
parent
769b75e2e2
commit
a2b44262f7
110
Assets/BannerController.cs
Normal file
110
Assets/BannerController.cs
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
using Assets.Scripts;
|
||||||
|
using Assets.Scripts.Apis.Models;
|
||||||
|
using DG.Tweening;
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class BannerController : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Start is called before the first frame update
|
||||||
|
private List<CanvasGroup> itemList;
|
||||||
|
private List<Vector3> standardPositions;
|
||||||
|
private List<MapRouteAreaItem> list;
|
||||||
|
private int currentIndex = 1;
|
||||||
|
void Awake()
|
||||||
|
{
|
||||||
|
UIManager.AddEvent(transform.Find("L").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||||
|
{
|
||||||
|
Left();
|
||||||
|
});
|
||||||
|
UIManager.AddEvent(transform.Find("R").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||||
|
{
|
||||||
|
Right();
|
||||||
|
});
|
||||||
|
itemList = new List<CanvasGroup>
|
||||||
|
{
|
||||||
|
transform.Find("1").GetComponent<CanvasGroup>(),
|
||||||
|
transform.Find("2").GetComponent<CanvasGroup>(),
|
||||||
|
transform.Find("3").GetComponent<CanvasGroup>()
|
||||||
|
};
|
||||||
|
standardPositions = new List<Vector3>
|
||||||
|
{
|
||||||
|
transform.Find("1").localPosition,transform.Find("2").localPosition,transform.Find("3").localPosition
|
||||||
|
};
|
||||||
|
GetList();
|
||||||
|
Debug.Log(standardPositions[0]);
|
||||||
|
Debug.Log(standardPositions[1]);
|
||||||
|
Debug.Log(standardPositions[2]);
|
||||||
|
}
|
||||||
|
async void GetList()
|
||||||
|
{
|
||||||
|
var res = await ConfigHelper.mapApi.GetRecommendAreaList();
|
||||||
|
if (res.result)
|
||||||
|
{
|
||||||
|
Initial(res.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Initial(List<MapRouteAreaItem> list)
|
||||||
|
{
|
||||||
|
int index = 0;
|
||||||
|
foreach (CanvasGroup c in itemList)
|
||||||
|
{
|
||||||
|
c.GetComponent<NewRouteItemController>().Initial(list[index++]);
|
||||||
|
}
|
||||||
|
currentIndex = 1;
|
||||||
|
this.list = list;
|
||||||
|
}
|
||||||
|
private void Right()
|
||||||
|
{
|
||||||
|
int center = GetCenterIndex(),
|
||||||
|
left = GetSideIndex(true),
|
||||||
|
right = GetSideIndex(false);
|
||||||
|
if (center == -1 || left == -1 || right == -1) return;
|
||||||
|
itemList[center].DOFade(0.5f, 0.5f);
|
||||||
|
itemList[center].GetComponent<RectTransform>().DOScale(Vector3.one * 0.8f, 0.5f);
|
||||||
|
itemList[center].GetComponent<RectTransform>().DOLocalMoveX(43, 0.5f);
|
||||||
|
itemList[right].GetComponent<RectTransform>().DOLocalMoveX(-43, 0.5f);
|
||||||
|
itemList[right].GetComponent<NewRouteItemController>().Initial(list[((currentIndex++) + list.Count)% list.Count]);
|
||||||
|
if (currentIndex >= list.Count) currentIndex = 0;
|
||||||
|
itemList[left].DOFade(1, 0.5f);
|
||||||
|
itemList[left].GetComponent<RectTransform>().DOScale(Vector3.one, 0.5f);
|
||||||
|
itemList[left].GetComponent<RectTransform>().DOLocalMoveX(0, 0.5f);
|
||||||
|
itemList[left].transform.SetAsLastSibling();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Left()
|
||||||
|
{
|
||||||
|
int center = GetCenterIndex(),
|
||||||
|
left = GetSideIndex(true),
|
||||||
|
right = GetSideIndex(false);
|
||||||
|
if (center == -1 || left == -1 || right == -1) return;
|
||||||
|
itemList[center].DOFade(0.5f, 0.5f);
|
||||||
|
itemList[center].GetComponent<RectTransform>().DOScale(Vector3.one*0.8f, 0.5f);
|
||||||
|
itemList[center].GetComponent<RectTransform>().DOLocalMoveX(-43, 0.5f);
|
||||||
|
itemList[left].GetComponent<RectTransform>().DOLocalMoveX(43, 0.5f);
|
||||||
|
itemList[left].GetComponent<NewRouteItemController>().Initial(list[((currentIndex--) + list.Count) % list.Count]);
|
||||||
|
if (currentIndex < 0) currentIndex = list.Count - 1;
|
||||||
|
itemList[right].DOFade(1, 0.5f);
|
||||||
|
itemList[right].GetComponent<RectTransform>().DOScale(Vector3.one, 0.5f);
|
||||||
|
itemList[right].GetComponent<RectTransform>().DOLocalMoveX(0, 0.5f);
|
||||||
|
itemList[right].transform.SetAsLastSibling();
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetCenterIndex()
|
||||||
|
{
|
||||||
|
return itemList.FindIndex(x => x.transform.localPosition.x == 0);
|
||||||
|
}
|
||||||
|
int GetSideIndex(bool left)
|
||||||
|
{
|
||||||
|
return itemList.FindIndex(x => left ? x.transform.localPosition.x < 0 : x.transform.localPosition.x > 0);
|
||||||
|
}
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/BannerController.cs.meta
Normal file
11
Assets/BannerController.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 99085319355aa0f44a5db27b26f6ec95
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Resources/Images/NewDesign.meta
Normal file
8
Assets/Resources/Images/NewDesign.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0c535875229f7974ebcc43ad53ddf539
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Resources/Images/NewDesign/ICON_Tools.png
Normal file
BIN
Assets/Resources/Images/NewDesign/ICON_Tools.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
128
Assets/Resources/Images/NewDesign/ICON_Tools.png.meta
Normal file
128
Assets/Resources/Images/NewDesign/ICON_Tools.png.meta
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7d5d94dad42aad44887326febb9a42c6
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 11
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 1
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
streamingMipmaps: 0
|
||||||
|
streamingMipmapsPriority: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -100
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: -1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 1
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 8
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
platformSettings:
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: iPhone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Android
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 5e97eb03825dee720800000000000000
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
spritePackingTag:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
pSDShowRemoveMatteOption: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -36,11 +36,11 @@ RectTransform:
|
|||||||
m_Father: {fileID: 3150550772099312288}
|
m_Father: {fileID: 3150550772099312288}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 1
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0.5, y: 1}
|
m_AnchorMin: {x: 0, y: 0.5}
|
||||||
m_AnchorMax: {x: 0.5, y: 1}
|
m_AnchorMax: {x: 0, y: 0.5}
|
||||||
m_AnchoredPosition: {x: 0, y: -50}
|
m_AnchoredPosition: {x: 52, y: 0}
|
||||||
m_SizeDelta: {x: 0, y: 34}
|
m_SizeDelta: {x: 0, y: 34}
|
||||||
m_Pivot: {x: 0.5, y: 1}
|
m_Pivot: {x: 0, y: 0.5}
|
||||||
--- !u!222 &2773518605446052280
|
--- !u!222 &2773518605446052280
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
1916
Assets/Resources/UI/Prefab/MainNav-mobile.prefab
Normal file
1916
Assets/Resources/UI/Prefab/MainNav-mobile.prefab
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Resources/UI/Prefab/MainNav-mobile.prefab.meta
Normal file
7
Assets/Resources/UI/Prefab/MainNav-mobile.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 240a4465e4dc90848a0efc1a9520c658
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
2356
Assets/Scenes/Test2.unity
Normal file
2356
Assets/Scenes/Test2.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Scenes/Test2.unity.meta
Normal file
7
Assets/Scenes/Test2.unity.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3d0269b6fae5e324d9275b72e070b1e7
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -47,6 +47,7 @@ namespace Assets.Scripts.Apis
|
|||||||
return Get<JsonResult<MapRoute>>($"Map/GetMapRouteById?id={id}");
|
return Get<JsonResult<MapRoute>>($"Map/GetMapRouteById?id={id}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -184,5 +185,12 @@ namespace Assets.Scripts.Apis
|
|||||||
var result = await GetAsync<JsonResult<List<MapMaxRanking>>>($"Map/GetMaxRanking");
|
var result = await GetAsync<JsonResult<List<MapMaxRanking>>>($"Map/GetMaxRanking");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<JsonResult<List<MapRouteAreaItem>>> GetRecommendAreaList()
|
||||||
|
{
|
||||||
|
var result = await GetAsync<JsonResult<List<MapRouteAreaItem>>>($"MapRouteArea/GetRecommendAreaList");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -194,7 +194,14 @@ public static class App
|
|||||||
TcpAddress = new IPEndPoint(IPAddress.Parse("192.168.0.102"), 21001);
|
TcpAddress = new IPEndPoint(IPAddress.Parse("192.168.0.102"), 21001);
|
||||||
//Debug.unityLogger.logEnabled = false;
|
//Debug.unityLogger.logEnabled = false;
|
||||||
#endif
|
#endif
|
||||||
|
if (!FB.IsInitialized)
|
||||||
|
{
|
||||||
FB.Init();
|
FB.Init();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FB.ActivateApp();
|
||||||
|
}
|
||||||
var isRower = PlayerPrefs.GetString("IsRowerMode");
|
var isRower = PlayerPrefs.GetString("IsRowerMode");
|
||||||
if (!string.IsNullOrEmpty(isRower))
|
if (!string.IsNullOrEmpty(isRower))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -64,7 +64,7 @@ public class MainController : BaseScene
|
|||||||
FinishMessage(sender);
|
FinishMessage(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
CanvasGroup[] msgs;
|
List<CanvasGroup> msgs;
|
||||||
Vector3 msgLocation;
|
Vector3 msgLocation;
|
||||||
int msgIndex = 0;
|
int msgIndex = 0;
|
||||||
CanvasGroup rightMessage;
|
CanvasGroup rightMessage;
|
||||||
@ -82,9 +82,10 @@ public class MainController : BaseScene
|
|||||||
msg3.transform.localPosition = 1 * msgLocation;
|
msg3.transform.localPosition = 1 * msgLocation;
|
||||||
msg3.transform.localScale = Vector3.one;
|
msg3.transform.localScale = Vector3.one;
|
||||||
msg3.alpha = 0;
|
msg3.alpha = 0;
|
||||||
msgs = new CanvasGroup[] { msg, msg2, msg3 };
|
msgs = List<CanvasGroup> { msg, msg2, msg3 };
|
||||||
rightMessage = transform.Find("GameObject/MessageRight").GetComponent<CanvasGroup>();
|
rightMessage = transform.Find("GameObject/MessageRight").GetComponent<CanvasGroup>();
|
||||||
#else
|
#else
|
||||||
|
msgLocation = new Vector3(168, -153, 0);
|
||||||
var go = transform.Find("GameObject");
|
var go = transform.Find("GameObject");
|
||||||
go.GetComponent<RectTransform>().anchorMin = Vector2.zero;
|
go.GetComponent<RectTransform>().anchorMin = Vector2.zero;
|
||||||
go.GetComponent<RectTransform>().anchorMax = Vector2.one;
|
go.GetComponent<RectTransform>().anchorMax = Vector2.one;
|
||||||
@ -97,7 +98,18 @@ public class MainController : BaseScene
|
|||||||
|
|
||||||
rightMessage.transform.SetParent(go);
|
rightMessage.transform.SetParent(go);
|
||||||
rightMessage.transform.localScale = Vector3.one;
|
rightMessage.transform.localScale = Vector3.one;
|
||||||
rightMessage.transform.localPosition = new Vector3(-112, 164, 0);
|
rightMessage.transform.localPosition = 1 * msgLocation;
|
||||||
|
msgs = new List<CanvasGroup> { rightMessage };
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
|
{
|
||||||
|
var tmpm = Instantiate<CanvasGroup>(rightMessage);
|
||||||
|
tmpm.transform.SetParent(rightMessage.transform.parent);
|
||||||
|
tmpm.transform.localPosition = 1 * msgLocation;
|
||||||
|
tmpm.transform.localScale = Vector3.one;
|
||||||
|
tmpm.alpha = 0;
|
||||||
|
msgs.Add(tmpm);
|
||||||
|
}
|
||||||
|
|
||||||
Debug.Log(rightMessage.GetComponent<RectTransform>().localPosition);
|
Debug.Log(rightMessage.GetComponent<RectTransform>().localPosition);
|
||||||
//rightMessage.transform.SetParent(transform.Find("GameObject"));
|
//rightMessage.transform.SetParent(transform.Find("GameObject"));
|
||||||
#endif
|
#endif
|
||||||
@ -120,7 +132,7 @@ public class MainController : BaseScene
|
|||||||
#else
|
#else
|
||||||
if (App.currentPageIsHome)
|
if (App.currentPageIsHome)
|
||||||
{
|
{
|
||||||
DoMessageRight(e);
|
DoMessage6(e);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -156,6 +168,38 @@ public class MainController : BaseScene
|
|||||||
}
|
}
|
||||||
msgIndex++;
|
msgIndex++;
|
||||||
}
|
}
|
||||||
|
private void DoMessage6(LinkedMessageEvent e)
|
||||||
|
{
|
||||||
|
var selectIndex = msgIndex % 6;
|
||||||
|
var m = msgs[selectIndex];
|
||||||
|
if (msgIndex >= 6) //
|
||||||
|
{
|
||||||
|
//msgIndex = 0;
|
||||||
|
m.DOFade(0, 0.5f).onComplete = () =>
|
||||||
|
{
|
||||||
|
SetMessage(m, e);
|
||||||
|
m.transform.localPosition = 1 * msgLocation;
|
||||||
|
m.DOFade(1, 0.5f);
|
||||||
|
foreach (var item in msgs.Where((x, i) => i != selectIndex))
|
||||||
|
{
|
||||||
|
item.transform.DOLocalMoveY(item.transform.localPosition.y + 38, 0.5f);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Log(191);
|
||||||
|
SetMessage(m, e);
|
||||||
|
for (int i = 0; i < msgIndex; i++)
|
||||||
|
{
|
||||||
|
var rect = msgs[i].GetComponent<RectTransform>();
|
||||||
|
rect.DOLocalMoveY(rect.localPosition.y + 38, 0.5f);
|
||||||
|
}
|
||||||
|
m.DOFade(1, 0.5f);
|
||||||
|
}
|
||||||
|
msgIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
void FinishMessage(object sender)
|
void FinishMessage(object sender)
|
||||||
{
|
{
|
||||||
#if UNITY_STANDALONE_WIN
|
#if UNITY_STANDALONE_WIN
|
||||||
@ -170,7 +214,7 @@ public class MainController : BaseScene
|
|||||||
#else
|
#else
|
||||||
if (!(bool)sender)
|
if (!(bool)sender)
|
||||||
{
|
{
|
||||||
FinishMessageRight();
|
FinishMessage6();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -193,6 +237,15 @@ public class MainController : BaseScene
|
|||||||
msgIndex = 0;
|
msgIndex = 0;
|
||||||
rightMessage.DOFade(0, 0.3f);
|
rightMessage.DOFade(0, 0.3f);
|
||||||
}
|
}
|
||||||
|
void FinishMessage6()
|
||||||
|
{
|
||||||
|
msgIndex = 0;
|
||||||
|
foreach (var m in msgs)
|
||||||
|
{
|
||||||
|
m.alpha = 0;
|
||||||
|
m.GetComponent<RectTransform>().localPosition = 1 * msgLocation;
|
||||||
|
}
|
||||||
|
}
|
||||||
private void SetMessage(CanvasGroup m,LinkedMessageEvent e)
|
private void SetMessage(CanvasGroup m,LinkedMessageEvent e)
|
||||||
{
|
{
|
||||||
m.transform.Find("Avatar").GetComponent<RawImage>().texture = null;
|
m.transform.Find("Avatar").GetComponent<RawImage>().texture = null;
|
||||||
|
|||||||
180
Assets/Scripts/UI/Prefab/NewMainNav.cs
Normal file
180
Assets/Scripts/UI/Prefab/NewMainNav.cs
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
using Assets.Scripts.UI.Control;
|
||||||
|
using DG.Tweening;
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class NewMainNav : MonoBehaviour
|
||||||
|
{
|
||||||
|
private GameObject exit;
|
||||||
|
private GameObject home;
|
||||||
|
private GameObject back;
|
||||||
|
float delayTime = 0;
|
||||||
|
private List<string> typeArray = new List<string>()
|
||||||
|
{
|
||||||
|
"Back","Exit","Home","Device","Delay","Setting","Support"
|
||||||
|
};
|
||||||
|
private List<int> indexs = new List<int>();
|
||||||
|
/// <summary>
|
||||||
|
/// 0,1,2,3,4,5,6
|
||||||
|
/// "Back","Exit","Home","Device","Delay","Setting","Support"
|
||||||
|
/// </summary>
|
||||||
|
public void SetButtonActive(List<int> indexs)
|
||||||
|
{
|
||||||
|
this.indexs = indexs;
|
||||||
|
SetExpand(false);
|
||||||
|
//List<string> types = new List<string>();
|
||||||
|
//if (indexs != null)
|
||||||
|
//{
|
||||||
|
// types = typeArray.Where((x, i) => indexs.Contains(i)).ToList();
|
||||||
|
//}
|
||||||
|
//foreach (Transform item in transform)
|
||||||
|
//{
|
||||||
|
// item.gameObject.SetActive(types.Contains(item.name));
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// true:展开 false:关闭
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="flag"></param>
|
||||||
|
private void SetExpand(bool flag)
|
||||||
|
{
|
||||||
|
List<string> types = new List<string>();
|
||||||
|
if (indexs != null)
|
||||||
|
{
|
||||||
|
types = typeArray.Where((x, i) => indexs.Contains(i)).ToList();
|
||||||
|
}
|
||||||
|
foreach (Transform item in transform)
|
||||||
|
{
|
||||||
|
if (flag)
|
||||||
|
{
|
||||||
|
if (item.name == "Down")
|
||||||
|
{
|
||||||
|
item.gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
else if (item.name == "PF")
|
||||||
|
{
|
||||||
|
item.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item.gameObject.SetActive(types.Contains(item.name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item.gameObject.SetActive(item.name == "PF");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
UIManager.AddEvent(transform.Find("PF").gameObject, EventTriggerType.PointerClick, b =>
|
||||||
|
{
|
||||||
|
SetExpand(true);
|
||||||
|
});
|
||||||
|
UIManager.AddEvent(transform.Find("Down").gameObject, EventTriggerType.PointerClick, b =>
|
||||||
|
{
|
||||||
|
SetExpand(false);
|
||||||
|
});
|
||||||
|
//var material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
|
||||||
|
|
||||||
|
//var rect = ((RectTransform)this.transform).rect;
|
||||||
|
//material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height, 0));
|
||||||
|
//this.GetComponent<Image>().material = material;
|
||||||
|
|
||||||
|
var device = this.transform.Find("Device");
|
||||||
|
UIManager.AddEvent(device.gameObject, EventTriggerType.PointerClick, x =>
|
||||||
|
{
|
||||||
|
//Debug.Log("click device");
|
||||||
|
UIManager.ShowDevicePanel();
|
||||||
|
});
|
||||||
|
|
||||||
|
home = this.transform.Find("Home").gameObject;
|
||||||
|
UIManager.AddEvent(home, EventTriggerType.PointerClick, x =>
|
||||||
|
{
|
||||||
|
UIManager.ShowHomePanel();
|
||||||
|
});
|
||||||
|
|
||||||
|
exit = this.transform.Find("Exit").gameObject;
|
||||||
|
exit.SetActive(false);
|
||||||
|
back = transform.Find("Back").gameObject;
|
||||||
|
back.SetActive(false);
|
||||||
|
#if UNITY_ANDROID || UNITY_IOS
|
||||||
|
UIManager.AddEvent(transform.Find("Delay").gameObject, EventTriggerType.PointerClick, b =>
|
||||||
|
{
|
||||||
|
delayTime = 3;
|
||||||
|
transform.Find("Delay/Tooltips").gameObject.SetActive(true);
|
||||||
|
transform.Find("Delay/Tooltips").GetComponent<CanvasGroup>().DOFade(1, 0.5f);
|
||||||
|
});
|
||||||
|
#endif
|
||||||
|
//transform.Find("Delay").GetComponent<PfUIButton>().showTooltip = true;
|
||||||
|
UIManager.AddEvent(exit, EventTriggerType.PointerClick, (e) =>
|
||||||
|
{
|
||||||
|
UIManager.ShowConfirm("Quit", "Do you want to quit PowerFun?", ()=> {
|
||||||
|
Application.Quit();
|
||||||
|
},2);
|
||||||
|
});
|
||||||
|
UIManager.AddEvent(back, EventTriggerType.PointerClick, (e) =>
|
||||||
|
{
|
||||||
|
UIManager.ShowPrePanel();
|
||||||
|
});
|
||||||
|
|
||||||
|
UIManager.AddEvent(transform.Find("Setting").gameObject, EventTriggerType.PointerClick, x =>
|
||||||
|
{
|
||||||
|
UIManager.ShowSettingModal();
|
||||||
|
});
|
||||||
|
UIManager.AddEvent(transform.Find("Support").gameObject, EventTriggerType.PointerClick, x =>
|
||||||
|
{
|
||||||
|
UIManager.ShowFeedBackModal();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowRowerTab()
|
||||||
|
{
|
||||||
|
if (transform.Find("Device"))
|
||||||
|
{
|
||||||
|
transform.Find("Device").gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
if (transform.Find("Exit"))
|
||||||
|
{
|
||||||
|
transform.Find("Exit").gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
if (transform.Find("Home"))
|
||||||
|
{
|
||||||
|
transform.Find("Home").gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start is called before the first frame update
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (delayTime < 0)
|
||||||
|
{
|
||||||
|
Debug.Log("小时");
|
||||||
|
delayTime = 0;
|
||||||
|
transform.Find("Delay/Tooltips").GetComponent<CanvasGroup>().DOFade(0, 0.5f).onComplete = ()=>
|
||||||
|
{
|
||||||
|
transform.Find("Delay/Tooltips").gameObject.SetActive(false);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else if(delayTime > 0)
|
||||||
|
{
|
||||||
|
Debug.Log(delayTime);
|
||||||
|
delayTime -= Time.deltaTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
11
Assets/Scripts/UI/Prefab/NewMainNav.cs.meta
Normal file
11
Assets/Scripts/UI/Prefab/NewMainNav.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fca4162bdac783449b37ea751c075353
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -35,8 +35,13 @@ public class HomeController : PFUIPanel
|
|||||||
protected override void Start()
|
protected override void Start()
|
||||||
{
|
{
|
||||||
base.Start();
|
base.Start();
|
||||||
|
#if UNITY_ANDROID || UNITY_IOS
|
||||||
|
var nav = transform.Find("MainNav-mobile").GetComponent<NewMainNav>();
|
||||||
|
nav.SetButtonActive(new List<int> { 1, 3, 4, 6 });
|
||||||
|
#else
|
||||||
mainNav = this.transform.Find("MainNav").GetComponent<MainNav>();
|
mainNav = this.transform.Find("MainNav").GetComponent<MainNav>();
|
||||||
mainNav.ShowExit();
|
mainNav.ShowExit();
|
||||||
|
#endif
|
||||||
var BtnContainer = transform.Find("MainFuncContainer");
|
var BtnContainer = transform.Find("MainFuncContainer");
|
||||||
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerClick, GoRide);
|
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerClick, GoRide);
|
||||||
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerEnter, OnHover);
|
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerEnter, OnHover);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user