Example #1
0
 public void Clear()
 {
     this.unRegEvent();
     if (this.m_dragonIcon != null)
     {
         this.m_dragonIcon.Clear();
         this.m_dragonIcon = null;
     }
     if (this.m_miniMapCameraFrame != null)
     {
         this.m_miniMapCameraFrame.Clear();
         this.m_miniMapCameraFrame = null;
     }
     this.mmRoot     = null;
     this.bmRoot     = null;
     this.mmpcAlies  = null;
     this.mmpcHero   = null;
     this.mmpcEnemy  = null;
     this.mmpcOrgan  = null;
     this.mmpcSignal = null;
     this.mmpcDragon = null;
     this.mmpcEffect = null;
     this.mmpcEye    = null;
     this.bmpcAlies  = null;
     this.bmpcHero   = null;
     this.bmpcEnemy  = null;
     this.bmpcOrgan  = null;
     this.bmpcSignal = null;
     this.bmpcDragon = null;
     this.mmpcEffect = null;
     this.bmpcEye    = null;
     this._ownerForm = null;
 }
Example #2
0
 public void Clear()
 {
     this.unRegEvent();
     if (this.m_dragonIcon != null)
     {
         this.m_dragonIcon.Clear();
         this.m_dragonIcon = null;
     }
     this.miniMap_obj  = null;
     this.bigMap_obj   = null;
     this.m_FormScript = null;
 }
Example #3
0
        public void Init(CUIFormScript formObj, SLevelContext levelContext)
        {
            if (formObj != null)
            {
                this._ownerForm = formObj;
                this.mmRoot     = Utility.FindChild(formObj.gameObject, "MapPanel/Mini");
                this.bmRoot     = Utility.FindChild(formObj.gameObject, "MapPanel/Big");
                if ((this.mmRoot != null) && (this.bmRoot != null))
                {
                    if (!levelContext.IsMobaMode())
                    {
                        this.mmRoot.SetActive(false);
                        this.bmRoot.SetActive(false);
                    }
                    else if (levelContext != null)
                    {
                        this.regEvent();
                        this.mmpcAlies  = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Alies");
                        this.mmpcHero   = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Hero");
                        this.mmpcEnemy  = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Enemy");
                        this.mmpcOrgan  = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Organ");
                        this.mmpcSignal = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Signal");
                        this.mmpcDragon = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Dragon");
                        this.mmpcEffect = Utility.FindChild(this.mmRoot, "BigMapEffectRoot");
                        this.mmpcEye    = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Eye");
                        this.bmpcAlies  = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Alies");
                        this.bmpcHero   = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Hero");
                        this.bmpcEnemy  = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Enemy");
                        this.bmpcOrgan  = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Organ");
                        this.bmpcSignal = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Signal");
                        this.bmpcDragon = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Dragon");
                        this.mmpcEffect = Utility.FindChild(this.bmRoot, "BigMapEffectRoot");
                        this.bmpcEye    = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Eye");
                        this.mmRoot.CustomSetActive(true);
                        this.bmRoot.CustomSetActive(true);
                        RectTransform transform = null;
                        if (levelContext.IsMobaMode())
                        {
                            float num;
                            this.Switch(EMapType.Mini);
                            transform = this.initMap(this.bmRoot, levelContext, false, out num);
                            transform.anchoredPosition = new Vector2(transform.rect.width * 0.5f, -transform.rect.height * 0.5f);
                            transform = this.initMap(this.mmRoot, levelContext, true, out num);
                            if (levelContext.m_pvpPlayerNum == 6)
                            {
                                transform.anchoredPosition = new Vector2(transform.anchoredPosition.x + ((transform.rect.width * 0.5f) - (num * 0.5f)), transform.anchoredPosition.y);
                                GameObject obj2 = Utility.FindChild(this._ownerForm.gameObject, "MapPanel/DragonInfo");
                                GameObject obj3 = Utility.FindChild(this._ownerForm.gameObject, "MapPanel/Button_Signal_1");
                                if (obj2 != null)
                                {
                                    RectTransform transform2 = obj2.gameObject.transform as RectTransform;
                                    transform2.anchoredPosition = new Vector2(transform.anchoredPosition.x, transform2.anchoredPosition.y);
                                }
                                if (obj3 != null)
                                {
                                    RectTransform transform3 = obj3.gameObject.transform as RectTransform;
                                    transform3.anchoredPosition = new Vector2((transform.rect.width - (transform3.rect.width * 0.5f)) + 43f, transform3.anchoredPosition.y);
                                }
                            }
                        }
                        else
                        {
                            this.Switch(EMapType.None);
                        }
                        this.curMapType = EMapType.Mini;
                        bool flag  = false;
                        bool flag2 = false;
                        if (levelContext.m_pveLevelType == RES_LEVEL_TYPE.RES_LEVEL_TYPE_GUIDE)
                        {
                            switch (levelContext.m_mapID)
                            {
                            case 2:
                                flag  = true;
                                flag2 = false;
                                break;

                            case 3:
                            case 6:
                            case 7:
                                flag  = true;
                                flag2 = true;
                                break;
                            }
                        }
                        else if ((levelContext.m_pvpPlayerNum == 6) || (levelContext.m_pvpPlayerNum == 10))
                        {
                            flag  = true;
                            flag2 = levelContext.m_pvpPlayerNum == 10;
                        }
                        if (flag && (this.mmpcDragon != null))
                        {
                            this.m_dragonIcon = new DragonIcon();
                            this.m_dragonIcon.Init(this.mmpcDragon, this.bmpcDragon, flag2);
                        }
                        GameObject gameObject = this.mmRoot.transform.Find("CameraFrame").gameObject;
                        if (gameObject != null)
                        {
                            this.m_miniMapCameraFrame = new MiniMapCameraFrame(gameObject, transform.sizeDelta.x, transform.sizeDelta.y);
                            this.m_miniMapCameraFrame.SetFrameSize((CameraHeightType)GameSettings.CameraHeight);
                        }
                    }
                }
            }
        }
Example #4
0
        public void Init(CUIFormScript formObj, ResDT_LevelCommonInfo pvp_level_cfg, SLevelContext levelContext)
        {
            if (((formObj != null) && (pvp_level_cfg != null)) && (levelContext != null))
            {
                this.regEvent();
                RectTransform transform = null;
                this.m_FormScript = formObj;
                this.miniMap_obj  = Utility.FindChild(formObj.gameObject, "panelTopLeft/MiniMap");
                this.bigMap_obj   = Utility.FindChild(formObj.gameObject, "panelTopLeft/BigMap");
                DebugHelper.Assert(this.miniMap_obj != null, "---MinimapSys miniMap_obj == null, check out...");
                DebugHelper.Assert(this.bigMap_obj != null, "---MinimapSys bigMap_obj == null, check out...");
                if ((this.miniMap_obj != null) && (this.bigMap_obj != null))
                {
                    this.miniMap_obj.CustomSetActive(true);
                    this.bigMap_obj.CustomSetActive(false);
                    this._init_view(this.miniMap_obj, this.bigMap_obj);
                    Image component = Utility.FindChild(formObj.gameObject, "panelTopLeft/MiniMap").GetComponent <Image>();
                    DebugHelper.Assert(component != null, "---MinimapSys miniMapImage == null, check out...");
                    if (component != null)
                    {
                        if (levelContext.isPVPMode)
                        {
                            float num;
                            transform = this.initMap(enBattleFormWidget.Bigmap, levelContext, false, out num);
                            transform.anchoredPosition = new Vector2(transform.rect.width * 0.5f, -transform.rect.height * 0.5f);
                            transform = this.initMap(enBattleFormWidget.Minimap, levelContext, true, out num);
                            if ((pvp_level_cfg != null) && (pvp_level_cfg.bMaxAcntNum == 6))
                            {
                                transform.anchoredPosition = new Vector2(transform.anchoredPosition.x + ((transform.rect.width * 0.5f) - (num * 0.5f)), transform.anchoredPosition.y);
                                GameObject obj2 = Utility.FindChild(this.m_FormScript.gameObject, "panelTopLeft/DragonInfo");
                                GameObject obj3 = Utility.FindChild(this.m_FormScript.gameObject, "panelTopLeft/Button_Signal_1");
                                DebugHelper.Assert(obj2 != null, "---MinimapSys dragon_info == null, check out...");
                                DebugHelper.Assert(obj3 != null, "---MinimapSys button_signal_1 == null, check out...");
                                if (obj2 != null)
                                {
                                    RectTransform transform2 = obj2.gameObject.transform as RectTransform;
                                    transform2.anchoredPosition = new Vector2(transform.anchoredPosition.x, transform2.anchoredPosition.y);
                                }
                                if (obj3 != null)
                                {
                                    RectTransform transform3 = obj3.gameObject.transform as RectTransform;
                                    transform3.anchoredPosition = new Vector2((transform.rect.width - (transform3.rect.width * 0.5f)) + 43f, transform3.anchoredPosition.y);
                                }
                            }
                        }
                        else
                        {
                            component.gameObject.CustomSetActive(false);
                        }
                        this.curMapType = EMapType.Mini;
                        bool flag  = false;
                        bool flag2 = false;
                        if (levelContext.LevelType == RES_LEVEL_TYPE.RES_LEVEL_TYPE_GUIDE)
                        {
                            switch (levelContext.iLevelID)
                            {
                            case 2:
                                flag  = true;
                                flag2 = false;
                                break;

                            case 3:
                            case 6:
                            case 7:
                                flag  = true;
                                flag2 = true;
                                break;
                            }
                        }
                        else if ((pvp_level_cfg != null) && ((pvp_level_cfg.bMaxAcntNum == 6) || (pvp_level_cfg.bMaxAcntNum == 10)))
                        {
                            flag  = true;
                            flag2 = pvp_level_cfg.bMaxAcntNum == 10;
                        }
                        if (flag)
                        {
                            GameObject node = Utility.FindChild(this.m_FormScript.gameObject, "panelTopLeft/MiniMap/Container_MiniMapPointer_Dragon");
                            DebugHelper.Assert(node != null, "---MinimapSys dragonicons == null, check out...");
                            if (node != null)
                            {
                                this.m_dragonIcon = new DragonIcon();
                                this.m_dragonIcon.Init(node, Utility.FindChild(this.m_FormScript.gameObject, "panelTopLeft/BigMap/Container_BigMapPointer_Dragon"), flag2);
                            }
                        }
                    }
                }
            }
        }