コード例 #1
0
 public void ProcessUp(float x, float y, CUIFormScript form, Vector2 screenPos)
 {
     if (this.IsInsideRect(form, this.area, ref screenPos))
     {
         MinimapSys.Send_Position_Signal(x, y, form, (byte)this.configID, MinimapSys.ElementType.None, true);
     }
 }
コード例 #2
0
            private void _updateNodePosition(GameObject node, PoolObjHandle <ActorRoot> actorRoot, bool bSmallMap)
            {
                if (!actorRoot)
                {
                    return;
                }
                if (node != null)
                {
                    MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

                    if (theMinimapSys == null)
                    {
                        return;
                    }
                    Vector3 vector  = (Vector3)actorRoot.handle.location;
                    Vector2 vector2 = bSmallMap ? theMinimapSys.GetMMFianlScreenPos() : theMinimapSys.GetBMFianlScreenPos();
                    Vector2 vector3 = bSmallMap ? theMinimapSys.mmFinalScreenSize : theMinimapSys.bmFinalScreenSize;
                    float   x;
                    float   y;
                    node.transform.position = MiniMapSysUT.Set3DUIWorldPos_ByScreenPoint(ref vector, bSmallMap, out x, out y);
                    if (!this.IsRectInside(x, y, vector2.x, vector2.y, vector3.x, vector3.y))
                    {
                        this.SetUpdateAble(false);
                    }
                }
            }
コード例 #3
0
        public static Vector3 Set3DUIWorldPos_ByScreenPoint(ref Vector3 worldPos, bool bMiniMap, out float finalScreenX, out float finalScreenY)
        {
            finalScreenX = (finalScreenY = 0f);
            MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

            if (theMinimapSys == null)
            {
                return(Vector3.zero);
            }
            Vector2 vector = (!bMiniMap) ? Singleton <CBattleSystem> .get_instance().world_UI_Factor_Big : Singleton <CBattleSystem> .get_instance().world_UI_Factor_Small;

            Vector2 vector2 = new Vector2(worldPos.x * vector.x, worldPos.z * vector.y);

            vector2.x *= Sprite3D.Ratio();
            vector2.y *= Sprite3D.Ratio();
            Vector2 vector3 = (!bMiniMap) ? theMinimapSys.GetBMFianlScreenPos() : theMinimapSys.GetMMFianlScreenPos();

            vector2.x += vector3.x;
            vector2.y += vector3.y;
            Vector3 position      = new Vector3(vector2.x, vector2.y, (float)MiniMapSysUT.UI3D_Depth);
            Camera  currentCamera = Singleton <Camera_UI3D> .GetInstance().GetCurrentCamera();

            if (currentCamera == null)
            {
                return(Vector3.zero);
            }
            finalScreenX = position.x;
            finalScreenY = position.y;
            return(currentCamera.ScreenToWorldPoint(position));
        }
コード例 #4
0
 private void OnTrainingHelperInit(CUIEvent uiEvent)
 {
     if (this.m_form == null)
     {
         this.m_form = Singleton <CBattleSystem> .instance.FightFormScript;
         DebugHelper.Assert(this.m_form != null);
         this.m_openBtn  = this.m_form.transform.FindChild("Panel_Prop/ButtonOpen").gameObject;
         this.m_panelObj = this.m_form.transform.FindChild("Panel_Prop/Panel_BaseProp").gameObject;
         this.InitHostileFuncList();
         this.InitSelfFuncList();
         this.InitGeneralFuncList();
         this.InitBtnToggle();
         this.m_form.transform.FindChild("Panel_Prop").gameObject.CustomSetActive(true);
         Transform transform = this.m_form.transform.FindChild("MapPanel");
         if (transform != null)
         {
             transform.gameObject.CustomSetActive(false);
         }
         MinimapSys theMinimapSys = Singleton <CBattleSystem> .instance.TheMinimapSys;
         if (theMinimapSys != null)
         {
             theMinimapSys.mmRoot.CustomSetActive(false);
         }
     }
 }
コード例 #5
0
        public void TryActive(GameObject target)
        {
            if (target == null)
            {
                return;
            }
            if (!this.bValid)
            {
                return;
            }
            if (!string.IsNullOrEmpty(this.effect))
            {
                MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

                if (theMinimapSys != null && theMinimapSys.CurMapType() == MinimapSys.EMapType.Mini)
                {
                    TowerHit._play_effect(this.effect, 2f, target);
                }
            }
            if (!string.IsNullOrEmpty(this.voice))
            {
                Singleton <CSoundManager> .GetInstance().PlayBattleSound2D(this.voice);
            }
            Singleton <CTimerManager> .get_instance().ResumeTimer(this.cd_timer);

            this.bValid = false;
        }
コード例 #6
0
ファイル: CBattleSystem.cs プロジェクト: isoundy000/wzry-1
 public void OnFormClosed()
 {
     this.UnregisterEvents();
     this.m_battleFloatDigitManager.ClearAllBattleFloatText();
     this.m_battleEquipSystem.Clear();
     if (this._miniMapSys != null)
     {
         this._miniMapSys.Clear();
         this._miniMapSys = null;
     }
     if (this._killNotify != null)
     {
         this._killNotify.Clear();
         this._killNotify = null;
     }
     if (this.m_towerHitMgr != null)
     {
         this.m_towerHitMgr.Clear();
         this.m_towerHitMgr = null;
     }
     if (this._battleStatView != null)
     {
         this._battleStatView.Clear();
         this._battleStatView = null;
     }
     this._battleForm = null;
 }
コード例 #7
0
ファイル: DragonIcon.cs プロジェクト: isoundy000/wzry-1
        private void onDragon_Born(ActorRoot actor)
        {
            DragonNode node = this.getDragonNode(actor.ObjID, actor.ActorControl.GetActorSubSoliderType());

            DebugHelper.Assert(node != null, "onDragon_Born node == null, check out...");
            if (node != null)
            {
                node.SetData(actor.gameObject.transform.position, actor.ActorControl.GetActorSubSoliderType(), actor.ObjID, this.m_b5v5);
                node.ShowDead(actor.ActorControl.IsDeadState);
                byte actorSubSoliderType = actor.ActorControl.GetActorSubSoliderType();
                if (((actorSubSoliderType == 8) || (actorSubSoliderType == 9)) || (actorSubSoliderType == 13))
                {
                    MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

                    bool flag = (theMinimapSys != null) && (theMinimapSys.CurMapType() == MinimapSys.EMapType.Mini);
                    if (flag)
                    {
                        TowerHit._play_effect("Prefab_Skill_Effects/tongyong_effects/Indicator/blin_01_c.prefab", 3f, !flag ? node.node_in_bigMap : node.node_in_smallMap);
                    }
                    switch (actorSubSoliderType)
                    {
                    case 7:
                        MiniMapSysUT.SetMapElement_EventParam(node.node_in_bigMap, false, MinimapSys.ElementType.Dragon_3, actor.ObjID, 0);
                        break;

                    case 8:
                        MiniMapSysUT.SetMapElement_EventParam(node.node_in_bigMap, false, MinimapSys.ElementType.Dragon_5_big, actor.ObjID, 0);
                        break;

                    case 9:
                        MiniMapSysUT.SetMapElement_EventParam(node.node_in_bigMap, false, MinimapSys.ElementType.Dragon_5_small, actor.ObjID, 0);
                        break;
                    }
                    MiniMapSysUT.RefreshMapPointerBig(node.node_in_bigMap);
                }
                switch (actorSubSoliderType)
                {
                case 8:
                    Singleton <CSoundManager> .GetInstance().PlayBattleSound2D("Play_DaLong_VO_Refresh");

                    break;

                case 9:
                    Singleton <CSoundManager> .GetInstance().PlayBattleSound2D("Play_XiaoLong_VO_Refresh");

                    break;

                default:
                    Singleton <CSoundManager> .GetInstance().PlayBattleSound2D("Play_BaoJun_VO_Anger");

                    break;
                }
            }
        }
コード例 #8
0
        public static void ShowBack2City(PoolObjHandle <ActorRoot> actorHandle)
        {
            MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

            if (theMinimapSys == null)
            {
                return;
            }
            if (theMinimapSys.MMiniMapBackCityCom_3Dui != null)
            {
                theMinimapSys.MMiniMapBackCityCom_3Dui.ShowBack2City_Imp(actorHandle);
            }
        }
コード例 #9
0
        public void Process_MiniMap()
        {
            MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

            if (theMinimapSys == null)
            {
                return;
            }
            if (theMinimapSys.CurMapType() == MinimapSys.EMapType.Mini)
            {
                Singleton <CUIEventManager> .instance.DispatchUIEvent(enUIEventID.BigMap_Open_BigMap);
            }
        }
コード例 #10
0
        public static void Recyle(uint objid)
        {
            MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

            if (theMinimapSys == null)
            {
                return;
            }
            if (theMinimapSys.MMiniMapTrack_3Dui != null)
            {
                theMinimapSys.MMiniMapTrack_3Dui.Recyle_Imp(objid);
            }
        }
コード例 #11
0
        public static void Prepare(PoolObjHandle <ActorRoot> actorHandle, string iconPath)
        {
            MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

            if (theMinimapSys == null)
            {
                return;
            }
            if (theMinimapSys.MMiniMapTrack_3Dui != null)
            {
                theMinimapSys.MMiniMapTrack_3Dui.Prepare_Imp(actorHandle, iconPath);
            }
        }
コード例 #12
0
        public static GameObject GetHeroIconObj(string path, bool bMiniMap, bool bSelf, bool bSameCamp)
        {
            MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

            if (theMinimapSys == null)
            {
                return(null);
            }
            GameObject gameObject;

            if (bMiniMap)
            {
                if (bSelf)
                {
                    gameObject = theMinimapSys.mmHeroIconNode_Self;
                }
                else
                {
                    gameObject = ((!bSameCamp) ? theMinimapSys.mmHeroIconNode_Enemy : theMinimapSys.mmHeroIconNode_Friend);
                }
            }
            else if (bSelf)
            {
                gameObject = theMinimapSys.bmHeroIconNode_Self;
            }
            else
            {
                gameObject = ((!bSameCamp) ? theMinimapSys.bmHeroIconNode_Enemy : theMinimapSys.bmHeroIconNode_Friend);
            }
            GameObject gameObject2 = Singleton <CGameObjectPool> .GetInstance().GetGameObject(path, 5);

            if (gameObject2 != null)
            {
                if (gameObject != null)
                {
                    gameObject2.transform.SetParent(gameObject.transform, true);
                }
                gameObject2.transform.localScale    = Vector3.one;
                gameObject2.transform.localRotation = Quaternion.identity;
                float num = (!bMiniMap) ? (40f * Sprite3D.Ratio()) : (20f * Sprite3D.Ratio());
                MiniMapSysUT.NativeSizeLize(gameObject2, num, num);
                Singleton <Camera_UI3D> .get_instance().GetCurrentCanvas().RefreshLayout(null);
            }
            return(gameObject2);
        }
コード例 #13
0
        public static void UnRegisterEventCom(UI3DEventCom evtCom)
        {
            if (evtCom == null)
            {
                return;
            }
            evtCom.isDead = true;
            MinimapSys theMinimapSys = Singleton <CBattleSystem> .get_instance().TheMinimapSys;

            if (theMinimapSys != null)
            {
                UI3DEventMgr uI3DEventMgr = theMinimapSys.UI3DEventMgr;
                if (uI3DEventMgr != null)
                {
                    uI3DEventMgr.UnRegister(evtCom);
                }
            }
        }
コード例 #14
0
 private void OnTrainingHelperClose(CUIEvent uiEvent)
 {
     this.m_openBtn.CustomSetActive(true);
     this.m_panelObj.CustomSetActive(false);
     if (this.m_form != null)
     {
         Transform transform = this.m_form.transform.FindChild("MapPanel");
         if (transform != null)
         {
             transform.gameObject.CustomSetActive(true);
         }
         MinimapSys theMinimapSys = Singleton <CBattleSystem> .instance.TheMinimapSys;
         if (theMinimapSys != null)
         {
             theMinimapSys.mmRoot.CustomSetActive(true);
         }
     }
 }
コード例 #15
0
        public static Vector2 CalcScreenPosInMapByWorldPos(ref Vector3 worldPos, bool bMiniMap)
        {
            MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

            if (theMinimapSys == null)
            {
                return(Vector3.zero);
            }
            Vector2 vector = bMiniMap ? Singleton <CBattleSystem> .instance.world_UI_Factor_Small : Singleton <CBattleSystem> .instance.world_UI_Factor_Big;
            Vector2 result = new Vector2(worldPos.x * vector.x, worldPos.z * vector.y);

            result.x *= Sprite3D.Ratio();
            result.y *= Sprite3D.Ratio();
            Vector2 vector2 = bMiniMap ? theMinimapSys.GetMMFianlScreenPos() : theMinimapSys.GetBMFianlScreenPos();

            result.x += vector2.x;
            result.y += vector2.y;
            return(result);
        }
コード例 #16
0
ファイル: DragonIcon.cs プロジェクト: TonyDongGuaPi/joework
        private void onDragon_Born(ActorRoot actor)
        {
            DragonIcon.DragonNode dragonNode = this.getDragonNode(actor.ObjID, actor.ActorControl.GetActorSubSoliderType());
            DebugHelper.Assert(dragonNode != null, "onDragon_Born mmDNode_ugui == null, check out...");
            if (dragonNode == null)
            {
                return;
            }
            MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

            bool bRefreshCache = theMinimapSys.CurMapType() == MinimapSys.EMapType.Mini;

            dragonNode.SetData(actor.myTransform.position, (int)actor.ActorControl.GetActorSubSoliderType(), actor.ObjID, this.m_b5v5, true, bRefreshCache, true);
            dragonNode.ShowDead(actor.ActorControl.IsDeadState);
            byte actorSubSoliderType = actor.ActorControl.GetActorSubSoliderType();

            if (actorSubSoliderType == 8 || actorSubSoliderType == 9 || actorSubSoliderType == 13)
            {
                bool flag = theMinimapSys != null && theMinimapSys.CurMapType() == MinimapSys.EMapType.Mini;
                if (flag)
                {
                    Camera currentCamera = Singleton <Camera_UI3D> .GetInstance().GetCurrentCamera();

                    if (currentCamera != null)
                    {
                        Vector3 v = currentCamera.WorldToScreenPoint((!flag) ? dragonNode.bmDragonNode_3dui.transform.position : dragonNode.mmDragonNode_3dui.transform.position);
                        Singleton <CUIParticleSystem> .get_instance().AddParticle(DragonIcon.dragonBornEffect, 3f, v);
                    }
                }
            }
            if (actorSubSoliderType == 8)
            {
                Singleton <CSoundManager> .GetInstance().PlayBattleSound2D("Play_DaLong_VO_Refresh");
            }
            else if (actorSubSoliderType == 9)
            {
                Singleton <CSoundManager> .GetInstance().PlayBattleSound2D("Play_XiaoLong_VO_Refresh");
            }
            else
            {
                Singleton <CSoundManager> .GetInstance().PlayBattleSound2D("Play_BaoJun_VO_Anger");
            }
        }
コード例 #17
0
        public void OpenForm(CBattleSystem.FormType formType)
        {
            this.m_MaxBattleFPS   = 0f;
            this.m_MinBattleFPS   = 3.40282347E+38f;
            this.m_AveBattleFPS   = 0f;
            this.m_BattleFPSCount = 0f;
            this.m_frameCount     = 0;
            if (formType == CBattleSystem.FormType.Fight)
            {
                this._battle3DTouch = new InBattle3DTouch();
                this._battle3DTouch.Init();
                this._battleForm = new FightForm();
            }
            else if (formType == CBattleSystem.FormType.Watch)
            {
                this._battleForm = new WatchForm();
            }
            if (this._battleForm == null || !this._battleForm.OpenForm())
            {
                this._battleForm = null;
                return;
            }
            Player hostPlayer = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer();

            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            this.m_battleEquipSystem.Initialize(this.FightFormScript, hostPlayer.Captain, curLvelContext.IsMobaMode(), curLvelContext.m_isBattleEquipLimit);
            this._miniMapSys = new MinimapSys();
            this._miniMapSys.Init(this.FormScript, curLvelContext);
            this._killNotify = new KillNotify();
            this._killNotify.Init();
            this._killNotify.Hide();
            this.m_towerHitMgr = new TowerHitMgr();
            this.m_towerHitMgr.Init();
            if (curLvelContext.IsMobaMode())
            {
                this._battleStatView = new BattleStatView();
                this._battleStatView.Init();
            }
            this.pauseControl = new PauseControl(this.FormScript);
            this.RegisterEvents();
        }
コード例 #18
0
        public static void SetTrackPosition(PoolObjHandle <ActorRoot> actorHandle, string iconPath)
        {
            MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

            if (theMinimapSys == null)
            {
                return;
            }
            if (Singleton <WatchController> .GetInstance().IsWatching)
            {
                if (theMinimapSys.MMiniMapTrack_3Dui != null)
                {
                    theMinimapSys.MMiniMapTrack_3Dui.SetTrackPosition_Imp(actorHandle, iconPath);
                }
            }
            else if (actorHandle.handle.IsHostCamp() && theMinimapSys.MMiniMapTrack_3Dui != null)
            {
                theMinimapSys.MMiniMapTrack_3Dui.SetTrackPosition_Imp(actorHandle, iconPath);
            }
        }
コード例 #19
0
ファイル: CBattleSystem.cs プロジェクト: isoundy000/wzry-1
        public void OpenForm(FormType formType)
        {
            this.m_MaxBattleFPS   = 0f;
            this.m_MinBattleFPS   = float.MaxValue;
            this.m_AveBattleFPS   = 0f;
            this.m_BattleFPSCount = 0f;
            this.m_frameCount     = 0;
            if (formType == FormType.Fight)
            {
                this._battleForm = new Assets.Scripts.GameSystem.FightForm();
            }
            else if (formType == FormType.Watch)
            {
                this._battleForm = new Assets.Scripts.GameSystem.WatchForm();
            }
            if ((this._battleForm == null) || !this._battleForm.OpenForm())
            {
                this._battleForm = null;
            }
            else
            {
                Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer();

                SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                this.m_battleEquipSystem.Initialize(this.FightFormScript, hostPlayer.Captain, curLvelContext.IsMobaMode(), curLvelContext.m_isBattleEquipLimit);
                this._miniMapSys = new MinimapSys();
                this._miniMapSys.Init(this.FormScript, curLvelContext);
                this._killNotify = new KillNotify();
                this._killNotify.Init(this.FormScript);
                this._killNotify.Hide();
                this.m_towerHitMgr = new Assets.Scripts.GameSystem.TowerHitMgr();
                this.m_towerHitMgr.Init();
                if (curLvelContext.IsMobaMode())
                {
                    this._battleStatView = new Assets.Scripts.GameSystem.BattleStatView();
                    this._battleStatView.Init();
                }
                this.RegisterEvents();
            }
        }
コード例 #20
0
        public void OnHoldUp(CUIEvent uievent)
        {
            MinimapSys theMinimapSys = Singleton <CBattleSystem> .instance.TheMinimapSys;

            if (theMinimapSys != null)
            {
                theMinimapSys.Switch(MinimapSys.EMapType.Mini);
            }
            if (this.form == null)
            {
                return;
            }
            for (int i = 0; i < this.signalEntities.Count; i++)
            {
                MiniMapSignalPanel.SignalEntity signalEntity = this.signalEntities[i];
                if (signalEntity != null)
                {
                    signalEntity.ProcessUp(this.cacheClickX, this.cacheClickY, this.form, uievent.m_pointerEventData.get_position());
                }
            }
        }
コード例 #21
0
        public static GameObject GetMapTrackObj(string prefabPath, bool bMiniMap)
        {
            MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

            if (theMinimapSys == null)
            {
                return(null);
            }
            GameObject gameObject  = bMiniMap ? theMinimapSys.mmpcTrack : theMinimapSys.bmpcTrack;
            GameObject gameObject2 = Singleton <CGameObjectPool> .GetInstance().GetGameObject(prefabPath, enResourceType.BattleScene);

            if (gameObject2 != null)
            {
                if (gameObject != null)
                {
                    gameObject2.transform.SetParent(gameObject.transform, true);
                }
                float num = bMiniMap ? 0.7f : 1f;
                gameObject2.transform.localScale    = new Vector3(num, num, 1f);
                gameObject2.transform.localRotation = Quaternion.identity;
                MiniMapSysUT.NativeSizeLize(gameObject2);
            }
            return(gameObject2);
        }
コード例 #22
0
 private void OnSpawnSoldier(ref SpawnSoldierParam inParam)
 {
     if (inParam.SourceRegion != null && inParam.SourceRegion.IsInEmergency && inParam.SourceRegion.RouteType == RES_SOLDIER_ROUTE_TYPE.RES_SOLDIER_ROUTE_MID)
     {
         MinimapSys theMinimapSys = Singleton <CBattleSystem> .instance.TheMinimapSys;
         if (theMinimapSys == null)
         {
             return;
         }
         Vector2    localPosition = new Vector2(0f, 0f);
         Quaternion localRotation = Quaternion.identity;
         float      num           = 13f;
         if (inParam.SourceRegion.IsMyCamp())
         {
             localPosition = new Vector2(theMinimapSys.GetMMFianlScreenPos().x - theMinimapSys.mmFinalScreenSize.x / 2f + num, theMinimapSys.GetMMFianlScreenPos().y - theMinimapSys.mmFinalScreenSize.y / 2f + num);
         }
         else
         {
             localPosition = new Vector2(theMinimapSys.GetMMFianlScreenPos().x + theMinimapSys.mmFinalScreenSize.x / 2f - num, theMinimapSys.GetMMFianlScreenPos().y + theMinimapSys.mmFinalScreenSize.y / 2f - num);
             localRotation = Quaternion.Euler(0f, 0f, 180f);
         }
         this.ExecCommand(6, localPosition, localRotation);
     }
 }
コード例 #23
0
        public static GameObject GetSignalGameObject(bool bMiniMap)
        {
            MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

            if (theMinimapSys == null)
            {
                return(null);
            }
            GameObject gameObject  = (!bMiniMap) ? theMinimapSys.bmpcSignal : theMinimapSys.mmpcSignal;
            GameObject gameObject2 = Singleton <CGameObjectPool> .GetInstance().GetGameObject(MiniMapSysUT.Map_Signal_prefab, 0);

            if (gameObject2 != null)
            {
                if (gameObject != null)
                {
                    gameObject2.transform.SetParent(gameObject.transform, true);
                }
                float num = (!bMiniMap) ? 1f : 0.5f;
                gameObject2.transform.localScale    = new Vector3(num, num, 1f);
                gameObject2.transform.localRotation = Quaternion.identity;
                MiniMapSysUT.NativeSizeLize(gameObject2);
            }
            return(gameObject2);
        }
コード例 #24
0
            private GameObject getContainerElement(bool bSmallMap, string iconPath, bool bSameCamp)
            {
                MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

                if (theMinimapSys == null)
                {
                    return(null);
                }
                GameObject x = bSmallMap ? theMinimapSys.mmpcTrack : theMinimapSys.bmpcTrack;

                if (x == null)
                {
                    return(null);
                }
                GameObject mapTrackObj = MiniMapSysUT.GetMapTrackObj(iconPath, bSmallMap);

                if (mapTrackObj != null)
                {
                    Sprite3D component = mapTrackObj.GetComponent <Sprite3D>();
                    if (component != null)
                    {
                        if (bSmallMap)
                        {
                            this.small_track_width  = (float)component.textureWidth * mapTrackObj.transform.localScale.x * Sprite3D.Ratio();
                            this.small_track_height = (float)component.textureHeight * mapTrackObj.transform.localScale.y * Sprite3D.Ratio();
                        }
                        else
                        {
                            this.big_track_width  = (float)component.textureWidth * mapTrackObj.transform.localScale.x * Sprite3D.Ratio();
                            this.big_track_height = (float)component.textureHeight * mapTrackObj.transform.localScale.y * Sprite3D.Ratio();
                        }
                    }
                }
                mapTrackObj.CustomSetActive(true);
                return(mapTrackObj);
            }
コード例 #25
0
        public bool CheckSignalPositionValid(Vector2 sigScreenPos)
        {
            MinimapSys theMinimapSys = Singleton <CBattleSystem> .instance.TheMinimapSys;

            return(theMinimapSys != null && sigScreenPos.x >= theMinimapSys.GetMMFianlScreenPos().x - theMinimapSys.mmFinalScreenSize.x / 2f && sigScreenPos.x <= theMinimapSys.GetMMFianlScreenPos().x + theMinimapSys.mmFinalScreenSize.x / 2f && sigScreenPos.y >= theMinimapSys.GetMMFianlScreenPos().y - theMinimapSys.mmFinalScreenSize.y / 2f && sigScreenPos.y <= theMinimapSys.GetMMFianlScreenPos().y + theMinimapSys.mmFinalScreenSize.y / 2f);
        }
コード例 #26
0
        public void ExecCommand_4_SignalPanel_Sign(PoolObjHandle <ActorRoot> sender, uint senderPlayerID, uint heroID, int signalID, int worldPositionX, int worldPositionY, int worldPositionZ)
        {
            if (!this.m_useSignalButton || this.m_formScript == null)
            {
                return;
            }
            Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(senderPlayerID);

            if (hostPlayer == null || player == null)
            {
                return;
            }
            if (hostPlayer.PlayerCamp != player.PlayerCamp)
            {
                return;
            }
            bool          flag      = hostPlayer == player;
            ResSignalInfo dataByKey = GameDataMgr.signalDatabin.GetDataByKey((long)signalID);

            if (dataByKey == null)
            {
                DebugHelper.Assert(dataByKey != null, "ExecCommand signalInfo is null, check out...");
                return;
            }
            uint  cDTime         = this.GetCDTime(dataByKey);
            ulong logicFrameTick = Singleton <FrameSynchr> .GetInstance().LogicFrameTick;

            SignalPanel.CPlayerSignalCooldown cPlayerSignalCooldown = null;
            this.m_playerSignalCooldowns.TryGetValue(senderPlayerID, ref cPlayerSignalCooldown);
            if (cPlayerSignalCooldown != null)
            {
                if ((uint)(logicFrameTick - cPlayerSignalCooldown.m_lastSignalExecuteTimestamp) < cPlayerSignalCooldown.m_cooldownTime)
                {
                    return;
                }
                cPlayerSignalCooldown.m_lastSignalExecuteTimestamp = logicFrameTick;
                cPlayerSignalCooldown.m_cooldownTime = cDTime;
            }
            else
            {
                cPlayerSignalCooldown = new SignalPanel.CPlayerSignalCooldown(logicFrameTick, cDTime);
                this.m_playerSignalCooldowns.Add(senderPlayerID, cPlayerSignalCooldown);
            }
            if (flag && this.m_signalButtons != null)
            {
                for (int i = 0; i < this.m_signalButtons.Length; i++)
                {
                    if (this.m_signalButtons[i] != null)
                    {
                        this.m_signalButtons[i].StartCooldown(cDTime);
                    }
                }
            }
            Singleton <CSoundManager> .GetInstance().PlayBattleSound2D(dataByKey.szSound);

            MiniMapEffectModule miniMapEffectModule = Singleton <CBattleSystem> .instance.TheMinimapSys.miniMapEffectModule;

            if (miniMapEffectModule != null)
            {
                Vector3    vector     = new Vector3((float)worldPositionX, (float)worldPositionY, (float)worldPositionZ);
                GameObject gameObject = miniMapEffectModule.PlaySceneEffect(dataByKey.szSceneEffect, (int)dataByKey.bTime * 1000, vector);
                if (signalID == 202 && gameObject != null)
                {
                    TextMesh component = gameObject.transform.FindChild("text").GetComponent <TextMesh>();
                    if (component != null)
                    {
                        ResHeroCfgInfo dataByKey2 = GameDataMgr.heroDatabin.GetDataByKey(heroID);
                        if (dataByKey2 == null)
                        {
                            return;
                        }
                        component.text = dataByKey2.szName;
                        component.gameObject.CustomSetActive(true);
                    }
                    Transform transform = gameObject.transform.FindChild("JianTou");
                    Vector3   forward   = sender.handle.gameObject.transform.position - vector;
                    forward.Normalize();
                    transform.forward = forward;
                    if (Singleton <BattleLogic> .instance.m_LevelContext.m_isCameraFlip)
                    {
                        component.transform.rotation = Quaternion.AngleAxis(180f, Vector3.up);
                    }
                }
                if (signalID == 203 && Singleton <BattleLogic> .instance.m_LevelContext.m_isCameraFlip)
                {
                    gameObject.transform.rotation = Quaternion.AngleAxis(180f, Vector3.up);
                }
                if (!string.IsNullOrEmpty(dataByKey.szRealEffect))
                {
                    bool       bMiniMap      = false;
                    MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

                    if (theMinimapSys != null)
                    {
                        bMiniMap = (theMinimapSys.CurMapType() == MinimapSys.EMapType.Mini);
                    }
                    Vector2 screenPos = MiniMapSysUT.CalcScreenPosInMapByWorldPos(ref vector, bMiniMap);
                    miniMapEffectModule.PlayScreenPosEffect(dataByKey.szRealEffect, (float)((int)dataByKey.bTime * 1000), screenPos);
                }
            }
        }
コード例 #27
0
        public static GameObject GetMapGameObject(ActorRoot actor, bool bMiniMap, out UI3DEventCom evtCom)
        {
            evtCom = null;
            float      num           = 1f;
            GameObject gameObject    = null;
            string     text          = string.Empty;
            bool       flag          = actor.IsHostCamp();
            MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

            if (theMinimapSys == null)
            {
                return(null);
            }
            if (actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
            {
                text = ((!flag) ? MiniMapSysUT.Map_HeroEnemy_prefab : MiniMapSysUT.Map_HeroAlice_prefab);
                bool flag2 = actor.TheActorMeta.PlayerId == Singleton <GamePlayerCenter> .GetInstance().HostPlayerId;

                if (flag2)
                {
                    text = MiniMapSysUT.Map_HeroSelf_prefab;
                }
                gameObject = ((!bMiniMap) ? theMinimapSys.bmpcHero : theMinimapSys.mmpcHero);
                if (!bMiniMap)
                {
                    if (evtCom == null)
                    {
                        evtCom = new UI3DEventCom();
                    }
                    MiniMapSysUT.SetEventComScreenSize(evtCom, 40f, 40f, 1f);
                    MiniMapSysUT.SetMapElement_EventParam(evtCom, actor.IsHostCamp(), MinimapSys.ElementType.Hero, actor.ObjID, (uint)actor.TheActorMeta.ConfigId);
                    if (evtCom != null)
                    {
                        theMinimapSys.UI3DEventMgr.Register(evtCom, UI3DEventMgr.EventComType.Hero);
                    }
                }
            }
            else if (actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_EYE)
            {
                text       = ((!flag) ? MiniMapSysUT.Map_EyeEnemy_prefab : MiniMapSysUT.Map_EyeAlice_prefab);
                gameObject = ((!bMiniMap) ? theMinimapSys.bmpcEye : theMinimapSys.mmpcEye);
                num        = ((!bMiniMap) ? 1f : 0.5f);
                if (!bMiniMap)
                {
                    if (evtCom == null)
                    {
                        evtCom = new UI3DEventCom();
                    }
                    MiniMapSysUT.SetEventComScreenSize(evtCom, 30f, 18f, 1f);
                    MiniMapSysUT.SetMapElement_EventParam(evtCom, actor.IsHostCamp(), MinimapSys.ElementType.Eye, actor.ObjID, (uint)actor.TheActorMeta.ConfigId);
                    if (evtCom != null)
                    {
                        theMinimapSys.UI3DEventMgr.Register(evtCom, UI3DEventMgr.EventComType.Eye);
                    }
                }
            }
            else if (actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
            {
                byte actorSubType = actor.ActorControl.GetActorSubType();
                if (actorSubType == 2)
                {
                    byte actorSubSoliderType = actor.ActorControl.GetActorSubSoliderType();
                    if (actorSubSoliderType == 8 || actorSubSoliderType == 9 || actorSubSoliderType == 13 || actorSubSoliderType == 7)
                    {
                        return(null);
                    }
                    if (actorSubSoliderType == 11)
                    {
                        text       = MiniMapSysUT.Map_RedBuff_prefab;
                        gameObject = ((!bMiniMap) ? theMinimapSys.bmpcRedBuff : theMinimapSys.mmpcRedBuff);
                        num        = ((!bMiniMap) ? 1f : 0.6f);
                    }
                    else if (actorSubSoliderType == 10)
                    {
                        text       = MiniMapSysUT.Map_BlueBuff_prefab;
                        gameObject = ((!bMiniMap) ? theMinimapSys.bmpcBlueBuff : theMinimapSys.mmpcBlueBuff);
                        num        = ((!bMiniMap) ? 1f : 0.6f);
                    }
                    else
                    {
                        text       = MiniMapSysUT.Map_Jungle_prefab;
                        gameObject = ((!bMiniMap) ? theMinimapSys.bmpcJungle : theMinimapSys.mmpcJungle);
                        num        = ((!bMiniMap) ? 1.3f : 1f);
                    }
                }
                else
                {
                    if (bMiniMap)
                    {
                        gameObject = ((!flag) ? theMinimapSys.mmpcEnemy : theMinimapSys.mmpcAlies);
                    }
                    else
                    {
                        gameObject = ((!flag) ? theMinimapSys.bmpcEnemy : theMinimapSys.bmpcAlies);
                    }
                    text = ((!flag) ? MiniMapSysUT.Map_SoilderEnemy_prefab : MiniMapSysUT.Map_SoilderAlice_prefab);
                    num  = ((!bMiniMap) ? 0.6f : 0.3f);
                }
            }
            else if (actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
            {
                if (actor.TheStaticData.TheOrganOnlyInfo.OrganType == 1 || actor.TheStaticData.TheOrganOnlyInfo.OrganType == 4)
                {
                    text       = ((!flag) ? MiniMapSysUT.Map_OrganEnemy_prefab : MiniMapSysUT.Map_OrganAlice_prefab);
                    gameObject = ((!bMiniMap) ? theMinimapSys.bmpcOrgan : theMinimapSys.mmpcOrgan);
                    num        = ((!bMiniMap) ? 1f : 0.5f);
                    if (!bMiniMap)
                    {
                        if (evtCom == null)
                        {
                            evtCom = new UI3DEventCom();
                        }
                        MiniMapSysUT.SetEventComScreenSize(evtCom, 30f, 32f, 1f);
                        MiniMapSysUT.SetMapElement_EventParam(evtCom, flag, MinimapSys.ElementType.Tower, actor.ObjID, 0u);
                        if (evtCom != null)
                        {
                            theMinimapSys.UI3DEventMgr.Register(evtCom, UI3DEventMgr.EventComType.Tower);
                        }
                        if (flag)
                        {
                            Singleton <CBattleSystem> .GetInstance().TowerHitMgr.Register(actor.ObjID, actor.TheStaticData.TheOrganOnlyInfo.OrganType);
                        }
                    }
                }
                else
                {
                    if (actor.TheStaticData.TheOrganOnlyInfo.OrganType != 2)
                    {
                        return(null);
                    }
                    text       = ((!flag) ? MiniMapSysUT.Map_BaseEnemy_prefab : MiniMapSysUT.Map_BaseAlice_prefab);
                    gameObject = ((!bMiniMap) ? theMinimapSys.bmpcOrgan : theMinimapSys.mmpcOrgan);
                    num        = ((!bMiniMap) ? 1f : 0.5f);
                    if (!bMiniMap)
                    {
                        if (evtCom == null)
                        {
                            evtCom = new UI3DEventCom();
                        }
                        MiniMapSysUT.SetEventComScreenSize(evtCom, 30f, 32f, 1f);
                        MiniMapSysUT.SetMapElement_EventParam(evtCom, flag, MinimapSys.ElementType.Base, actor.ObjID, 0u);
                        if (evtCom != null)
                        {
                            theMinimapSys.UI3DEventMgr.Register(evtCom, UI3DEventMgr.EventComType.Tower);
                        }
                        if (flag)
                        {
                            Singleton <CBattleSystem> .GetInstance().TowerHitMgr.Register(actor.ObjID, actor.TheStaticData.TheOrganOnlyInfo.OrganType);
                        }
                    }
                }
            }
            if (string.IsNullOrEmpty(text))
            {
                return(null);
            }
            GameObject gameObject2 = Singleton <CGameObjectPool> .GetInstance().GetGameObject(text, 0);

            if (gameObject == null)
            {
                return(null);
            }
            if (gameObject2 != null)
            {
                gameObject2.transform.SetParent(gameObject.transform, true);
                gameObject2.transform.localScale    = new Vector3(num, num, 1f);
                gameObject2.transform.localRotation = Quaternion.identity;
                MiniMapSysUT.NativeSizeLize(gameObject2);
            }
            if (actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
            {
                float num2 = (!bMiniMap) ? (65f * Sprite3D.Ratio()) : (34f * Sprite3D.Ratio());
                MiniMapSysUT.NativeSizeLize(gameObject2, num2, num2);
            }
            return(gameObject2);
        }
コード例 #28
0
        public static GameObject GetMapGameObject(ActorRoot actor, bool bMiniMap, out UI3DEventCom evtCom)
        {
            evtCom = null;
            float      num        = 1f;
            GameObject gameObject = null;
            string     text       = string.Empty;
            bool       flag       = Singleton <WatchController> .GetInstance().IsWatching ? (actor.TheActorMeta.ActorCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) : actor.IsHostCamp();

            MinimapSys theMinimapSys = Singleton <CBattleSystem> .GetInstance().TheMinimapSys;

            if (theMinimapSys == null)
            {
                return(null);
            }
            if (actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero || actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Call)
            {
                if (!flag && actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Call)
                {
                    CallActorWrapper callActorWrapper = actor.ActorControl as CallActorWrapper;
                    if (callActorWrapper != null && !callActorWrapper.IsTrueType)
                    {
                        flag = true;
                    }
                }
                text = (flag ? MiniMapSysUT.Map_HeroAlice_prefab : MiniMapSysUT.Map_HeroEnemy_prefab);
                bool flag2 = actor.TheActorMeta.PlayerId == Singleton <GamePlayerCenter> .GetInstance().HostPlayerId;

                if (flag2)
                {
                    text = MiniMapSysUT.Map_HeroSelf_prefab;
                }
                if (bMiniMap)
                {
                    gameObject = (flag ? theMinimapSys.mmpcHeroBgFrame_Friend : theMinimapSys.mmpcHeroBgFrame_Enemy);
                }
                else
                {
                    gameObject = (flag ? theMinimapSys.bmpcHeroBgFrame_Friend : theMinimapSys.bmpcHeroBgFrame_Enemy);
                }
                if (!bMiniMap)
                {
                    evtCom = new UI3DEventCom();
                    MiniMapSysUT.SetEventComScreenSize(evtCom, 40f, 40f, 1f);
                    MiniMapSysUT.SetMapElement_EventParam(evtCom, actor.IsHostCamp(), MinimapSys.ElementType.Hero, actor.ObjID, (uint)actor.TheActorMeta.ConfigId);
                    theMinimapSys.UI3DEventMgr.Register(evtCom, UI3DEventMgr.EventComType.Hero);
                }
            }
            else if (actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_EYE)
            {
                text       = (flag ? MiniMapSysUT.Map_EyeAlice_prefab : MiniMapSysUT.Map_EyeEnemy_prefab);
                gameObject = (bMiniMap ? theMinimapSys.mmpcEye : theMinimapSys.bmpcEye);
                num        = (bMiniMap ? 0.5f : 1f);
                if (!bMiniMap)
                {
                    evtCom = new UI3DEventCom();
                    MiniMapSysUT.SetEventComScreenSize(evtCom, 30f, 18f, 1f);
                    MiniMapSysUT.SetMapElement_EventParam(evtCom, actor.IsHostCamp(), MinimapSys.ElementType.Eye, actor.ObjID, (uint)actor.TheActorMeta.ConfigId);
                    theMinimapSys.UI3DEventMgr.Register(evtCom, UI3DEventMgr.EventComType.Eye);
                }
            }
            else if (actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
            {
                byte actorSubType = actor.ActorControl.GetActorSubType();
                if (actorSubType == 2)
                {
                    byte actorSubSoliderType = actor.ActorControl.GetActorSubSoliderType();
                    if (actorSubSoliderType == 8 || actorSubSoliderType == 9 || actorSubSoliderType == 13 || actorSubSoliderType == 7)
                    {
                        return(null);
                    }
                    if (actorSubSoliderType == 11)
                    {
                        text       = MiniMapSysUT.Map_RedBuff_prefab;
                        gameObject = (bMiniMap ? theMinimapSys.mmpcRedBuff : theMinimapSys.bmpcRedBuff);
                        num        = (bMiniMap ? 0.6f : 1f);
                    }
                    else if (actorSubSoliderType == 10)
                    {
                        text       = MiniMapSysUT.Map_BlueBuff_prefab;
                        gameObject = (bMiniMap ? theMinimapSys.mmpcBlueBuff : theMinimapSys.bmpcBlueBuff);
                        num        = (bMiniMap ? 0.6f : 1f);
                    }
                    else
                    {
                        text       = MiniMapSysUT.Map_Jungle_prefab;
                        gameObject = (bMiniMap ? theMinimapSys.mmpcJungle : theMinimapSys.bmpcJungle);
                        num        = (bMiniMap ? 1f : 1.3f);
                    }
                }
                else
                {
                    if (bMiniMap)
                    {
                        gameObject = (flag ? theMinimapSys.mmpcAlies : theMinimapSys.mmpcEnemy);
                    }
                    else
                    {
                        gameObject = (flag ? theMinimapSys.bmpcAlies : theMinimapSys.bmpcEnemy);
                    }
                    text = (flag ? MiniMapSysUT.Map_SoilderAlice_prefab : MiniMapSysUT.Map_SoilderEnemy_prefab);
                    num  = (bMiniMap ? 0.3f : 0.6f);
                    byte actorSubSoliderType2 = actor.ActorControl.GetActorSubSoliderType();
                    if (actorSubSoliderType2 == 16)
                    {
                        text = MiniMapSysUT.Map_Vanguard_prefab;
                        num  = (bMiniMap ? 1f : 1.5f);
                    }
                    if (!bMiniMap)
                    {
                        evtCom = new UI3DEventCom();
                        MiniMapSysUT.SetEventComScreenSize(evtCom, 30f, 18f, 1f);
                        MiniMapSysUT.SetMapElement_EventParam(evtCom, actor.IsHostCamp(), MinimapSys.ElementType.Solider, actor.ObjID, (uint)actor.TheActorMeta.ConfigId);
                        theMinimapSys.UI3DEventMgr.Register(evtCom, UI3DEventMgr.EventComType.Solider);
                    }
                }
            }
            else if (actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
            {
                if (actor.TheStaticData.TheOrganOnlyInfo.OrganType == 1 || actor.TheStaticData.TheOrganOnlyInfo.OrganType == 4)
                {
                    text       = (flag ? MiniMapSysUT.Map_OrganAlice_prefab : MiniMapSysUT.Map_OrganEnemy_prefab);
                    gameObject = (bMiniMap ? theMinimapSys.mmpcOrgan : theMinimapSys.bmpcOrgan);
                    num        = (bMiniMap ? 0.5f : 1f);
                    if (!bMiniMap)
                    {
                        evtCom = new UI3DEventCom();
                        MiniMapSysUT.SetEventComScreenSize(evtCom, 30f, 32f, 1f);
                        MiniMapSysUT.SetMapElement_EventParam(evtCom, flag, MinimapSys.ElementType.Tower, actor.ObjID, 0u);
                        theMinimapSys.UI3DEventMgr.Register(evtCom, UI3DEventMgr.EventComType.Tower);
                        if (flag)
                        {
                            Singleton <CBattleSystem> .GetInstance().TowerHitMgr.Register(actor.ObjID, (RES_ORGAN_TYPE)actor.TheStaticData.TheOrganOnlyInfo.OrganType);
                        }
                    }
                }
                else
                {
                    if (actor.TheStaticData.TheOrganOnlyInfo.OrganType != 2)
                    {
                        return(null);
                    }
                    text       = (flag ? MiniMapSysUT.Map_BaseAlice_prefab : MiniMapSysUT.Map_BaseEnemy_prefab);
                    gameObject = (bMiniMap ? theMinimapSys.mmpcOrgan : theMinimapSys.bmpcOrgan);
                    num        = (bMiniMap ? 0.5f : 1f);
                    if (!bMiniMap)
                    {
                        evtCom = new UI3DEventCom();
                        MiniMapSysUT.SetEventComScreenSize(evtCom, 30f, 32f, 1f);
                        MiniMapSysUT.SetMapElement_EventParam(evtCom, flag, MinimapSys.ElementType.Base, actor.ObjID, 0u);
                        theMinimapSys.UI3DEventMgr.Register(evtCom, UI3DEventMgr.EventComType.Tower);
                        if (flag)
                        {
                            Singleton <CBattleSystem> .GetInstance().TowerHitMgr.Register(actor.ObjID, (RES_ORGAN_TYPE)actor.TheStaticData.TheOrganOnlyInfo.OrganType);
                        }
                    }
                }
            }
            if (string.IsNullOrEmpty(text) || gameObject == null)
            {
                return(null);
            }
            GameObject gameObject2 = Singleton <CGameObjectPool> .GetInstance().GetGameObject(text, enResourceType.BattleScene);

            if (gameObject2 != null)
            {
                gameObject2.transform.SetParent(gameObject.transform, true);
                gameObject2.transform.localScale    = new Vector3(num, num, 1f);
                gameObject2.transform.localRotation = Quaternion.identity;
                MiniMapSysUT.NativeSizeLize(gameObject2);
            }
            if (actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero || actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Call)
            {
                float num2 = bMiniMap ? (34f * Sprite3D.Ratio()) : (65f * Sprite3D.Ratio());
                MiniMapSysUT.NativeSizeLize(gameObject2, num2, num2);
            }
            return(gameObject2);
        }