Merge remote-tracking branch 'origin/dev' into dev_lishuo
# Conflicts: # Assets/NuGet.meta # Assets/Resources/Images/Ride.meta # Assets/Resources/Sound.meta # Assets/Scripts/App.cs # Assets/Scripts/UI/Prefab/BigMap/Tips.cs # Assets/StreamingAssets.meta
This commit is contained in:
commit
70626ae741
46 files changed
+11645
-3948
No files matched your search
@@ -41,14 +41,6 @@ public class BigMapController : PFUIPanel
|
||||
mapManager = this.transform.Find("Map").GetComponent<AbstractMap>();
|
||||
mapManager.OnInitialized += MapManager_OnInitialized;
|
||||
mapManager.OnUpdated += MapManager_OnUpdated;
|
||||
mapManager.OnMapRedrawn += () =>
|
||||
{
|
||||
//Debug.Log("map redrawn");
|
||||
};
|
||||
mapManager.OnTileFinished += (e) =>
|
||||
{
|
||||
//Debug.Log("finished");
|
||||
};
|
||||
|
||||
//// mapManager.OnTileFinished += MapManager_OnTileFinished;
|
||||
//mapManager.SetZoom(13);
|
||||
@@ -58,26 +50,22 @@ public class BigMapController : PFUIPanel
|
||||
|
||||
canvas = this.transform.Find("Canvas").gameObject;
|
||||
canvas.GetComponent<Canvas>().worldCamera = Camera.main;
|
||||
var goList = canvas.transform.Find("GoList");
|
||||
var goList = canvas.transform.Find("SwitchMode");
|
||||
SetRounded(goList, 64);
|
||||
UIManager.AddEvent(goList.gameObject, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
//App.MainSceneParam.Add("Name", "MapListPanel");
|
||||
//SceneManager.LoadScene("MainScene");
|
||||
|
||||
mapManager.Destroy();
|
||||
|
||||
UIManager.ShowMapListPanel();
|
||||
|
||||
//this.gameObject.SetActive(false);
|
||||
DestroyImmediate(this.gameObject);
|
||||
});
|
||||
|
||||
var panel = canvas.transform.Find("Panel");
|
||||
SetRounded(panel,30f);
|
||||
base.SetRounded(panel,30f);
|
||||
|
||||
content = panel.Find("Scroll View").Find("Viewport").Find("Content").gameObject;
|
||||
var input = panel.Find("InputField");
|
||||
SetRounded(input, 20f);
|
||||
base.SetRounded(input, 20f);
|
||||
keyword = input.Find("Text").GetComponent<Text>();
|
||||
var searchBtn = input.Find("Search").gameObject;
|
||||
UIManager.AddEvent(searchBtn, EventTriggerType.PointerClick, Search);
|
||||
@@ -85,20 +73,26 @@ public class BigMapController : PFUIPanel
|
||||
tips = ((GameObject)Instantiate(Resources.Load("UI/Prefab/BigMap/Tips"), canvas.transform.Find("TipsContainer"))).GetComponent<Tips>();
|
||||
tips.Hide();
|
||||
|
||||
BindHeadImage();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 给对象设置圆角
|
||||
/// 绑定头像
|
||||
/// </summary>
|
||||
/// <param name="panel"></param>
|
||||
/// <param name="radius"></param>
|
||||
void SetRounded(Transform panel, float radius)
|
||||
void BindHeadImage()
|
||||
{
|
||||
var rounded = Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial");
|
||||
var material = Instantiate(rounded);
|
||||
var rect = ((RectTransform)panel).rect;
|
||||
material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, radius, 0));
|
||||
panel.GetComponent<Image>().material = material;
|
||||
var headImage = canvas.transform.Find("HeadImage").GetComponent<RawImage>();
|
||||
//var material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
|
||||
var rect = ((RectTransform)headImage.transform).rect;
|
||||
//material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height, 0));
|
||||
//headImage.material = material;
|
||||
SetRounded(headImage.transform, rect.height);
|
||||
|
||||
Utils.DisplayImage(StartCoroutine, headImage, App.CurrentUser.WxHeadImg);
|
||||
|
||||
UIManager.AddEvent(headImage.gameObject, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
UIManager.ShowEditUserPanel();
|
||||
});
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
|
||||
@@ -6,6 +6,7 @@ using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
@@ -21,6 +22,9 @@ public class EditUserController : PFUIPanel
|
||||
private Text mNameText;
|
||||
private RawImage mHeadImage;
|
||||
private UserApi userApi;
|
||||
private Button mCancelButton;
|
||||
private Button mBackButton;
|
||||
PfUIButton mChangeAvatar;
|
||||
protected override void Awake()
|
||||
{
|
||||
userApi = new UserApi();
|
||||
@@ -33,7 +37,43 @@ public class EditUserController : PFUIPanel
|
||||
mMonthDropdown = panel.Find("MonthDropdown").GetComponent<PFUIDropdown>();
|
||||
mDayDropdown = panel.Find("DayDropdown").GetComponent<PFUIDropdown>();
|
||||
mSaveButton = this.transform.Find("SaveButton").GetComponent<Button>();
|
||||
mCancelButton = this.transform.Find("CancelButton").GetComponent<Button>();
|
||||
mHeadImage = this.transform.Find("HeadImage").GetComponent<RawImage>();
|
||||
mBackButton = this.transform.Find("BackButton").GetComponent<Button>();
|
||||
UIManager.AddEvent(mBackButton.gameObject, EventTriggerType.PointerClick, Cancel);
|
||||
|
||||
mChangeAvatar = this.transform.Find("ChangeAvatar").GetComponent<PfUIButton>();
|
||||
UIManager.AddEvent(mChangeAvatar.gameObject, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
OpenFileName ofn = new OpenFileName();
|
||||
|
||||
ofn.structSize = Marshal.SizeOf(ofn);
|
||||
|
||||
ofn.filter = "All Files\0*.*\0\0";
|
||||
|
||||
ofn.file = new string(new char[256]);
|
||||
|
||||
ofn.maxFile = ofn.file.Length;
|
||||
|
||||
ofn.fileTitle = new string(new char[64]);
|
||||
|
||||
ofn.maxFileTitle = ofn.fileTitle.Length;
|
||||
|
||||
ofn.initialDir = UnityEngine.Application.dataPath;//默认路径
|
||||
|
||||
ofn.title = "Open Project";
|
||||
|
||||
ofn.defExt = "JPG";//显示文件的类型
|
||||
//注意 一下项目不一定要全选 但是0x00000008项不要缺少
|
||||
ofn.flags = 0x00080000 | 0x00001000 | 0x00000800 | 0x00000200 | 0x00000008;//OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST| OFN_ALLOWMULTISELECT|OFN_NOCHANGEDIR
|
||||
|
||||
|
||||
if (Win32.GetOpenFileName(ofn))
|
||||
{
|
||||
Debug.Log(ofn.file);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
mSexDropdown.ClearOptions();
|
||||
mSexDropdown.AddOptions(new List<string>
|
||||
@@ -68,7 +108,6 @@ public class EditUserController : PFUIPanel
|
||||
{
|
||||
SetDayDropdown();
|
||||
};
|
||||
|
||||
|
||||
mDayDropdown.ClearOptions();
|
||||
SetDayDropdown();
|
||||
@@ -84,20 +123,17 @@ public class EditUserController : PFUIPanel
|
||||
|
||||
}
|
||||
|
||||
async void LoadDataSync()
|
||||
void LoadDataSync()
|
||||
{
|
||||
Material material = null;
|
||||
if (material == null)
|
||||
{
|
||||
material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
|
||||
}
|
||||
var rect = ((RectTransform)mHeadImage.transform).rect;
|
||||
material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height, 0));
|
||||
mHeadImage.material = material;
|
||||
SetRounded(mHeadImage.transform, rect.height);
|
||||
|
||||
var currentUser = App.CurrentUser;
|
||||
|
||||
//var currentUser = App.CurrentUser;
|
||||
//mIdText.text = "ID:" + currentUser.Id.ToString();
|
||||
//mNameText.text = currentUser.Nickname;
|
||||
mIdText.text = currentUser.Id.ToString();
|
||||
mNameText.text = currentUser.Nickname;
|
||||
|
||||
Utils.DisplayImage(StartCoroutine, mHeadImage, currentUser.WxHeadImg);
|
||||
|
||||
//if (!string.IsNullOrWhiteSpace(currentUser.WxHeadImg))
|
||||
//{
|
||||
@@ -120,6 +156,7 @@ public class EditUserController : PFUIPanel
|
||||
//}
|
||||
|
||||
UIManager.AddEvent(mSaveButton.gameObject, EventTriggerType.PointerClick, Save);
|
||||
UIManager.AddEvent(mCancelButton.gameObject, EventTriggerType.PointerClick, Cancel);
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
@@ -169,4 +206,9 @@ public class EditUserController : PFUIPanel
|
||||
|
||||
UIManager.ShowAlert("result.errMsg");
|
||||
}
|
||||
|
||||
void Cancel(BaseEventData e)
|
||||
{
|
||||
UIManager.ShowHomePanel();
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,10 @@ public class HomeController : PFUIPanel
|
||||
{
|
||||
UIManager.ShowAlert("test");
|
||||
});
|
||||
|
||||
UIManager.AddEvent(transform.Find("MainNav").Find("Setting").gameObject, EventTriggerType.PointerClick, x =>
|
||||
{
|
||||
UIManager.ShowSettingModal();
|
||||
});
|
||||
GetSummary();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,13 +39,14 @@ public class MapListController : PFUIPanel
|
||||
}
|
||||
}
|
||||
private bool isEnd = false;
|
||||
protected override void Start()
|
||||
protected override void Start()
|
||||
{
|
||||
//if (hardSelector != null)
|
||||
//{
|
||||
// hardSelector.onValueChanged.AddListener(ChangeHard);
|
||||
//}
|
||||
btnMapMode = this.transform.Find("BtnMapMode").gameObject;
|
||||
btnMapMode = this.transform.Find("SwitchMode").gameObject;
|
||||
SetRounded(btnMapMode.transform, 64);
|
||||
UIManager.AddEvent(btnMapMode, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
UIManager.ShowBigMapPanel();
|
||||
@@ -97,7 +98,7 @@ public class MapListController : PFUIPanel
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
BindHeadImage();
|
||||
GetList();
|
||||
if (scroll != null)
|
||||
{
|
||||
@@ -185,6 +186,25 @@ public class MapListController : PFUIPanel
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定头像
|
||||
/// </summary>
|
||||
void BindHeadImage()
|
||||
{
|
||||
var headImage = this.transform.Find("HeadImage").GetComponent<RawImage>();
|
||||
var material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
|
||||
var rect = ((RectTransform)headImage.transform).rect;
|
||||
material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height, 0));
|
||||
headImage.material = material;
|
||||
|
||||
Utils.DisplayImage(StartCoroutine, headImage, App.CurrentUser.WxHeadImg);
|
||||
|
||||
UIManager.AddEvent(headImage.gameObject, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
UIManager.ShowEditUserPanel();
|
||||
});
|
||||
}
|
||||
|
||||
private void OnEndDrag(BaseEventData arg0)
|
||||
{
|
||||
var scrollrect = scroll.GetComponent<ScrollRect>();
|
||||
|
||||
@@ -36,5 +36,30 @@ public class PFUIPanel : UIBehaviour
|
||||
}
|
||||
child.transform.SetParent(this.transform);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 给对象设置圆角
|
||||
/// </summary>
|
||||
/// <param name="panel"></param>
|
||||
/// <param name="radius"></param>
|
||||
protected void SetRounded(Transform panel, float radius)
|
||||
{
|
||||
var rounded = Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial");
|
||||
var material = Instantiate(rounded);
|
||||
var rect = ((RectTransform)panel).rect;
|
||||
material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, radius, 0));
|
||||
var img = panel.GetComponent<Image>();
|
||||
if (img != null)
|
||||
{
|
||||
img.material = material;
|
||||
return;
|
||||
}
|
||||
var rawImg = panel.GetComponent<RawImage>();
|
||||
if(rawImg != null)
|
||||
{
|
||||
rawImg.material = material;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
Reference in new issue
Block a user