合并后错误修改

This commit is contained in:
lishuo 2022-06-02 18:05:41 +08:00
parent e513eeac5c
commit c6d0f7ac13
22 changed files with 20977 additions and 24867 deletions

View File

@ -214,7 +214,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: 56ffaecccce0ae34fa083c91bcabecdb, type: 3}
m_Font: {fileID: 12800000, guid: f878f11ea5771c548ac255f4e39b8e4b, type: 3}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0

File diff suppressed because it is too large Load Diff

View File

@ -66,7 +66,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: 56ffaecccce0ae34fa083c91bcabecdb, type: 3}
m_Font: {fileID: 12800000, guid: f878f11ea5771c548ac255f4e39b8e4b, type: 3}
m_FontSize: 96
m_FontStyle: 0
m_BestFit: 0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8bb6a9e5107a46744ba70fc370774184
guid: 36bfda55f1b326a4d9f58750c891c4a9
PrefabImporter:
externalObjects: {}
userData:

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 332fcc2a652bb8f48acfcf2d88ab2f20
guid: 8bb6a9e5107a46744ba70fc370774184
PrefabImporter:
externalObjects: {}
userData:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 332fcc2a652bb8f48acfcf2d88ab2f20
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,37 +1,51 @@
10:10,-5,0,-,-,-
243:-15,10,0,-,-,-
750:5,-5,1,-,-,-
849:30,-10,2,-,-,-
1055:15,-15,1,-,-,-
1100:10,0,0,-,-,-
1220:10,5,0,-,-,-
1330:-10,5,0,-,-,-
1899:5,-5,1,-,-,-
1925:10,-5,1,-,-,-
2524:-5,5,1,-,-,-
2960:10,-5,1,-,-,-
3120:15,-5,0,-,-,-
3300:5,5,0,-,-,-
3555:-10,5,0,-,-,-
3967:-10,5,1,-,-,-
4483:10,-5,1,-,-,-
4590:15,-5,1,-,-,-
4817:-5,0,1,-,-,-
5191:5,0,1,-,-,-
5279:10,0,1,-,-,-
5630:-10,0,0,-,-,-
6578:5,-5,0,-,-,-
7838:5,-5,1,-,-,-
7919:15,0,1,-,-,-
8471:10,0,1,-,-,-
9536:-5,0,0,-,-,-
9605:-10,0,0,-,-,-
10123:5,0,0,-,-,-
10500:-5,0,0,-,-,-
10807:5,0,0,-,-,-
10834:15,-5,1,-,-,-
11033:5,-5,1,-,-,-
11400:5,-5,1,-,-,-
11528:5,0,1,-,-,-
11734:-5,0,0,-,-,-
12170:-25,5,0,-,-,-
113:16.4,0,0,-1,3,45
268:-2.8,0,0.7550681,-1,4.069226,45
298:-17.2,6.1,0.4818666,-1,4.246056,45
372:-28,5.6,-0.4048006,-1,3.479697,45
429:-24,5.6,-0.9346578,-1,5.473352,45
547:-21.2,5.6,-0.2429728,-1,3.972845,45
611:-12.4,1.1,-0.32109,-1,4.237999,45
749:1.8,1.1,0.7453919,-1,3.78505,45
817:7,1.1,1.333951,-1,3.931795,45
864:21,-5.1,1.333951,-1,3.931795,45
898:32.2,-11.6,2.157078,-1,3.931795,45
1044:30.2,-11.6,2.88893,-1,3.598711,45
1093:22.8,-2.3,2.180352,-1,3.786387,45
1135:18.4,0.5,2.315585,-1,4.375738,45
1264:8.6,5.7,1.755207,-1,3.704368,45
1344:-6.2,0,0.9801137,-1,3.537684,45
1547:-22.6,6.1,0.8330526,-1,3.407704,45
1714:-19.4,5.2,0.6406997,-1,3.9143,45
1843:-7.2,-2,0.9479414,-1,4.46124,45
1948:9,-2,1.416687,-1,4.631541,45
2349:5.6,1.4,1.416687,-1,4.631541,45
2463:-7.6,6.7,1.182605,-1,3.425815,45
2640:-7.6,6.7,0.5427184,-1,3.291988,45
2959:5.2,-0.8,0.5427184,-1,3.291988,45
3045:14.2,0,0.7456276,-1,3.291988,45
3324:3.6,0,0.7773573,-1,3.291988,45
3519:-1.6,0,0.422653,-1,4.233258,45
3634:-14.6,0,-0.4799475,-1,4.233258,45
3777:-4.8,0,0.09549108,-1,4.030807,45
3866:0,0,0,-1,3,45
4013:-15.6,0,0.09549108,-1,4.030807,45
4329:-7,0,0.3505953,-1,4.030807,45
4435:0,0,0.7336217,-1,3,45
4545:15,-6.4,0.979607,-1,3.860944,45
4645:25,-5.9,1.752236,-1,3.860944,45
4817:8.8,2.5,1.175218,-1,3.860944,45
5008:-10.2,0,-0.082,-1,3.861,45
5142:-0.4,0,0.253,-1,4.01,45
5232:9.6,0,0.606,-1,3,45
5303:19.6,0.9,1.166,-1,3.345,45
5596:2.2,0,0.606,-1,3,45
5641:-4.8,5.3,0.605,-1,3.172,45
6252:-4.8,-1.6,0.605,-1,3.172,45
6606:2.2,-0.9,0.707,-1,3.172,45
6875:6.2,-3.5,0.707,-1,3.172,45
7276:7.8,-3.9,1.409,-1,4.114,45
7662:-5,2.5,0.677,-1,4.114,45
7859:9.4,0,0.677,-1,4.114,45
7927:14.6,0,1.215,-1,3,45
8070:7.8,5,1.215,-1,3,45
9037:-5,5,0.519,-1,3,45

View File

@ -365,7 +365,7 @@
"Please enter an integer between 0-59.": "请输入一个0-59的整数",
"Please check the network status!": "请检查网络连接是否正常!",
"FINISH": "终点",
"Continue the game?": "有中断的划船记录,是否继续?"
"Continue the game?": "有中断的划船记录,是否继续?",
"Week": "周",
"You're watching": "你正在观看",
"Bicycle": "自行车",
@ -735,7 +735,7 @@
"Please enter an integer between 0-59.": "Please enter an integer between 0-59.",
"Please check the network status!": "Please check if the network connection is normal!",
"FINISH": "FINISH",
"Continue the game?": "Continue the game?"
"Continue the game?": "Continue the game?",
"Week": "Week",
"You're watching": "You're watching",
"Bicycle": "Bicycle",

File diff suppressed because it is too large Load Diff

View File

@ -69,6 +69,9 @@ namespace Assets.Scripts.Scenes.VideoRide
camera = Camera.main;
//bone_bottle_2
bone_bottle_2 = transform.Find("bone_cable_20");
var config = manager.mockDirection;
pre = config[0];
next = config[0];
}
//人物状态
@ -109,12 +112,8 @@ namespace Assets.Scripts.Scenes.VideoRide
}
protected virtual void Update()
{
#if UNITY_EDITOR
#endif
timer -= Time.deltaTime;
CreateHeadImage();
CharacterControl();
Turn();
while (timer <= 0)
{
@ -142,52 +141,6 @@ namespace Assets.Scripts.Scenes.VideoRide
}
}
private Vector3 rotation = Vector3.zero;
private void CharacterControl()
{
float KeyVertical = Input.GetAxis("Vertical");
float KeyHorizontal = Input.GetAxis("Horizontal");
var delta = 0.2f;
var zdelta = 0.1f;
//控制人物左右倾斜
if (Input.GetKey(KeyCode.Q))
{
rotation.y -= delta;
rotation.z += zdelta;
transform.DORotate(rotation, 0);
}
if (Input.GetKey(KeyCode.E))
{
rotation.y += delta;
rotation.z -= zdelta;
transform.DORotate(rotation, 0);
}
//空格键记录当前人物数据
if (Input.GetKey(KeyCode.Space))
{
Debug.Log($"{manager.GetCurrentFrame()}:{transform.rotation.y},{transform.rotation.z},{transform.position.x}");
}
//人物前后左右
if (KeyVertical == -1)
{
setHeroState(HERO_DOWN); //下
}
else if (KeyVertical == 1)
{
setHeroState(HERO_UP); //上
}
if (KeyHorizontal == 1)
{
setHeroState(HERO_RIGHT); //右
}
else if (KeyHorizontal == -1)
{
setHeroState(HERO_LEFT); //左
}
}
//人物碰撞
void OnCollisionEnter(Collision collision)
@ -228,16 +181,17 @@ namespace Assets.Scripts.Scenes.VideoRide
return manager.GetCurrentFrame();
}
private CustomRange pre;
private CustomRange next;
protected CustomRange pre { get; set; }
protected CustomRange next { get; set; }
protected float t { get; set; }
protected virtual void Turn()
{
//控制人物的转向
var currentFrame = GetCurrentFrame();
var config = manager.mockDirection;
pre = config[0];
next = config[0];
if (config.Count == 0)
return;
for (int i = 0; i < config.Count; i++)
{
@ -251,19 +205,9 @@ namespace Assets.Scripts.Scenes.VideoRide
var p = new Vector3(0, pre.RotationY, pre.RotationZ);
var q = new Vector3(0, next.RotationY, next.RotationZ);
var t = (float)(currentFrame - pre.KeyFrame) / (float)(next.KeyFrame - pre.KeyFrame);
var rt = Vector3.Slerp(p, q, t);
t = next.KeyFrame - pre.KeyFrame == 0 ? 1 : (float)(currentFrame - pre.KeyFrame) / (float)(next.KeyFrame - pre.KeyFrame);
var rt = Vector3.Lerp(p, q, t);
transform.DORotate(rt, 0, RotateMode.Fast);
//控制人物的前后左右
var l = new Vector3(pre.PositionX, pre.PositionY, pre.PositionZ);
var s = new Vector3(next.PositionX, next.PositionY, next.PositionZ);
var pos = Vector3.Slerp(l,s, t);
transform.DOMove(pos,0);
//TODO:控制光线
}
//计算人物当前属性

View File

@ -30,12 +30,15 @@ namespace Assets.Scripts.Scenes.VideoRide
}
}
}
private const int rate = 20;// z轴与帧数的比例 1 20
//人物向前超车 右边超车
protected override void Turn()
{
base.Turn();
var current = manager.CurrentPlayer;
var z = current.transform.position.z + diff*1000 * 0.5f;
var interval = this.currentFrame - manager.GetCurrentFrame();
var z = current.transform.position.z + interval / rate;
transform.DOMoveZ((float)z, 1f);
//x轴位移
//var x = bearing + current.bearing;

View File

@ -72,6 +72,7 @@ namespace Assets.Scripts.Scenes.VideoRide
public RouteResult routeResult;
public string recordId { get; set; }
public DateTime startTime { get; set; }
public int FrameKM { get; private set; }//一米对应的帧数
public CyclingModel cyclingModel;
public BaseCycling cyclingController;
public List<CustomRange> mockDirection = new List<CustomRange>();
@ -132,12 +133,20 @@ namespace Assets.Scripts.Scenes.VideoRide
}
endDistance = 0;
videoLoading = FindObjectOfType<VideoLoading>();
}
private IEnumerator Init()
{
yield return null;
videoLoading.Init();//初始化loading页面
}
public int GetFrameKm()
{
var s = mediaPlayer.Info.GetDurationFrames();
FrameKM = (int)Math.Floor(s / (mapData.TotalDistance * 1000));
return FrameKM;
}
VideoLoading videoLoading { get; set; }
// Update is called once per frame
float timer = 0f;
@ -234,7 +243,7 @@ namespace Assets.Scripts.Scenes.VideoRide
if (currentPlayerInfo != null)
{
var diff = item.EndDistance % mapData.TotalDistance - currentPlayerInfo.EndDistance % mapData.TotalDistance;
if (Math.Abs(diff * 1000) <= 50)
if (Math.Abs(diff * 1000) <= 100)
{
GameObject obj;
if (currentPlayerInfo.Sex == 1)

View File

@ -11,12 +11,15 @@ namespace Assets.Scripts.Scenes.VideoRide
public class VideoPlayer : AbstractVideoPlayer
{
public double EndDistance => totalDistance;
protected Transform LightTrans { get; set; }
protected override void Start()
{
base.Start();
animator.Play("idle");
UserId = App.CurrentUser.Id;
UserName = App.CurrentUser.Nickname;
var light = FindObjectOfType<Light>();
LightTrans = light.transform;
}
protected override bool GetStart()
@ -48,6 +51,16 @@ namespace Assets.Scripts.Scenes.VideoRide
protected override void Turn()
{
base.Turn();
//控制人物的前后左右
var l = new Vector3(pre.PositionX, pre.PositionY, pre.PositionZ);
var s = new Vector3(next.PositionX, next.PositionY, next.PositionZ);
var pos = Vector3.Lerp(l, s, t);
transform.DOMove(pos, 0);
//控制光线
var z = new Vector3(50, pre.LightY, 0);
var c = new Vector3(50, next.LightY, 0);
var zc = Vector3.Lerp(z, c, t);
LightTrans.DORotate(zc, 0);
}
protected override void ComputePlayer()
{

View File

@ -195,7 +195,7 @@ public class ActivityController : PFUIPanel
{
CancelInvoke("StartPageFunc");
Close();
webView.LoadHTMLString("<div style=\"background:#23232d\" />", this.url);
//webView.LoadHTMLString("<div style=\"background:#23232d\" />", this.url);
//Destroy(gameObject);
//UIManager.Instance.mActivityController = null;
}

View File

@ -29,7 +29,6 @@ public class HomeController : PFUIPanel
[SerializeField] Button BtnRide;
[SerializeField] Transform userInfo;
Transform BtnMatch, BtnTraining;
Transform BtnBattle;
private MainNav mainNav;
private Dictionary<string, Sprite[]> dict;
// Start is called before the first frame update
@ -40,7 +39,7 @@ public class HomeController : PFUIPanel
{
UIManager.ShowUserInfoPanel();
});
var BtnContainer = transform.Find("MainFuncContainer");
#if UNITY_ANDROID || UNITY_IOS
var nav = transform.Find("MainNav-mobile").GetComponent<NewMainNav>();
nav.SetButtonActive(new List<int> { 1, 3, 4, 6 },null,new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/RowerNew/ICON_mode_44"), () =>
@ -59,17 +58,8 @@ public class HomeController : PFUIPanel
});
mainNav = this.transform.Find("MainNav").GetComponent<MainNav>();
mainNav.ShowExit();
UIManager.AddEvent(transform.Find("TodayData/ChangePlayerBtn").gameObject, EventTriggerType.PointerClick, b =>
{
UIManager.ShowChangePlayerPanel();
});
BtnBattle = BtnContainer.Find("BtnBattle");
UIManager.AddEvent(BtnBattle.gameObject, EventTriggerType.PointerClick, GoGameRoom);
UIManager.AddEvent(BtnBattle.gameObject, EventTriggerType.PointerEnter, OnHover);
UIManager.AddEvent(BtnBattle.gameObject, EventTriggerType.PointerExit, OnExit);
#endif
var BtnContainer = transform.Find("MainFuncContainer");
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerClick, GoRide);
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerEnter, OnHover);
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerExit, OnExit);
@ -89,28 +79,28 @@ public class HomeController : PFUIPanel
});
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerEnter, OnHover);
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerExit, OnExit);
var avatar = userInfo.Find("Avatar").GetComponent<RawImage>();
var rect = ((RectTransform)avatar.transform).rect;
var avatar = userInfo.Find("Avatar").GetComponent<RawImage>();
var rect = ((RectTransform)avatar.transform).rect;
SetRounded(avatar.transform, rect.height);
UIManager.AddEvent(avatar.gameObject, EventTriggerType.PointerClick, x =>
{
UIManager.ShowUserInfoPanel();
});
UIManager.AddEvent(userInfo.Find("BtnMore").gameObject, EventTriggerType.PointerClick, x =>
{
UIManager.ShowUserInfoPanel();
//UIManager.ShowConfirm("Quit", "Do you want to quit PowerFun?", null);
});
if (transform.Find("Other/BtnRower"))
if (transform.Find("Other/BtnRower"))
{
UIManager.AddEvent(transform.Find("Other/BtnRower").gameObject, EventTriggerType.PointerClick, b =>
{
UIManager.ShowRowerPanel();
});
}
//GetSummary();
dict = new Dictionary<string, Sprite[]>
{
@ -129,18 +119,7 @@ public class HomeController : PFUIPanel
// }
//},
};
}
private void GoGameRoom(BaseEventData e)
{
#if UNITY_STANDALONE_WIN
OnExit(e);
var pe = (PointerEventData)e;
if (pe == null)
return;
var parent = pe.pointerEnter.transform.parent;
UIManager.ShowGameRoomListPanel();
#endif
}
private void GoRide(BaseEventData e)
{
@ -158,11 +137,11 @@ public class HomeController : PFUIPanel
{
UIManager.ShowNewRouteOverviewPanel();
}
#endif
OnExit(e);
}
void goTraining(BaseEventData e)
void goTraining(BaseEventData e)
{
#if !(UNITY_IOS || UNITY_ANDROID)
var path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\PowerFun\Rhino.PowerFun.exe";
@ -205,7 +184,7 @@ public class HomeController : PFUIPanel
UIManager.ShowRaceHomePanel();
OnExit(e);
}
private void OnHover(BaseEventData e)
private void OnHover(BaseEventData e)
{
var pe = (PointerEventData)e;
var parent = pe.pointerEnter.transform.parent;
@ -217,10 +196,6 @@ public class HomeController : PFUIPanel
//parent.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
parent.DOScale(new Vector3(1.05f, 1.05f, 0), 0.3f);
//parent.GetComponent<RectTransform>().localScale = ;
#if UNITY_STANDALONE_WIN
parent.Find("ImageL").gameObject.SetActive(true);
#endif
}
private void OnExit(BaseEventData e)
{
@ -228,15 +203,12 @@ public class HomeController : PFUIPanel
var parent = pe.pointerEnter.transform.parent;
//parent.Find("Image").GetComponent<Image>().sprite = Resources.Load<Sprite>("Images/home/Entrance - ROUTES_nomal");
//parent.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#5C5C6E");
if (dict.ContainsKey(parent.name))
if (dict.ContainsKey(parent.name))
{
parent.Find("Image").GetComponent<Image>().sprite = dict[parent.name][0];
}
parent.DOScale(new Vector3(1f, 1f, 0), 0.3f);
//parent.GetComponent<RectTransform>().localScale = new Vector3(1f, 1f, 0);
#if UNITY_STANDALONE_WIN
parent.Find("ImageL").gameObject.SetActive(false);
#endif
}
void MoreFunc()
{
@ -250,7 +222,7 @@ public class HomeController : PFUIPanel
userInfo.Find("NickName").GetComponent<Text>().text = App.CurrentUser.Nickname;
userInfo.Find("GroupTop").Find("FtpContainer").Find("FtpValue").GetComponent<Text>().text = App.CurrentUser.FTP.ToString();
userInfo.Find("GroupTop").Find("WeightContainer").Find("WeightValue").GetComponent<Text>().text = App.CurrentUser.Weight.ToString();
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGValue").GetComponent<Text>().text = $"{ (App.CurrentUser.FTP/ App.CurrentUser.Weight).ToString("0.0") }";
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGValue").GetComponent<Text>().text = $"{ (App.CurrentUser.FTP / App.CurrentUser.Weight).ToString("0.0") }";
userInfo.Find("IDText").GetComponent<Text>().text = "ID:" + App.CurrentUser.Id.ToString("000000");
if (!string.IsNullOrWhiteSpace(App.CurrentUser.Unionid))
{
@ -267,22 +239,22 @@ public class HomeController : PFUIPanel
Utils.DisplayHead(userInfo.Find("Avatar").GetComponent<RawImage>(), App.CurrentUser.WxHeadImg);
userInfo.Find("Country").GetComponent<RawImage>().texture = UIManager.Instance.loginRegOptions.GetCountryImageByName(App.CurrentUser.Country);
userInfo.Find("CaloriesContainer").Find("CaloriesValue").GetComponent<Text>().text = double.Parse(summary.Kcal,CultureInfo.InvariantCulture).ToString("0") +" KCAL";
userInfo.Find("KMContainer").Find("KMValue").GetComponent<Text>().text = summary.TotalDistance.ToString("0") +" KM";
userInfo.Find("ClimbContainer").Find("ClimbValue").GetComponent<Text>().text = double.Parse(summary.TotalClimb,CultureInfo.InvariantCulture).ToString("0") + " M";
userInfo.Find("CaloriesContainer").Find("CaloriesValue").GetComponent<Text>().text = double.Parse(summary.Kcal, CultureInfo.InvariantCulture).ToString("0") + " KCAL";
userInfo.Find("KMContainer").Find("KMValue").GetComponent<Text>().text = summary.TotalDistance.ToString("0") + " KM";
userInfo.Find("ClimbContainer").Find("ClimbValue").GetComponent<Text>().text = double.Parse(summary.TotalClimb, CultureInfo.InvariantCulture).ToString("0") + " M";
userInfo.Find("GroupTop").Find("FtpContainer").Find("FtpTime").GetComponent<Text>().text = App.CurrentUser.LastUpdateFtpTime.ToString("dd.MM.yyyy");
userInfo.Find("GroupTop").Find("WeightContainer").Find("WeightTime").GetComponent<Text>().text = App.CurrentUser.LastUpdateWeightTime.ToString("dd.MM.yyyy");
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGTime").GetComponent<Text>().text =
DateTime.Compare(App.CurrentUser.LastUpdateFtpTime, App.CurrentUser.LastUpdateWeightTime)>0
? App.CurrentUser.LastUpdateFtpTime.ToString("dd.MM.yyyy")
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGTime").GetComponent<Text>().text =
DateTime.Compare(App.CurrentUser.LastUpdateFtpTime, App.CurrentUser.LastUpdateWeightTime) > 0
? App.CurrentUser.LastUpdateFtpTime.ToString("dd.MM.yyyy")
: App.CurrentUser.LastUpdateWeightTime.ToString("dd.MM.yyyy");
//新版设计稿
var todayData = transform.Find("TodayData");
if (todayData)
if (todayData)
{
Utils.DisplayHead(todayData.Find("Avatar").GetComponent<RawImage>(), App.CurrentUser.WxHeadImg);
todayData.Find("Datas/Distance/Value").GetComponent<Text>().text = $"{summary.ContinuesDay}"+ (summary.ContinuesDay > 1 ? App.GetLocalString("DAYS") : App.GetLocalString("DAY"));
todayData.Find("Datas/Distance/Value").GetComponent<Text>().text = $"{summary.ContinuesDay}" + (summary.ContinuesDay > 1 ? App.GetLocalString("DAYS") : App.GetLocalString("DAY"));
todayData.Find("Datas/Climb/Value").GetComponent<Text>().text = $"{summary.ContinuesKm.ToString("#0.0")}";//$"{double.Parse(summary.TotalClimb, CultureInfo.InvariantCulture).ToString("0")}M";
todayData.Find("Datas/Carlories/Value").GetComponent<Text>().text = $"{summary.ContinuesKcal.ToString("#0")}";
//todayData.Find("Datas/Distance/Rank").GetComponent<Text>().text = summary.CurrentTotalDistance == 0 ? "——" : $"+{summary.CurrentTotalDistance.ToString("#0")}";
@ -293,7 +265,7 @@ public class HomeController : PFUIPanel
//todayData.Find("ID").GetComponent<Text>().text = $"ID:{App.CurrentUser.Id.ToString("000000")}";
#endif
}
}
async void GetSummary()
{
@ -364,7 +336,7 @@ public class HomeController : PFUIPanel
//d.Find("NickName").GetComponent<Text>().text = list[0].NickName;
//c.Find("NickName").GetComponent<Text>().text = list[2].NickName;
}
else
else
{
transform.Find("MaxRankingData").gameObject.SetActive(false);
}
@ -387,7 +359,7 @@ public class HomeController : PFUIPanel
se.Append(s1);
se.Append(t.DORotate(Vector3.zero, 0.5f));
}
void SetMessage(MapMaxRanking e)
void SetMessage(MapMaxRanking e)
{
var m = transform.Find("MaxRankingData");
Utils.DisplayHead(m.transform.Find("Avatar").GetComponent<RawImage>(), e.WxHeadImg);
@ -412,15 +384,15 @@ public class HomeController : PFUIPanel
private async Task GetNotify()
{
var r = await ConfigHelper.userApi.GetNotify();
if (r.result)
if (r.result)
{
var lm = transform.Find("LongMessage");
if (r.data.Value<int>("Id") > 1)
{
lm.gameObject.SetActive(true);
lm.GetComponent<LongMessageScript>().Initial(r.data["Content"].ToString().Replace("\r\n"," "));
lm.GetComponent<LongMessageScript>().Initial(r.data["Content"].ToString().Replace("\r\n", " "));
}
else
else
{
lm.gameObject.SetActive(false);
}

View File

@ -29,6 +29,7 @@ public class NewHomeController : PFUIPanel
[SerializeField] Button BtnRide;
[SerializeField] Transform userInfo;
Transform BtnMatch, BtnTraining;
Transform BtnBattle;
private MainNav mainNav;
private Dictionary<string, Sprite[]> dict;
// Start is called before the first frame update
@ -39,7 +40,7 @@ public class NewHomeController : PFUIPanel
{
UIManager.ShowUserInfoPanel();
});
var BtnContainer = transform.Find("MainFuncContainer");
#if UNITY_ANDROID || UNITY_IOS
var nav = transform.Find("MainNav-mobile").GetComponent<NewMainNav>();
nav.SetButtonActive(new List<int> { 1, 3, 4, 6 });
@ -49,22 +50,23 @@ public class NewHomeController : PFUIPanel
UIManager.ShowResultListPanel();
});
#else
UIManager.AddEvent(transform.Find("TodayData/Distance").gameObject, EventTriggerType.PointerClick, b =>
UIManager.AddEvent(transform.Find("TodayData/Datas/Distance").gameObject, EventTriggerType.PointerClick, b =>
{
UIManager.ShowUserInfoPanel();
});
UIManager.AddEvent(transform.Find("ProfileBtn").gameObject, EventTriggerType.PointerClick, b =>
{
UIManager.ShowEditUserPanel();
});
UIManager.AddEvent(transform.Find("ChangeBtn").gameObject, EventTriggerType.PointerClick, b =>
mainNav = this.transform.Find("MainNav").GetComponent<MainNav>();
mainNav.ShowExit();
UIManager.AddEvent(transform.Find("TodayData/ChangePlayerBtn").gameObject, EventTriggerType.PointerClick, b =>
{
UIManager.ShowChangePlayerPanel();
});
mainNav = this.transform.Find("MainNav").GetComponent<MainNav>();
mainNav.ShowExit();
BtnBattle = BtnContainer.Find("BtnBattle");
UIManager.AddEvent(BtnBattle.gameObject, EventTriggerType.PointerClick, GoGameRoom);
UIManager.AddEvent(BtnBattle.gameObject, EventTriggerType.PointerEnter, OnHover);
UIManager.AddEvent(BtnBattle.gameObject, EventTriggerType.PointerExit, OnExit);
#endif
var BtnContainer = transform.Find("MainFuncContainer");
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerClick, GoRide);
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerEnter, OnHover);
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerExit, OnExit);
@ -84,28 +86,28 @@ public class NewHomeController : PFUIPanel
});
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerEnter, OnHover);
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerExit, OnExit);
var avatar = userInfo.Find("Avatar").GetComponent<RawImage>();
var rect = ((RectTransform)avatar.transform).rect;
var avatar = userInfo.Find("Avatar").GetComponent<RawImage>();
var rect = ((RectTransform)avatar.transform).rect;
SetRounded(avatar.transform, rect.height);
UIManager.AddEvent(avatar.gameObject, EventTriggerType.PointerClick, x =>
{
UIManager.ShowUserInfoPanel();
});
UIManager.AddEvent(userInfo.Find("BtnMore").gameObject, EventTriggerType.PointerClick, x =>
{
UIManager.ShowUserInfoPanel();
//UIManager.ShowConfirm("Quit", "Do you want to quit PowerFun?", null);
});
if (transform.Find("Other/BtnRower"))
if (transform.Find("Other/BtnRower"))
{
UIManager.AddEvent(transform.Find("Other/BtnRower").gameObject, EventTriggerType.PointerClick, b =>
{
UIManager.ShowRowerPanel();
});
}
//GetSummary();
dict = new Dictionary<string, Sprite[]>
{
@ -124,7 +126,18 @@ public class NewHomeController : PFUIPanel
// }
//},
};
}
private void GoGameRoom(BaseEventData e)
{
#if UNITY_STANDALONE_WIN
OnExit(e);
var pe = (PointerEventData)e;
if (pe == null)
return;
var parent = pe.pointerEnter.transform.parent;
UIManager.ShowGameRoomListPanel();
#endif
}
private void GoRide(BaseEventData e)
{
@ -142,11 +155,11 @@ public class NewHomeController : PFUIPanel
{
UIManager.ShowNewRouteOverviewPanel();
}
#endif
OnExit(e);
}
void goTraining(BaseEventData e)
void goTraining(BaseEventData e)
{
#if !(UNITY_IOS || UNITY_ANDROID)
var path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\PowerFun\Rhino.PowerFun.exe";
@ -189,7 +202,7 @@ public class NewHomeController : PFUIPanel
UIManager.ShowRaceHomePanel();
OnExit(e);
}
private void OnHover(BaseEventData e)
private void OnHover(BaseEventData e)
{
var pe = (PointerEventData)e;
var parent = pe.pointerEnter.transform.parent;
@ -201,6 +214,10 @@ public class NewHomeController : PFUIPanel
//parent.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
parent.DOScale(new Vector3(1.05f, 1.05f, 0), 0.3f);
//parent.GetComponent<RectTransform>().localScale = ;
#if UNITY_STANDALONE_WIN
parent.Find("ImageL").gameObject.SetActive(true);
#endif
}
private void OnExit(BaseEventData e)
{
@ -208,12 +225,15 @@ public class NewHomeController : PFUIPanel
var parent = pe.pointerEnter.transform.parent;
//parent.Find("Image").GetComponent<Image>().sprite = Resources.Load<Sprite>("Images/home/Entrance - ROUTES_nomal");
//parent.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#5C5C6E");
if (dict.ContainsKey(parent.name))
if (dict.ContainsKey(parent.name))
{
parent.Find("Image").GetComponent<Image>().sprite = dict[parent.name][0];
}
parent.DOScale(new Vector3(1f, 1f, 0), 0.3f);
//parent.GetComponent<RectTransform>().localScale = new Vector3(1f, 1f, 0);
#if UNITY_STANDALONE_WIN
parent.Find("ImageL").gameObject.SetActive(false);
#endif
}
void MoreFunc()
{
@ -227,7 +247,7 @@ public class NewHomeController : PFUIPanel
userInfo.Find("NickName").GetComponent<Text>().text = App.CurrentUser.Nickname;
userInfo.Find("GroupTop").Find("FtpContainer").Find("FtpValue").GetComponent<Text>().text = App.CurrentUser.FTP.ToString();
userInfo.Find("GroupTop").Find("WeightContainer").Find("WeightValue").GetComponent<Text>().text = App.CurrentUser.Weight.ToString();
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGValue").GetComponent<Text>().text = $"{ (App.CurrentUser.FTP/ App.CurrentUser.Weight).ToString("0.0") }";
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGValue").GetComponent<Text>().text = $"{ (App.CurrentUser.FTP / App.CurrentUser.Weight).ToString("0.0") }";
userInfo.Find("IDText").GetComponent<Text>().text = "ID:" + App.CurrentUser.Id.ToString("000000");
if (!string.IsNullOrWhiteSpace(App.CurrentUser.Unionid))
{
@ -244,22 +264,22 @@ public class NewHomeController : PFUIPanel
Utils.DisplayHead(userInfo.Find("Avatar").GetComponent<RawImage>(), App.CurrentUser.WxHeadImg);
userInfo.Find("Country").GetComponent<RawImage>().texture = UIManager.Instance.loginRegOptions.GetCountryImageByName(App.CurrentUser.Country);
userInfo.Find("CaloriesContainer").Find("CaloriesValue").GetComponent<Text>().text = double.Parse(summary.Kcal,CultureInfo.InvariantCulture).ToString("0") +" KCAL";
userInfo.Find("KMContainer").Find("KMValue").GetComponent<Text>().text = summary.TotalDistance.ToString("0") +" KM";
userInfo.Find("ClimbContainer").Find("ClimbValue").GetComponent<Text>().text = double.Parse(summary.TotalClimb,CultureInfo.InvariantCulture).ToString("0") + " M";
userInfo.Find("CaloriesContainer").Find("CaloriesValue").GetComponent<Text>().text = double.Parse(summary.Kcal, CultureInfo.InvariantCulture).ToString("0") + " KCAL";
userInfo.Find("KMContainer").Find("KMValue").GetComponent<Text>().text = summary.TotalDistance.ToString("0") + " KM";
userInfo.Find("ClimbContainer").Find("ClimbValue").GetComponent<Text>().text = double.Parse(summary.TotalClimb, CultureInfo.InvariantCulture).ToString("0") + " M";
userInfo.Find("GroupTop").Find("FtpContainer").Find("FtpTime").GetComponent<Text>().text = App.CurrentUser.LastUpdateFtpTime.ToString("dd.MM.yyyy");
userInfo.Find("GroupTop").Find("WeightContainer").Find("WeightTime").GetComponent<Text>().text = App.CurrentUser.LastUpdateWeightTime.ToString("dd.MM.yyyy");
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGTime").GetComponent<Text>().text =
DateTime.Compare(App.CurrentUser.LastUpdateFtpTime, App.CurrentUser.LastUpdateWeightTime)>0
? App.CurrentUser.LastUpdateFtpTime.ToString("dd.MM.yyyy")
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGTime").GetComponent<Text>().text =
DateTime.Compare(App.CurrentUser.LastUpdateFtpTime, App.CurrentUser.LastUpdateWeightTime) > 0
? App.CurrentUser.LastUpdateFtpTime.ToString("dd.MM.yyyy")
: App.CurrentUser.LastUpdateWeightTime.ToString("dd.MM.yyyy");
//新版设计稿
var todayData = transform.Find("TodayData");
if (todayData)
if (todayData)
{
Utils.DisplayHead(todayData.Find("Avatar").GetComponent<RawImage>(), App.CurrentUser.WxHeadImg);
todayData.Find("Distance/Value").GetComponent<Text>().text = $"{summary.ContinuesDay}"+ (summary.ContinuesDay > 1 ? App.GetLocalString("DAYS") : App.GetLocalString("DAY"));
todayData.Find("Datas/Distance/Value").GetComponent<Text>().text = $"{summary.ContinuesDay}" + (summary.ContinuesDay > 1 ? App.GetLocalString("DAYS") : App.GetLocalString("DAY"));
todayData.Find("Datas/Climb/Value").GetComponent<Text>().text = $"{summary.ContinuesKm.ToString("#0.0")}";//$"{double.Parse(summary.TotalClimb, CultureInfo.InvariantCulture).ToString("0")}M";
todayData.Find("Datas/Carlories/Value").GetComponent<Text>().text = $"{summary.ContinuesKcal.ToString("#0")}";
//todayData.Find("Datas/Distance/Rank").GetComponent<Text>().text = summary.CurrentTotalDistance == 0 ? "——" : $"+{summary.CurrentTotalDistance.ToString("#0")}";
@ -270,7 +290,7 @@ public class NewHomeController : PFUIPanel
//todayData.Find("ID").GetComponent<Text>().text = $"ID:{App.CurrentUser.Id.ToString("000000")}";
#endif
}
}
async void GetSummary()
{
@ -304,21 +324,21 @@ public class NewHomeController : PFUIPanel
// Update is called once per frame
void Update()
{
//maxt -= Time.deltaTime;
//if (maxt <= 0)
//{
// GetMaxRanking();
// maxt += 60f * 5;
//}
//if (maxdataTime > 0)
//{
// maxdataTime -= Time.deltaTime;
//}
//else if (maxdataTime < 0)
//{
// DORotateMaxData();
// maxdataTime += 10f;
//}
maxt -= Time.deltaTime;
if (maxt <= 0)
{
GetMaxRanking();
maxt += 60f * 5;
}
if (maxdataTime > 0)
{
maxdataTime -= Time.deltaTime;
}
else if (maxdataTime < 0)
{
DORotateMaxData();
maxdataTime += 10f;
}
}
private async void GetMaxRanking()
{
@ -341,7 +361,7 @@ public class NewHomeController : PFUIPanel
//d.Find("NickName").GetComponent<Text>().text = list[0].NickName;
//c.Find("NickName").GetComponent<Text>().text = list[2].NickName;
}
else
else
{
transform.Find("MaxRankingData").gameObject.SetActive(false);
}
@ -364,7 +384,7 @@ public class NewHomeController : PFUIPanel
se.Append(s1);
se.Append(t.DORotate(Vector3.zero, 0.5f));
}
void SetMessage(MapMaxRanking e)
void SetMessage(MapMaxRanking e)
{
var m = transform.Find("MaxRankingData");
Utils.DisplayHead(m.transform.Find("Avatar").GetComponent<RawImage>(), e.WxHeadImg);
@ -381,7 +401,7 @@ public class NewHomeController : PFUIPanel
transform.MyDOFade();
GetSummary();
#if UNITY_STANDALONE_WIN
//GetNotify();
GetNotify();
#endif
//transform.Find("Panel (1)").GetComponent<test>().startPage();
}
@ -389,15 +409,15 @@ public class NewHomeController : PFUIPanel
private async Task GetNotify()
{
var r = await ConfigHelper.userApi.GetNotify();
if (r.result)
if (r.result)
{
var lm = transform.Find("LongMessage");
if (r.data.Value<int>("Id") > 1)
{
lm.gameObject.SetActive(true);
lm.GetComponent<LongMessageScript>().Initial(r.data["Content"].ToString().Replace("\r\n"," "));
lm.GetComponent<LongMessageScript>().Initial(r.data["Content"].ToString().Replace("\r\n", " "));
}
else
else
{
lm.gameObject.SetActive(false);
}

View File

@ -250,8 +250,8 @@ public class TestVideoController : MonoBehaviour
private void Turn()
{
var currentFrame = GetCurrentFrame();
//控制人物的转向
var p = new Vector3(0, pre.RotationY, pre.RotationZ);
//控制人物的转向
var p = new Vector3(0, pre.RotationY, pre.RotationZ);
var q = new Vector3(0, next.RotationY, next.RotationZ);
var t = next.KeyFrame - pre.KeyFrame == 0? 1 : (float)(currentFrame - pre.KeyFrame) / (float)(next.KeyFrame - pre.KeyFrame);
var rt = Vector3.Lerp(p, q, t);