修改细节

This commit is contained in:
Caiyanpeng committed 2021-11-03 13:48:53 +08:00
1 parent e8a12452ca
commit baab5a9fb0
10 files changed
+1960 -842

No files matched your search

+97
View File
@@ -0,0 +1,97 @@
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
using Assets.Scripts.UI.Control;
using System;
using UnityEngine.EventSystems;
using UnityEngine.Events;
public class AlertV1 : PFUIPanel
{
private PFUIText _title;
private PFUIText _content;
private PfUIButton _ok;
private PfUIButton _cancel;
protected override void Awake()
{
//var rect = this.gameObject.AddComponent<RectTransform>();
//var layout = this.gameObject.AddComponent<VerticalLayoutGroup>();
//layout.spacing = 20f;
//layout.childAlignment = TextAnchor.MiddleCenter;
var wrap = this.transform.Find("GameObject");
_title = wrap.Find("Title").GetComponent<PFUIText>();
_content = wrap.Find("Content").GetComponent<PFUIText>();
//text.transform.SetParent(layout.transform);
//text.text = "阿斯达克法拉盛地方";
///text = layout.transform.GetChild(0).gameObject.AddComponent<Text>();
//text = GetComponentInChildren<Transform>().gameObject.AddComponent<Text>();
_ok = wrap.Find("Ok").GetComponent<PfUIButton>();
_cancel = wrap.Find("Cancel").GetComponent<PfUIButton>();
//button.onClick.AddListener(() =>
//{
// this.Close();
// //this.Destroy(true);
// //DestroyImmediate(this);
//});
UIManager.AddEvent(_ok.gameObject, EventTriggerType.PointerClick, (e) =>
{
this.Close();
});
UIManager.AddEvent(_cancel.gameObject, EventTriggerType.PointerClick, (e) =>
{
this.Close();
});
}
// Start is called before the first frame update
protected override void Start()
{
}
public void Set(string title, string content)
{
//if(text == null)
//{
// return;
//}
//text.text = txt;
_title.Text = title;
_content.Text = content;
}
// Update is called once per frame
void Update()
{
}
public override void Show()
{
var panel = this.transform.Find("Panel");
var bg = panel.GetComponent<Image>();
//bg.alphaHitTestMinimumThreshold
var color = bg.color;
color.a = 0.6f;
bg.color = color;
base.Show();
}
public override void Close()
{
var panel = this.transform.Find("Panel");
var bg = panel.GetComponent<Image>();
bg.DOFade(0, 0.2f).OnComplete(() =>
{
this.gameObject.SetActive(false);
});
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: faa1e2e3946e08546b5b6a80dd5b01d0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+1 -1
View File
@@ -223,7 +223,7 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
}
else
{
UIManager.ShowAlert(r.errMsg);
UIManager.ShowAlert("WARNING", r.errMsg);
}
}
NearRouteModel model { get; set; }