| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- using GameFramework.Event;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using GFMain;
- using UnityEngine;
- using UnityGameFramework.Runtime;
- using UnityCommon;
- namespace GFMain
- {
- public class CommonUIComponent : GameFrameworkComponent
- {
- public MessageBox messageBox;
- public InputPanel inputPanel;
- protected override void Awake()
- {
- base.Awake();
- messageBox = Instantiate(messageBox.gameObject, transform).GetComponent<MessageBox>();
- messageBox.Visible = false;
- inputPanel = Instantiate(inputPanel.gameObject, transform).GetComponent<InputPanel>();
- inputPanel.Visible = false;
- //messageBox.ShowAction = (s) =>
- // {
- // if (s)
- // {
- // MainEntry.Base.PauseGame();
- // }
- // else
- // {
- // MainEntry.Base.ResumeGame();
- // }
- // };
- }
- //public void Init(Action completed)
- //{
- // onCompleted = completed;
- // MainEntry.Event.Subscribe(OpenUIFormSuccessEventArgs.EventId, OnOpenUISuccess);
- // OpenUIForm("Assets/UnityCommon/UI/Common/MessageBox.prefab", "Top");
- //}
- //private int countOpenUI = 0;
- //private void OpenUIForm(string uiFormAssetName, string uiGroupName)
- //{
- // countOpenUI++;
- // MainEntry.UI.OpenUIForm(uiFormAssetName, uiGroupName);
- //}
- //private Action onCompleted;//³õʼ»¯Íê±Ï»Øµ÷
- //private void OnOpenUISuccess(object sender, GameEventArgs e)
- //{
- // OpenUIFormSuccessEventArgs args = (OpenUIFormSuccessEventArgs)e;
- // if (args.UIForm.Logic is MessageBox)
- // {
- // messageBox = (MessageBox)args.UIForm.Logic;
- // messageBox.Visible = false;
- // messageBox.ShowAction = (s) =>
- // {
- // if (s)
- // {
- // MainEntry.Base.PauseGame();
- // }
- // else
- // {
- // MainEntry.Base.ResumeGame();
- // }
- // };
- // OpenUIFormCompleted();
- // }
- //}
- //private void OpenUIFormCompleted()
- //{
- // countOpenUI--;
- // if (countOpenUI == 0)
- // onCompleted?.Invoke();
- //}
- }
- }
|