コード例 #1
0
 protected override void OnEnable()
 {
     base.OnEnable();
     if (this.timeCache != 0f)
     {
         this.revetEnergyTime -= Time.get_time() - this.timeCache;
     }
     EventDispatcher.Broadcast <bool, RTManager.RtType>("RTManager.ENABLE_PROJECTION_TYPE", true, RTManager.RtType.ElementBall);
     ModelDisplayManager.Instance.ShowElementBall(true);
     CurrenciesUIViewModel.Show(true);
     CurrenciesUIViewModel.Instance.SetSubUI(true, ResourceManager.GetCodeSprite(110019), string.Empty, delegate
     {
         base.Show(false);
         UIStackManager.Instance.PopUIPrevious(base.uiType);
     }, false);
     this.RefreshUI();
     this.ShowActorPostion(true);
     if (!this.mineDetailBlockID.Equals("None"))
     {
         ElementInstanceMineDetailUI elementInstanceMineDetailUI = UIManagerControl.Instance.OpenUI("ElementInstanceMineDetailUI", UINodesManager.NormalUIRoot, false, UIType.NonPush) as ElementInstanceMineDetailUI;
         elementInstanceMineDetailUI.blockID = this.mineDetailBlockID;
         elementInstanceMineDetailUI.RefreshUI();
         this.mineDetailBlockID = "None";
     }
     else if (ElementInstanceManager.Instance.m_shouldShow)
     {
         ElementInstanceManager.Instance.m_shouldShow = false;
         ElementInstanceMineDetailUI elementInstanceMineDetailUI2 = UIManagerControl.Instance.OpenUI("ElementInstanceMineDetailUI", UINodesManager.NormalUIRoot, false, UIType.NonPush) as ElementInstanceMineDetailUI;
         elementInstanceMineDetailUI2.RefreshUI();
     }
 }
コード例 #2
0
    private void OnPointerUp(PointerEventData eventData)
    {
        if (ElementInstanceManager.Instance.m_isActorMoving)
        {
            return;
        }
        if (Vector2.Distance(this.onPointerDownPlace, eventData.get_position()) > 10f)
        {
            return;
        }
        Vector3 position = CamerasMgr.CameraUI.ScreenToWorldPoint(new Vector3(eventData.get_position().x, eventData.get_position().y, 0f));

        position.z = 0f;
        this.ImageLocate.set_position(position);
        position = this.ImageLocate.get_localPosition();
        Vector3 zero = Vector3.get_zero();
        float   num  = (float)CamerasMgr.Camera2RTCommon.get_pixelWidth();
        float   num2 = (float)CamerasMgr.Camera2RTCommon.get_pixelHeight();

        zero.x = (position.x + num / 2f) / num * num;
        zero.y = (position.y + num2 / 2f) / num2 * num2;
        zero.z = 0f;
        Ray        ray = CamerasMgr.Camera2RTCommon.ScreenPointToRay(zero);
        RaycastHit raycastHit;

        if (Physics.Raycast(ray, ref raycastHit, 1000f, -1))
        {
            BallElementItem bei = raycastHit.get_collider().get_gameObject().GetComponent <BallElementItem>();
            bei.DoOnClickAnimation();
            if (bei.blockInfo == null)
            {
                UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(502319, false));
                return;
            }
            List <string> around = DataReader <YBanKuaiSuoYin> .Get(ElementInstanceManager.Instance.m_elementCopyLoginPush.lastBlock).around;

            if (!around.Contains(bei.blockInfo.blockId))
            {
                UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(502267, false));
                return;
            }
            if (bei.isActor)
            {
                if (bei.blockInfo.incidentType == RandomIncidentType.IncidentType.MONSTER && !bei.blockInfo.isChallenge)
                {
                    TimerHeap.AddTimer(500u, 0, delegate
                    {
                        DialogBoxUIViewModel.Instance.ShowAsOKCancel(GameDataUtils.GetChineseContent(502304, false), GameDataUtils.GetChineseContent(502303, false), delegate
                        {
                        }, delegate
                        {
                            ElementInstanceManager.Instance.SendStartToFightReq(bei.blockInfo.blockId);
                        }, GameDataUtils.GetChineseContent(505113, false), GameDataUtils.GetChineseContent(505114, false), "button_orange_1", "button_yellow_1", null, true, true);
                    });
                }
                else if (bei.blockInfo.incidentType == RandomIncidentType.IncidentType.MINE && !bei.blockInfo.isChallenge)
                {
                    TimerHeap.AddTimer(500u, 0, delegate
                    {
                        DialogBoxUIViewModel.Instance.ShowAsOKCancel(GameDataUtils.GetChineseContent(502304, false), GameDataUtils.GetChineseContent(502303, false), delegate
                        {
                        }, delegate
                        {
                            ElementInstanceManager.Instance.SendStartToFightReq(bei.blockInfo.blockId);
                        }, GameDataUtils.GetChineseContent(505113, false), GameDataUtils.GetChineseContent(505114, false), "button_orange_1", "button_yellow_1", null, true, true);
                    });
                }
            }
            else if (bei.blockInfo.incidentType == RandomIncidentType.IncidentType.ROADBLOCK)
            {
                UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(502300, false));
            }
            else if ((bei.blockInfo.incidentType == RandomIncidentType.IncidentType.MONSTER || bei.blockInfo.incidentType == RandomIncidentType.IncidentType.MINE) && !bei.blockInfo.isChallenge)
            {
                if (ElementInstanceManager.Instance.CheckIsAround(bei.blockInfo.blockId))
                {
                    if (bei.blockInfo.incidentType == RandomIncidentType.IncidentType.MONSTER)
                    {
                        ElementInstanceMonsterMeet elementInstanceMonsterMeet = InstanceManagerUI.OpenElementInstanceMonsterMeet();
                        elementInstanceMonsterMeet.blockID = bei.blockInfo.blockId;
                        elementInstanceMonsterMeet.RefreshUI(bei.blockInfo.incidentTypeId);
                    }
                    else
                    {
                        ElementInstanceMineDetailUI elementInstanceMineDetailUI = UIManagerControl.Instance.OpenUI("ElementInstanceMineDetailUI", UINodesManager.NormalUIRoot, false, UIType.NonPush) as ElementInstanceMineDetailUI;
                        elementInstanceMineDetailUI.blockID = bei.blockInfo.blockId;
                        elementInstanceMineDetailUI.RefreshUI();
                    }
                }
                else
                {
                    UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(502307, false));
                }
            }
            else if (bei.blockInfo.incidentType == RandomIncidentType.IncidentType.MINE && bei.blockInfo.isChallenge && ElementInstanceManager.Instance.CheckIsAround(bei.blockInfo.blockId))
            {
                ElementInstanceMineDetailUI elementInstanceMineDetailUI2 = UIManagerControl.Instance.OpenUI("ElementInstanceMineDetailUI", UINodesManager.NormalUIRoot, false, UIType.NonPush) as ElementInstanceMineDetailUI;
                elementInstanceMineDetailUI2.blockID = bei.blockInfo.blockId;
                elementInstanceMineDetailUI2.RefreshUI();
            }
            else
            {
                ElementInstanceManager.Instance.SendExploreBlockReq(ElementInstanceManager.Instance.m_elementCopyLoginPush.lastBlock, raycastHit.get_collider().get_gameObject().get_name());
            }
        }
    }