public void SetParticleScreenPosition(UIParticleInfo uiParticleInfo, ref Vector2 screenPosition)
 {
     if (this.m_particleContainerScript != null && uiParticleInfo != null && uiParticleInfo.parObj != null)
     {
         this.m_particleContainerScript.ChangeScreenPositionToWorld(uiParticleInfo.parObj, ref screenPosition);
     }
 }
 public void Clear()
 {
     if (this.UIParticleInfo != null)
     {
         Singleton <CUIParticleSystem> .instance.RemoveParticle(this.UIParticleInfo);
     }
     this.UIParticleInfo            = null;
     this.bCreateParticleByPosition = false;
 }
        public void CreateParticleByInsidePos()
        {
            if (this.UIParticleInfo == null && this.bCreateParticleByPosition)
            {
                this.bCreateParticleByPosition = false;
                this.UIParticleInfo            = Singleton <CUIParticleSystem> .instance.AddParticle(MiniMapEffectModule.teleportEft, -1f, this.m_screenSize.center, default(Quaternion?));

                this.UIParticleInfo.parObj.CustomSetActive(true);
            }
        }
Exemple #4
0
 public void RemoveParticle(UIParticleInfo pInfo)
 {
     if (pInfo != null)
     {
         if (this.m_particleContainerScript != null)
         {
             this.m_particleContainerScript.RemoveGameObject(pInfo.parObj);
         }
         pInfo.parObj = null;
         this.m_particleList.Remove(pInfo);
     }
 }
Exemple #5
0
 public CSignal(uint playerID, int signalID, int worldPositionX, int worldPositionY, int worldPositionZ, bool bUseSignal, bool bSmall, bool bUseCfgSound)
 {
     this.m_playerID         = playerID;
     this.m_signalID         = signalID;
     this.bSmall             = bSmall;
     this.bUseCfgSound       = bUseCfgSound;
     this.m_worldPosition    = new Vector3((float)worldPositionX, (float)worldPositionY, (float)worldPositionZ);
     this.m_bUseSignal       = bUseSignal;
     this.m_effectInScene    = null;
     this.m_signalInUIEffect = null;
     this.m_signalInUi       = null;
 }
Exemple #6
0
 public CSignal(PoolObjHandle <ActorRoot> followActor, int signalID, bool bUseSignal, bool bSmall, bool bUseCfgSound)
 {
     this.m_playerID           = 0u;
     this.m_signalID           = signalID;
     this.m_signalRelatedActor = followActor;
     this.bSmall             = bSmall;
     this.bUseCfgSound       = bUseCfgSound;
     this.m_worldPosition    = Vector3.zero;
     this.m_bUseSignal       = bUseSignal;
     this.m_effectInScene    = null;
     this.m_signalInUIEffect = null;
     this.m_signalInUi       = null;
 }
            public Element(string eftName, float time, PoolObjHandle <ActorRoot> relatedActor)
            {
                if (!relatedActor)
                {
                    return;
                }
                bool bMiniMap = Singleton <CBattleSystem> .instance.TheMinimapSys.CurMapType() == MinimapSys.EMapType.Mini;

                this.m_signalRelatedActor = relatedActor;
                Vector3 vector   = (Vector3)this.m_signalRelatedActor.handle.location;
                Vector2 sreenLoc = MiniMapSysUT.CalcScreenPosInMapByWorldPos(ref vector, bMiniMap);

                this.uiParticleInfo = Singleton <CUIParticleSystem> .instance.AddParticle(eftName, time, sreenLoc, default(Quaternion?));
            }
Exemple #8
0
        public void Dispose()
        {
            if (this.m_effectInScene != null)
            {
                Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(this.m_effectInScene);

                this.m_effectInScene = null;
            }
            MiniMapSysUT.RecycleMapGameObject(this.m_signalInUi);
            this.m_signalInUi       = null;
            this.m_effectInScene    = null;
            this.m_signalInUIEffect = null;
            this.m_bUseSignal       = false;
        }
Exemple #9
0
 public CSignal(uint playerID, int signalID, int worldPositionX, int worldPositionY, int worldPositionZ, CUIContainerScript signalInUIContainer, bool bSmall, bool bUseCfgSound)
 {
     this.m_signalInUISequence = -1;
     this.bSmall                = true;
     this.m_playerID            = playerID;
     this.m_signalID            = signalID;
     this.bSmall                = bSmall;
     this.bUseCfgSound          = bUseCfgSound;
     this.m_worldPosition       = new Vector3((float)worldPositionX, (float)worldPositionY, (float)worldPositionZ);
     this.m_signalInUIContainer = signalInUIContainer;
     this.m_signalInUISequence  = -1;
     this.m_effectInScene       = null;
     this.m_signalInUIEffect    = null;
 }
Exemple #10
0
 public CSignal(PoolObjHandle <ActorRoot> followActor, int signalID, CUIContainerScript signalInUIContainer, bool bSmall, bool bUseCfgSound)
 {
     this.m_signalInUISequence = -1;
     this.bSmall                = true;
     this.m_playerID            = 0;
     this.m_signalID            = signalID;
     this.m_signalRelatedActor  = followActor;
     this.bSmall                = bSmall;
     this.bUseCfgSound          = bUseCfgSound;
     this.m_worldPosition       = Vector3.zero;
     this.m_signalInUIContainer = signalInUIContainer;
     this.m_signalInUISequence  = -1;
     this.m_effectInScene       = null;
     this.m_signalInUIEffect    = null;
 }
Exemple #11
0
 public CSignal(uint playerID, int signalID, uint heroID, int worldPositionX, int worldPositionY, int worldPositionZ, CUIContainerScript signalInUIContainer, CUIContainerScript heroNameContainer, bool bSmall, bool bFollow, bool bUseCfgSound, MinimapSys.ElementType type)
 {
     this.m_playerID            = playerID;
     this.m_signalID            = signalID;
     this.m_heroID              = heroID;
     this.bSmall                = bSmall;
     this.BFollow               = bFollow;
     this.bUseCfgSound          = bUseCfgSound;
     this.m_worldPosition       = new Vector3((float)worldPositionX, (float)worldPositionY, (float)worldPositionZ);
     this.m_signalInUIContainer = signalInUIContainer;
     this.m_signalInUISequence  = -1;
     this.m_effectInScene       = null;
     this.m_signalInUIEffect    = null;
     this.m_type                = type;
 }
        public UIParticleInfo AddParticle(string parPath, float playTime, Vector2 sreenLoc)
        {
            if (this.m_particleContainerScript == null)
            {
                return(null);
            }
            UIParticleInfo uIParticleInfo = new UIParticleInfo();

            uIParticleInfo.path        = parPath;
            uIParticleInfo.currentTime = 0f;
            uIParticleInfo.totlalTime  = playTime;
            uIParticleInfo.parObj      = this.m_particleContainerScript.AddGameObject(uIParticleInfo.path, false, ref sreenLoc, false);
            this.m_particleList.Add(uIParticleInfo);
            return(uIParticleInfo);
        }
Exemple #13
0
        public void Dispose()
        {
            if (this.m_effectInScene != null)
            {
                Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(this.m_effectInScene);

                this.m_effectInScene = null;
            }
            if ((this.m_signalInUISequence >= 0) && (this.m_signalInUIContainer != null))
            {
                this.m_signalInUIContainer.RecycleElement(this.m_signalInUISequence);
            }
            this.m_signalInUISequence  = -1;
            this.m_signalInUIContainer = null;
            this.m_effectInScene       = null;
            this.m_signalInUIEffect    = null;
        }
Exemple #14
0
        public UIParticleInfo AddParticle(string parPath, float playTime, Vector2 sreenLoc)
        {
            UIParticleInfo info;

            if (this.m_particleContainerScript == null)
            {
                return(null);
            }
            info = new UIParticleInfo {
                path        = parPath,
                currentTime = 0f,
                totlalTime  = playTime,
                parObj      = this.m_particleContainerScript.AddGameObject(info.path, false, ref sreenLoc, false)
            };
            this.m_particleList.Add(info);
            return(info);
        }
        public UIParticleInfo AddParticle(string parPath, float playTime, Vector2 sreenLoc, Quaternion?locRotation = null)
        {
            if (this.m_particleContainerScript == null)
            {
                return(null);
            }
            UIParticleInfo uIParticleInfo = new UIParticleInfo();

            uIParticleInfo.path        = parPath;
            uIParticleInfo.currentTime = 0f;
            uIParticleInfo.totlalTime  = playTime;
            uIParticleInfo.parObj      = this.m_particleContainerScript.AddGameObject(uIParticleInfo.path, false, ref sreenLoc, false);
            if (uIParticleInfo.parObj != null && locRotation.get_HasValue())
            {
                uIParticleInfo.parObj.transform.localRotation = locRotation.get_Value();
            }
            this.m_particleList.Add(uIParticleInfo);
            return(uIParticleInfo);
        }
Exemple #16
0
 private void OnTimer(CUIEvent uiEvent)
 {
     for (int i = 0; i < this.m_particleList.Count; i++)
     {
         if (this.m_particleList[i].totlalTime >= 0f)
         {
             UIParticleInfo local1 = this.m_particleList[i];
             local1.currentTime += 0.1f;
             if (this.m_particleList[i].currentTime >= this.m_particleList[i].totlalTime)
             {
                 if (this.m_particleContainerScript != null)
                 {
                     this.m_particleContainerScript.RemoveGameObject(this.m_particleList[i].parObj);
                 }
                 this.m_particleList.RemoveAt(i);
                 i--;
             }
         }
     }
 }
Exemple #17
0
 public CSignal(int signalID, Vector2 localPosition, bool bUseSignal, bool bSmall, bool bUseCfgSound, bool useRotation, Quaternion localRotation)
 {
     this.m_playerID      = 0u;
     this.m_signalID      = signalID;
     this.bSmall          = bSmall;
     this.bUseCfgSound    = bUseCfgSound;
     this.m_worldPosition = Vector3.zero;
     this.m_bUseSignal    = bUseSignal;
     this.m_localPosition = localPosition;
     this.bUseRotate      = useRotation;
     if (!this.bUseRotate)
     {
         this.m_localRotation = Quaternion.identity;
     }
     else
     {
         this.m_localRotation = localRotation;
     }
     this.m_effectInScene    = null;
     this.m_signalInUIEffect = null;
     this.m_signalInUi       = null;
 }
Exemple #18
0
        public void Initialize(CUIFormScript formScript, ResSignalInfo signalInfo)
        {
            if (this.m_playerID > 0)
            {
                Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(this.m_playerID);

                if (player != null)
                {
                    this.m_signalRelatedActor = player.Captain;
                }
            }
            this.m_signalInfo = signalInfo;
            if ((this.m_signalInfo == null) || (formScript == null))
            {
                this.m_duringTime    = 0f;
                this.m_maxDuringTime = 0f;
            }
            else
            {
                this.m_duringTime    = 0f;
                this.m_maxDuringTime = this.m_signalInfo.bTime;
                if ((this.m_signalInfo.bSignalType == 0) && !string.IsNullOrEmpty(this.m_signalInfo.szSceneEffect))
                {
                    this.m_effectInScene = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(this.m_signalInfo.szSceneEffect, true, SceneObjType.Temp, this.m_worldPosition);

                    this.m_effectInScene.CustomSetActive(true);
                }
                if ((this.m_signalInUIContainer != null) && !string.IsNullOrEmpty(this.m_signalInfo.szUIIcon))
                {
                    this.m_signalInUISequence = this.m_signalInUIContainer.GetElement();
                    GameObject element = this.m_signalInUIContainer.GetElement(this.m_signalInUISequence);
                    if (element != null)
                    {
                        Image component = element.GetComponent <Image>();
                        if (component != null)
                        {
                            component.SetSprite(this.m_signalInfo.szUIIcon, formScript, true, false, false);
                            component.color = new Color(1f, 1f, 1f, (this.m_signalInfo.bSignalType != 1) ? ((float)1) : ((float)0));
                        }
                        Vector3 worldPosition = this.m_worldPosition;
                        if ((this.m_signalInfo.bSignalType == 1) && (this.m_signalRelatedActor != 0))
                        {
                            worldPosition = (Vector3)this.m_signalRelatedActor.handle.location;
                        }
                        if (this.bSmall)
                        {
                            (element.transform as RectTransform).anchoredPosition = new Vector2(worldPosition.x * Singleton <CBattleSystem> .GetInstance().world_UI_Factor_Small.x, worldPosition.z * Singleton <CBattleSystem> .GetInstance().world_UI_Factor_Small.y);
                        }
                        else
                        {
                            (element.transform as RectTransform).anchoredPosition = new Vector2(worldPosition.x * Singleton <CBattleSystem> .GetInstance().world_UI_Factor_Big.x, worldPosition.z * Singleton <CBattleSystem> .GetInstance().world_UI_Factor_Big.y);
                        }
                        if ((!string.IsNullOrEmpty(this.m_signalInfo.szRealEffect) && (this.m_signalInUISequence >= 0)) && (Singleton <CBattleSystem> .instance.TheMinimapSys.CurMapType() == MinimapSys.EMapType.Mini))
                        {
                            Vector2 sreenLoc = CUIUtility.WorldToScreenPoint(formScript.GetCamera(), element.transform.position);
                            this.m_signalInUIEffect = Singleton <CUIParticleSystem> .instance.AddParticle(this.m_signalInfo.szRealEffect, (float)this.m_signalInfo.bTime, sreenLoc);
                        }
                    }
                }
                if (this.bUseCfgSound)
                {
                    string str = StringHelper.UTF8BytesToString(ref this.m_signalInfo.szSound);
                    if (!string.IsNullOrEmpty(str))
                    {
                        Singleton <CSoundManager> .GetInstance().PlayBattleSound2D(str);
                    }
                }
            }
        }
Exemple #19
0
        public void Initialize(CUIFormScript formScript, ResSignalInfo signalInfo)
        {
            if (this.m_playerID > 0u)
            {
                Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(this.m_playerID);

                if (player != null)
                {
                    this.m_signalRelatedActor = player.Captain;
                }
            }
            this.m_signalInfo = signalInfo;
            if (this.m_signalInfo == null || formScript == null)
            {
                this.m_duringTime    = 0f;
                this.m_maxDuringTime = 0f;
                return;
            }
            this.m_duringTime    = 0f;
            this.m_maxDuringTime = (float)this.m_signalInfo.bTime;
            if (this.m_signalInfo.bSignalType == 0 && !string.IsNullOrEmpty(this.m_signalInfo.szSceneEffect))
            {
                this.m_effectInScene = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(this.m_signalInfo.szSceneEffect, true, SceneObjType.Temp, this.m_worldPosition);

                this.m_effectInScene.CustomSetActive(true);
            }
            if (this.m_bUseSignal && !string.IsNullOrEmpty(this.m_signalInfo.szUIIcon))
            {
                if (this.m_signalInUi == null)
                {
                    this.m_signalInUi = MiniMapSysUT.GetSignalGameObject(true);
                }
                if (this.m_signalInUi != null)
                {
                    Vector3 vector = this.m_worldPosition;
                    if (this.m_signalInfo.bSignalType == 1 && this.m_signalRelatedActor)
                    {
                        vector = (Vector3)this.m_signalRelatedActor.get_handle().location;
                    }
                    float x;
                    float y;
                    this.m_signalInUi.transform.position = MiniMapSysUT.Set3DUIWorldPos_ByScreenPoint(ref vector, true, out x, out y);
                    if (!string.IsNullOrEmpty(this.m_signalInfo.szRealEffect) && this.m_signalInUi != null && Singleton <CBattleSystem> .get_instance().TheMinimapSys.CurMapType() == MinimapSys.EMapType.Mini)
                    {
                        Vector2 vector2 = new Vector2(x, y);
                        if (Singleton <CBattleSystem> .get_instance().FightForm.GetSignalPanel().CheckSignalPositionValid(vector2))
                        {
                            this.m_signalInUIEffect = Singleton <CUIParticleSystem> .get_instance().AddParticle(this.m_signalInfo.szRealEffect, (float)this.m_signalInfo.bTime, vector2);
                        }
                    }
                }
            }
            if (this.bUseCfgSound)
            {
                string text = StringHelper.UTF8BytesToString(ref this.m_signalInfo.szSound);
                if (!string.IsNullOrEmpty(text))
                {
                    Singleton <CSoundManager> .GetInstance().PlayBattleSound2D(text);
                }
            }
        }
            public void Clear()
            {
                Singleton <CUIParticleSystem> .instance.RemoveParticle(this.uiParticleInfo);

                this.uiParticleInfo = null;
            }