Пример #1
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);
        }
        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);
        }