From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XEditor/XCutSceneEditor/XCutSceneUI.cs | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 Client/Assets/Scripts/XEditor/XCutSceneEditor/XCutSceneUI.cs (limited to 'Client/Assets/Scripts/XEditor/XCutSceneEditor/XCutSceneUI.cs') diff --git a/Client/Assets/Scripts/XEditor/XCutSceneEditor/XCutSceneUI.cs b/Client/Assets/Scripts/XEditor/XCutSceneEditor/XCutSceneUI.cs new file mode 100644 index 00000000..ad881dae --- /dev/null +++ b/Client/Assets/Scripts/XEditor/XCutSceneEditor/XCutSceneUI.cs @@ -0,0 +1,77 @@ +#if UNITY_EDITOR +using UnityEngine; +using XUtliPoolLib; +using XEditor; + +public class XCutSceneUI : XSingleton +{ + public UISprite m_BG; + public UILabel m_Text; + public UILabel m_Skip; + public UIPlayTween m_IntroTween; + public UILabel m_Name; + + public GameObject _objUI; + + public override bool Init() + { + UIPanel p = NGUITools.CreateUI(false); + + _objUI = XResourceLoaderMgr.singleton.CreateFromPrefab("UI/Common/CutSceneUI") as GameObject; + + if (null != _objUI) + { + _objUI.transform.parent = p.transform; + _objUI.transform.localPosition = new Vector3(0.0f, 0.0f, 0); + _objUI.transform.localScale = new Vector3(1, 1, 1); + } + + UIRoot rt = p.gameObject.GetComponent(); + rt.scalingStyle = UIRoot.Scaling.FixedSize; + rt.manualHeight = 1148; + + m_Text = _objUI.transform.Find("_canvas/DownBG/Text").GetComponent(); + + m_Name = _objUI.transform.Find("_canvas/Intro/Name").GetComponent(); + m_IntroTween = _objUI.transform.Find("_canvas/Intro").GetComponent(); + + m_Text.text = ""; + + _objUI.SetActive(false); + m_IntroTween.gameObject.SetActive(false); + return true; + } + + public void SetText(string text) + { + m_Text.text = text; + } + + public void SetVisible(bool visible) + { + _objUI.SetActive(visible); + } + + public void SetIntroText(bool enabled, string name, string text, float x, float y) + { + if (!_objUI.activeInHierarchy) return; + + if (enabled) + { + m_Name.text = name; + + m_IntroTween.gameObject.transform.localPosition = new Vector2(x, y); + m_IntroTween.tweenGroup = 0; + m_IntroTween.ResetByGroup(true, 0); + m_IntroTween.Play(true); + + } + else + { + m_IntroTween.tweenGroup = 1; + m_IntroTween.ResetByGroup(true, 1); + m_IntroTween.Play(true); + } + } +} +#endif \ No newline at end of file -- cgit v1.1-26-g67d0