Example #1
0
    public void Open()
    {
        if (_view != null)
        {
            return;
        }

        if (IsCached)
        {
            _view = GetViewFromCache();
        }
        else
        {
            _view = CreateView();
        }

        if (_view == null)
        {
            return;
        }

        IModalDataReceiver <TData> dataReceiver = _view.gameObject.GetComponentOrInterface <IModalDataReceiver <TData> >();

        if (dataReceiver != null)
        {
            dataReceiver.SetData(Data);
        }

        _view.CloseCompleteEvent += OnCloseComplete;
        OpenHandlerEvent();
        _view.Open();
    }
Example #2
0
        /// <summary>
        /// Load a modal without using the modality system, since the dialog canvas of modality changes between games
        /// Can use modality if resolution is adapted
        /// </summary>
        /// <param name="testSuite">Test suite.</param>
        /// <param name="prefabPath">Prefab path.</param>
        private void LoadModal(TestSuite testSuite, string prefabPath)
        {
            GameObject modalGo = Instantiate(Resources.Load(prefabPath, typeof(GameObject))) as GameObject;

            IModalDataReceiver <TestSuite> dataReceiver = modalGo.GetComponentOrInterface <IModalDataReceiver <TestSuite> >();

            if (dataReceiver != null)
            {
                dataReceiver.SetData(testSuite);
            }

            modalGo.gameObject.transform.parent        = gameObject.transform.parent;
            modalGo.gameObject.transform.localScale    = new Vector3(1f, 1f, 1f);
            modalGo.gameObject.transform.localPosition = new Vector3(0, 0, 0);

            modalGo.GetComponent <TestSuiteView>().LoadTestCaseViews();
        }