Exemplo n.º 1
0
        // 添加一个场景特效
        public SceneEffect addSceneEffect(int id, GameObject pntGO_, bool bAutoRemove = true, bool bLoop = false, bool bPlay = true)
        {
            SceneEffect effect = createAndAdd(EffectType.eSceneEffect, EffectRenderType.eSpriteEffectRender) as SceneEffect;

            effect.setPnt(pntGO_);
            effect.setLoop(bLoop);
            effect.setTableID(id);
            effect.bAutoRemove = bAutoRemove;

            if (bPlay)
            {
                effect.play();
            }

            return(effect);
        }
Exemplo n.º 2
0
        public EffectBase createAndAdd(EffectType type, EffectRenderType renderType)
        {
            EffectBase effect = null;

            if (EffectType.eLinkEffect == type)
            {
                effect = new LinkEffect(renderType);
            }
            else if (EffectType.eMoveEffect == type)
            {
                effect = new MoveEffect(renderType);
            }
            else if (EffectType.eSceneEffect == type)
            {
                effect = new SceneEffect(renderType);
            }

            Ctx.m_instance.m_sceneEffectMgr.addObject(effect);

            return(effect);
        }
Exemplo n.º 3
0
        override public void init()
        {
            for (int pathIdx = 0; pathIdx < (int)ePathIndex.eTotal; ++pathIdx)
            {
                if ((int)ePathIndex.eABC == pathIdx)
                {
                    buildPathSecond(pathIdx);
                }
                else if ((int)ePathIndex.eACB == pathIdx)
                {
                    if ((int)eRoomIndex.eB == m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                    else if ((int)eRoomIndex.eStart != m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                }
                else if ((int)ePathIndex.eBAC == pathIdx)
                {
                    if ((int)eRoomIndex.eB == m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                }
                else if ((int)ePathIndex.eBCA == pathIdx)
                {
                    if ((int)eRoomIndex.eB == m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                }
                else if ((int)ePathIndex.eCAB == pathIdx)
                {
                    if ((int)eRoomIndex.eB == m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                    else if ((int)eRoomIndex.eStart != m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                }
                else if ((int)ePathIndex.eCBA == pathIdx)
                {
                    if ((int)eRoomIndex.eB == m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                    else if ((int)eRoomIndex.eStart != m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                }
            }

            // 第二个房间有一个花头
            if (1 == m_iTag)
            {
                m_flowerHeadGo = UtilApi.GoFindChildByPObjAndName("RootGo/Plane_1/FlowerHeadGo");
                m_flowerHeadEffect = Ctx.m_instance.m_sceneEffectMgr.addSceneEffect(33, m_flowerHeadGo, false, true, true);
                m_flowerHeadEffect.setLoopType(eSpriteLoopType.ePingPang);
            }
            // 第三个房间有一个花树
            if (2 == m_iTag)
            {
                m_flowerTreeGo = UtilApi.GoFindChildByPObjAndName("RootGo/Plane_2/FlowerTree");
                m_flowerTreeEffect = Ctx.m_instance.m_sceneEffectMgr.addSceneEffect(34, m_flowerTreeGo, false, true, true);
            }
            // 如果是第五个房间,会有一个窗户
            if(4 == m_iTag)
            {
                m_darkWin = UtilApi.GoFindChildByPObjAndName("RootGo/Plane_4/WinGo/DarkWinGo");
                m_lightWin = UtilApi.GoFindChildByPObjAndName("RootGo/Plane_4/WinGo/LightWinGo");
            }
        }
Exemplo n.º 4
0
        override public void init()
        {
            for (int pathIdx = 0; pathIdx < (int)ePathIndex.eTotal; ++pathIdx)
            {
                if ((int)ePathIndex.eABC == pathIdx)
                {
                    buildPathSecond(pathIdx);
                }
                else if ((int)ePathIndex.eACB == pathIdx)
                {
                    if ((int)eRoomIndex.eB == m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                    else if ((int)eRoomIndex.eStart != m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                }
                else if ((int)ePathIndex.eBAC == pathIdx)
                {
                    if ((int)eRoomIndex.eB == m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                }
                else if ((int)ePathIndex.eBCA == pathIdx)
                {
                    if ((int)eRoomIndex.eB == m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                }
                else if ((int)ePathIndex.eCAB == pathIdx)
                {
                    if ((int)eRoomIndex.eB == m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                    else if ((int)eRoomIndex.eStart != m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                }
                else if ((int)ePathIndex.eCBA == pathIdx)
                {
                    if ((int)eRoomIndex.eB == m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                    else if ((int)eRoomIndex.eStart != m_fixIdx)
                    {
                        buildPathSecond(pathIdx);
                    }
                }
            }

            // 第二个房间有一个花头
            if (1 == m_iTag)
            {
                m_flowerHeadGo     = UtilApi.GoFindChildByPObjAndName("RootGo/Plane_1/FlowerHeadGo");
                m_flowerHeadEffect = Ctx.m_instance.m_sceneEffectMgr.addSceneEffect(33, m_flowerHeadGo, false, true, true);
                m_flowerHeadEffect.setLoopType(eSpriteLoopType.ePingPang);
            }
            // 第三个房间有一个花树
            if (2 == m_iTag)
            {
                m_flowerTreeGo     = UtilApi.GoFindChildByPObjAndName("RootGo/Plane_2/FlowerTree");
                m_flowerTreeEffect = Ctx.m_instance.m_sceneEffectMgr.addSceneEffect(34, m_flowerTreeGo, false, true, true);
            }
            // 如果是第五个房间,会有一个窗户
            if (4 == m_iTag)
            {
                m_darkWin  = UtilApi.GoFindChildByPObjAndName("RootGo/Plane_4/WinGo/DarkWinGo");
                m_lightWin = UtilApi.GoFindChildByPObjAndName("RootGo/Plane_4/WinGo/LightWinGo");
            }
        }