예제 #1
0
            public IEnumerator 캔버스매니져_같은프레임에_Hide와_Show를하면_정상인지확인()
            {
                // Arrange
                var pHandle = DoShow <Canvas_ForTest>(ECanvasName.Single);

                yield return(pHandle.Yield_WaitForSetUIObject());

                Canvas_ForTest pCanvas = pHandle.pUIObject;

                // Act
                pCanvas.DoHide_NotPlayHideCoroutine();
                var pHandle_New = DoShow <Canvas_ForTest>(ECanvasName.Single);

                yield return(pHandle_New.Yield_WaitForSetUIObject());

                Canvas_ForTest pCanvas_New = pHandle_New.pUIObject;

                // Assert
                Assert.AreEqual(pCanvas, pCanvas_New);
                // Assert.IsTrue(pCanvas_New.eState == Canvas_ForTest.EState.Show);
            }
예제 #2
0
            // ================================================================================================================

            #region private

            IEnumerator MultiplePopup_ShowHideTest(int iMultipleOpenCount, int iMaxFrame, bool bIsHide = true)
            {
                List <UICommandHandle <Canvas_ForTest> > listCommandHandle = new List <UICommandHandle <Canvas_ForTest> >();

                for (int i = 1; i < iMultipleOpenCount + 1; i++)
                {
                    int iWaitFrameCount = i % iMaxFrame;

                    var pHandle = DoShow_Multiple <Canvas_ForTest>(ECanvasName.Single).
                                  Set_OnBeforeShow(x => x.DoSetWaitFrameCount(iWaitFrameCount));

                    listCommandHandle.Add(pHandle);
                }

                // 모든 Yield For Animation 동시에 기다리기
                List <IEnumerator> listWaitCoroutine = new List <IEnumerator>();

                for (int i = 0; i < listCommandHandle.Count; i++)
                {
                    listWaitCoroutine.Add(listCommandHandle[i].Yield_WaitForAnimation());
                }
                yield return(listWaitCoroutine.GetEnumerator());

                if (bIsHide)
                {
                    HashSet <Canvas_ForTest> setCheckOverlap = new HashSet <Canvas_ForTest>();
                    for (int i = 0; i < listCommandHandle.Count; i++)
                    {
                        Canvas_ForTest pUITarget = listCommandHandle[i].pUIObject;
                        if (setCheckOverlap.Add(pUITarget) == false)
                        {
                            Debug.LogError("CheckOverlap Fail");
                            break;
                        }

                        try
                        {
                            Assert.AreEqual(pUITarget.eState, Canvas_ForTest.EState.Show);
                            Assert.AreEqual(pUITarget.iWaitFrameCount_Current, 0);
                        }
                        catch (System.Exception e)
                        {
                            Debug.LogError("Error - " + pUITarget.iID.ToString() + " " + e);
                        }

                        // 다시 Hide 시키기
                        pUITarget.DoHide_Coroutine();
                    }

                    // 모든 Yield For Animation 동시에 기다리기
                    listWaitCoroutine.Clear();
                    for (int i = 0; i < listCommandHandle.Count; i++)
                    {
                        listWaitCoroutine.Add(listCommandHandle[i].Yield_WaitForAnimation());
                    }
                    yield return(listWaitCoroutine.GetEnumerator());

                    for (int i = 0; i < listCommandHandle.Count; i++)
                    {
                        Canvas_ForTest pUITarget = listCommandHandle[i].pUIObject;

                        try
                        {
                            Assert.AreEqual(pUITarget.eState, Canvas_ForTest.EState.Hide);
                            Assert.AreEqual(pUITarget.iWaitFrameCount_Current, 0);
                        }
                        catch (System.Exception e)
                        {
                            Debug.LogError("Error - " + pUITarget.iID.ToString() + " " + e);
                        }
                    }
                }

                yield return(null);
            }