Beispiel #1
0
        public static void SetMapElement_EventParam(UI3DEventCom evtCom, bool bAlien, MinimapSys.ElementType type, uint objID = 0u, uint targetHeroID = 0u)
        {
            if (evtCom == null || type == MinimapSys.ElementType.None)
            {
                return;
            }
            stUIEventParams eventParams = default(stUIEventParams);

            eventParams.tag     = ((!bAlien) ? 0 : 1);
            eventParams.tag2    = (int)type;
            eventParams.tagUInt = objID;
            eventParams.heroId  = targetHeroID;
            if (type == MinimapSys.ElementType.Dragon_3 || type == MinimapSys.ElementType.Dragon_5_big || type == MinimapSys.ElementType.Dragon_5_small)
            {
                eventParams.tag3 = 2;
            }
            else if (type == MinimapSys.ElementType.Tower || type == MinimapSys.ElementType.Base)
            {
                eventParams.tag3 = ((!bAlien) ? 2 : 3);
            }
            else if (type == MinimapSys.ElementType.Hero)
            {
                eventParams.tag3 = ((!bAlien) ? 2 : 5);
            }
            evtCom.m_eventID     = MiniMapSysUT.GetEventId(type);
            evtCom.m_eventParams = eventParams;
        }
Beispiel #2
0
        public void Register(UI3DEventCom com, UI3DEventMgr.EventComType comType)
        {
            com.isDead = false;
            switch (comType)
            {
            case UI3DEventMgr.EventComType.Hero:
                if (!this.m_evtComsHeros.Contains(com))
                {
                    this.m_evtComsHeros.Add(com);
                }
                break;

            case UI3DEventMgr.EventComType.Tower:
                if (!this.m_evtComsTowers.Contains(com))
                {
                    this.m_evtComsTowers.Add(com);
                }
                break;

            case UI3DEventMgr.EventComType.Eye:
                if (!this.m_evtComsEyes.Contains(com))
                {
                    this.m_evtComsEyes.Add(com);
                }
                break;
            }
        }
Beispiel #3
0
 public void UnRegister(UI3DEventCom com)
 {
     this.m_evtComsHeros.Remove(com);
     this.m_evtComsTowers.Remove(com);
     this.m_evtComsEyes.Remove(com);
     this.m_evtComsSoliders.Remove(com);
 }
 private static void SetEventComScreenSize(UI3DEventCom evtCom, float width, float height, float scale = 1f)
 {
     if (evtCom != null)
     {
         evtCom.m_screenSize.width  = width * scale * Sprite3D.Ratio();
         evtCom.m_screenSize.height = height * scale * Sprite3D.Ratio();
     }
 }
Beispiel #5
0
 private static void SetEventComScreenSize(UI3DEventCom evtCom, Sprite3D sptCom, float scale = 1f)
 {
     if (evtCom == null)
     {
         return;
     }
     evtCom.m_screenSize.width  = (float)sptCom.textureWidth * scale * Sprite3D.Ratio();
     evtCom.m_screenSize.height = (float)sptCom.textureHeight * scale * Sprite3D.Ratio();
 }
Beispiel #6
0
 public void Register(UI3DEventCom com, bool bHero)
 {
     com.isDead = false;
     if (bHero)
     {
         if (!this.m_evtComsHeros.Contains(com))
         {
             this.m_evtComsHeros.Add(com);
         }
     }
     else if (!this.m_evtComsTowers.Contains(com))
     {
         this.m_evtComsTowers.Add(com);
     }
 }
Beispiel #7
0
        public bool HandleSkillClickEvent(PointerEventData pointerEventData)
        {
            float        num          = 3.40282347E+38f;
            UI3DEventCom uI3DEventCom = null;

            this.GetNearestTarget(pointerEventData, this.m_evtComsTowers, ref num, ref uI3DEventCom);
            this.GetNearestTarget(pointerEventData, this.m_evtComsEyes, ref num, ref uI3DEventCom);
            this.GetNearestTarget(pointerEventData, this.m_evtComsSoliders, ref num, ref uI3DEventCom);
            if (uI3DEventCom != null)
            {
                this.DispatchEvent(uI3DEventCom, pointerEventData);
                return(true);
            }
            return(false);
        }
Beispiel #8
0
        private void DispatchEvent(UI3DEventCom eventScript, PointerEventData pointerEventData)
        {
            if (eventScript == null || pointerEventData == null)
            {
                return;
            }
            CUIEvent uIEvent = Singleton <CUIEventManager> .GetInstance().GetUIEvent();

            uIEvent.m_eventID          = eventScript.m_eventID;
            uIEvent.m_eventParams      = eventScript.m_eventParams;
            uIEvent.m_pointerEventData = pointerEventData;
            if (Singleton <CUIEventManager> .GetInstance() != null)
            {
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(uIEvent);
            }
        }
Beispiel #9
0
 private void clearList(ListView <UI3DEventCom> list)
 {
     if (list == null)
     {
         return;
     }
     for (int i = 0; i < list.Count; i++)
     {
         UI3DEventCom uI3DEventCom = list[i];
         if (uI3DEventCom != null)
         {
             uI3DEventCom.Clear();
         }
     }
     list.Clear();
 }
Beispiel #10
0
        public bool HandleSkillClickEvent(PointerEventData pointerEventData)
        {
            float        num          = 3.40282347E+38f;
            UI3DEventCom uI3DEventCom = null;

            for (int i = 0; i < this.m_evtComsTowers.get_Count(); i++)
            {
                UI3DEventCom uI3DEventCom2 = this.m_evtComsTowers.get_Item(i);
                Rect         screenSize    = uI3DEventCom2.m_screenSize;
                screenSize.size *= 3f;
                float num2 = (screenSize.size.x <= screenSize.size.y) ? screenSize.size.y : screenSize.size.x;
                num2 *= num2;
                if (uI3DEventCom2 != null)
                {
                    float sqrMagnitude = (uI3DEventCom2.m_screenSize.center - pointerEventData.pressPosition).sqrMagnitude;
                    if (num2 >= sqrMagnitude && sqrMagnitude < num)
                    {
                        num          = sqrMagnitude;
                        uI3DEventCom = uI3DEventCom2;
                    }
                }
            }
            for (int j = 0; j < this.m_evtComsEyes.get_Count(); j++)
            {
                UI3DEventCom uI3DEventCom3 = this.m_evtComsEyes.get_Item(j);
                Rect         screenSize2   = uI3DEventCom3.m_screenSize;
                screenSize2.size *= 3f;
                float num3 = (screenSize2.size.x <= screenSize2.size.y) ? screenSize2.size.y : screenSize2.size.x;
                num3 *= num3;
                if (uI3DEventCom3 != null)
                {
                    float sqrMagnitude2 = (uI3DEventCom3.m_screenSize.center - pointerEventData.pressPosition).sqrMagnitude;
                    if (num3 >= sqrMagnitude2 && sqrMagnitude2 < num)
                    {
                        num          = sqrMagnitude2;
                        uI3DEventCom = uI3DEventCom3;
                    }
                }
            }
            if (uI3DEventCom != null)
            {
                this.DispatchEvent(uI3DEventCom, pointerEventData);
                return(true);
            }
            return(false);
        }
Beispiel #11
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);
                }
            }
        }
Beispiel #12
0
 private void GetNearestTarget(PointerEventData pointerEventData, ListView <UI3DEventCom> targetsComs, ref float minDistance, ref UI3DEventCom targetCom)
 {
     for (int i = 0; i < targetsComs.Count; i++)
     {
         UI3DEventCom uI3DEventCom = targetsComs[i];
         Rect         screenSize   = uI3DEventCom.m_screenSize;
         screenSize.size *= 3f;
         float num = (screenSize.size.x > screenSize.size.y) ? screenSize.size.x : screenSize.size.y;
         num *= num;
         if (uI3DEventCom != null)
         {
             float sqrMagnitude = (uI3DEventCom.m_screenSize.center - pointerEventData.get_pressPosition()).sqrMagnitude;
             if (num >= sqrMagnitude && sqrMagnitude < minDistance)
             {
                 minDistance = sqrMagnitude;
                 targetCom   = uI3DEventCom;
             }
         }
     }
 }
Beispiel #13
0
 public bool HandleClickEvent(PointerEventData pointerEventData)
 {
     for (int i = 0; i < this.m_evtComsHeros.get_Count(); i++)
     {
         UI3DEventCom uI3DEventCom = this.m_evtComsHeros.get_Item(i);
         if (uI3DEventCom != null && !uI3DEventCom.isDead && uI3DEventCom.m_screenSize.Contains(pointerEventData.pressPosition))
         {
             this.DispatchEvent(uI3DEventCom, pointerEventData);
             return(true);
         }
     }
     for (int j = 0; j < this.m_evtComsTowers.get_Count(); j++)
     {
         UI3DEventCom uI3DEventCom2 = this.m_evtComsTowers.get_Item(j);
         if (uI3DEventCom2 != null && !uI3DEventCom2.isDead && uI3DEventCom2.m_screenSize.Contains(pointerEventData.pressPosition))
         {
             this.DispatchEvent(uI3DEventCom2, pointerEventData);
             return(true);
         }
     }
     return(false);
 }
Beispiel #14
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);
        }