修改细节
This commit is contained in:
1 parent
2663068574
commit
1254414415
35 files changed
+3557
-3071
No files matched your search
@@ -120,7 +120,7 @@ public class RaceHomeScript : RaceScript
|
||||
smallGame = Resources.Load<GameObject>("UI/Prefab/Race/ItemSmall"),
|
||||
bannerItem = Resources.Load<GameObject>("UI/Prefab/Race/Banner/BannerItem"),
|
||||
dotItem = Resources.Load<GameObject>("UI/Prefab/Race/Banner/DotItem");
|
||||
#if UNITY_ANDROID || UNITY_ANDROID
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
bannerItem = Resources.Load<GameObject>("UI/Prefab/Race/Banner/BannerItem-Mobile");
|
||||
smallGame = Resources.Load<GameObject>("UI/Prefab/Race/Mobile/ItemSmall-Mobile");
|
||||
#endif
|
||||
|
||||
@@ -18,6 +18,18 @@ public class RaceItemScript : MonoBehaviour
|
||||
public enum ItemType { big, small }
|
||||
private Transform parent;
|
||||
[SerializeField] ItemType myType;
|
||||
private string _from = null;
|
||||
|
||||
internal void Refresh()
|
||||
{
|
||||
if (mapCompetition == null) return;
|
||||
var res1 = ConfigHelper.mapCompetitionApi.GetById(mapCompetition.Id);
|
||||
if (res1.result)
|
||||
{
|
||||
Initial(res1.data, null);
|
||||
}
|
||||
}
|
||||
|
||||
public MapCompetition mapCompetition { get; set; }
|
||||
void Start()
|
||||
{
|
||||
@@ -40,12 +52,16 @@ public class RaceItemScript : MonoBehaviour
|
||||
});
|
||||
Utils.DisplayImage(transform.GetComponent<RawImage>(), mapCompetition.RouteCover, true);
|
||||
#else
|
||||
if (from == "list")
|
||||
if (string.IsNullOrEmpty(_from))
|
||||
{
|
||||
_from = from;
|
||||
}
|
||||
if (_from == "list")
|
||||
{
|
||||
Utils.DisplayImage(transform.GetComponent<RawImage>(), mapCompetition.RouteCover, true);
|
||||
transform.GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
UIManager.ShowRaceDetailModal(mapCompetition);
|
||||
UIManager.ShowRaceDetailModal(transform,mapCompetition);
|
||||
});
|
||||
}
|
||||
#endif
|
||||
@@ -69,7 +85,7 @@ public class RaceItemScript : MonoBehaviour
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
SetButtonGroup(mapCompetition);
|
||||
#else
|
||||
if (from != "list")
|
||||
if (_from != "list")
|
||||
{
|
||||
SetButtonGroup(mapCompetition);
|
||||
}
|
||||
@@ -272,11 +288,7 @@ public class RaceItemScript : MonoBehaviour
|
||||
//SetStatus(mapCompetition);
|
||||
//transform.Find("BtnContainer").gameObject.Destroy();
|
||||
//SetButtonGroup(mapCompetition);
|
||||
var res1 = ConfigHelper.mapCompetitionApi.GetById(mapCompetition.Id);
|
||||
if (res1.result)
|
||||
{
|
||||
Initial(res1.data, null);
|
||||
}
|
||||
Refresh();
|
||||
Utils.showToast(null, "success", type: 1);
|
||||
}
|
||||
else
|
||||
@@ -296,11 +308,7 @@ public class RaceItemScript : MonoBehaviour
|
||||
//transform.Find("BtnContainer").gameObject.Destroy();
|
||||
//SetButtonGroup(mapCompetition);
|
||||
App.CompetitionIdList.Remove(mapCompetition.Id);
|
||||
var res1 = ConfigHelper.mapCompetitionApi.GetById(mapCompetition.Id);
|
||||
if (res1.result)
|
||||
{
|
||||
Initial(res1.data, null);
|
||||
}
|
||||
Refresh();
|
||||
Utils.showToast(null, "success", type: 1);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -196,11 +196,11 @@ public class RaceListScript : RaceScript
|
||||
protected override void Start()
|
||||
{
|
||||
#if (UNITY_ANDROID || UNITY_IOS)
|
||||
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 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);
|
||||
#endif
|
||||
}
|
||||
private async Task Login()
|
||||
|
||||
@@ -13,8 +13,9 @@ public class RaceModalScript : RaceScript
|
||||
UIManager.AddEvent(transform.Find("Container/Exit").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
//停止计时器
|
||||
UIManager.CloseModal();
|
||||
gameObject.SetActive(false);
|
||||
transform.GetComponent<RaceScript>().SetCurrentItem(null);
|
||||
_parent.GetComponent<RaceItemScript>().Refresh();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -23,8 +24,14 @@ public class RaceModalScript : RaceScript
|
||||
{
|
||||
|
||||
}
|
||||
public void Initial(MapCompetition mapCompetition)
|
||||
public override void Show()
|
||||
{
|
||||
base.Show();
|
||||
}
|
||||
Transform _parent;
|
||||
public void Initial(Transform parent, MapCompetition mapCompetition)
|
||||
{
|
||||
_parent = parent;
|
||||
var item = transform.Find("Container/Main/ItemSmall-Mobile");
|
||||
|
||||
item.GetComponent<RaceItemScript>().Initial(mapCompetition, transform,"modal");
|
||||
|
||||
Reference in new issue
Block a user