Esempio n. 1
0
        // Token: 0x06008BF6 RID: 35830 RVA: 0x0028DE78 File Offset: 0x0028C078
        private void PlayFx(string name, Vector3 p)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_PlayFxStringVector3_hotfix != null)
            {
                this.m_PlayFxStringVector3_hotfix.call(new object[]
                {
                    this,
                    name,
                    p
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            if (string.IsNullOrEmpty(name))
            {
                return;
            }
            GenericGraphic genericGraphic = this.m_clientWorld.FxPlayer.Play(name);

            if (genericGraphic != null)
            {
                genericGraphic.SetSortingOrder(2);
                genericGraphic.SetPosition(p);
                genericGraphic.SetRotation(ClientWorldConst.FaceCameraRotation);
                genericGraphic.AutoDelete(true);
            }
        }
Esempio n. 2
0
 // Token: 0x0600D804 RID: 55300 RVA: 0x003AC08C File Offset: 0x003AA28C
 public void SetLoopFxName(string name)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetLoopFxNameString_hotfix != null)
     {
         this.m_SetLoopFxNameString_hotfix.call(new object[]
         {
             this,
             name
         });
         return;
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     if (name == this.m_loopFxName)
     {
         return;
     }
     this.m_loopFxName = name;
     for (int i = 0; i < this.m_loopFxs.Length; i++)
     {
         GenericGraphic genericGraphic = this.m_loopFxs[i];
         if (genericGraphic != null && genericGraphic.AssetName != name)
         {
             genericGraphic.FxStop(true);
             this.m_loopFxs[i] = null;
         }
     }
 }
Esempio n. 3
0
        // Token: 0x06008ACB RID: 35531 RVA: 0x00286F60 File Offset: 0x00285160
        public GenericGraphic Create(string assetName)
        {
            if (string.IsNullOrEmpty(assetName))
            {
                return(null);
            }
            List <GenericGraphic> list;

            if (this.m_pool.TryGetValue(assetName, out list) && list.Count > 0)
            {
                GenericGraphic genericGraphic = list[list.Count - 1];
                list.RemoveAt(list.Count - 1);
                genericGraphic.SetActive(true);
                return(genericGraphic);
            }
            GenericGraphic genericGraphic2 = new GenericGraphic();

            if (genericGraphic2.Create(assetName, this.m_isFx))
            {
                if (this.m_parentGameObject != null)
                {
                    genericGraphic2.SetParent(this.m_parentGameObject);
                }
                return(genericGraphic2);
            }
            genericGraphic2.Destroy();
            return(null);
        }
 // Token: 0x06009734 RID: 38708 RVA: 0x002B34C8 File Offset: 0x002B16C8
 public void DestroyGraphic(GenericGraphic graphic)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_DestroyGraphicGenericGraphic_hotfix != null)
     {
         this.m_DestroyGraphicGenericGraphic_hotfix.call(new object[]
         {
             this,
             graphic
         });
         return;
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     this.m_graphicPool.Destroy(graphic);
 }
Esempio n. 5
0
        // Token: 0x06008A7B RID: 35451 RVA: 0x00283FDC File Offset: 0x002821DC
        public GenericGraphic Play(string assetName)
        {
            if (string.IsNullOrEmpty(assetName))
            {
                return(null);
            }
            GenericGraphic genericGraphic = this.m_pool.Create(assetName);

            if (genericGraphic != null)
            {
                if (this.m_parentGameObject != null)
                {
                    genericGraphic.SetParent(this.m_parentGameObject);
                }
                this.m_fxs.Add(genericGraphic);
            }
            return(genericGraphic);
        }
Esempio n. 6
0
        // Token: 0x06008A7E RID: 35454 RVA: 0x002840F8 File Offset: 0x002822F8
        public void Tick(float dt)
        {
            int i = 0;

            while (i < this.m_fxs.Count)
            {
                GenericGraphic genericGraphic = this.m_fxs[i];
                if (genericGraphic.IsDeleteMe)
                {
                    this.m_fxs.RemoveAt(i);
                    this.m_pool.Destroy(genericGraphic);
                }
                else
                {
                    genericGraphic.Tick(dt);
                    i++;
                }
            }
        }
    public static int Create(IntPtr l)
    {
        int result;

        try
        {
            GraphicPool graphicPool = (GraphicPool)LuaObject.checkSelf(l);
            string      assetName;
            LuaObject.checkType(l, 2, out assetName);
            GenericGraphic o = graphicPool.Create(assetName);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Esempio n. 8
0
    public static int Play(IntPtr l)
    {
        int result;

        try
        {
            FxPlayer fxPlayer = (FxPlayer)LuaObject.checkSelf(l);
            string   assetName;
            LuaObject.checkType(l, 2, out assetName);
            GenericGraphic o = fxPlayer.Play(assetName);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
        // Token: 0x06009733 RID: 38707 RVA: 0x002B3414 File Offset: 0x002B1614
        public GenericGraphic CreateGraphic(string assetName, float scale)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CreateGraphicStringSingle_hotfix != null)
            {
                return((GenericGraphic)this.m_CreateGraphicStringSingle_hotfix.call(new object[]
                {
                    this,
                    assetName,
                    scale
                }));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            GenericGraphic genericGraphic = this.m_graphicPool.Create(assetName);

            if (genericGraphic != null)
            {
                genericGraphic.SetParent(this.m_graphicRoot);
                genericGraphic.SetPrefabScale(scale);
            }
            return(genericGraphic);
        }
Esempio n. 10
0
        // Token: 0x06008ACC RID: 35532 RVA: 0x00287000 File Offset: 0x00285200
        public void Destroy(GenericGraphic g)
        {
            if (g == null)
            {
                return;
            }
            string assetName = g.AssetName;
            List <GenericGraphic> list;

            if (!this.m_pool.TryGetValue(assetName, out list))
            {
                list = new List <GenericGraphic>();
                this.m_pool.Add(assetName, list);
            }
            g.SetActive(false);
            if (this.m_parentGameObject != null)
            {
                g.SetParent(this.m_parentGameObject);
            }
            list.Add(g);
        }
    public static int CreateGraphic(IntPtr l)
    {
        int result;

        try
        {
            ArenaDefendBattle arenaDefendBattle = (ArenaDefendBattle)LuaObject.checkSelf(l);
            string            assetName;
            LuaObject.checkType(l, 2, out assetName);
            float scale;
            LuaObject.checkType(l, 3, out scale);
            GenericGraphic o = arenaDefendBattle.CreateGraphic(assetName, scale);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Esempio n. 12
0
        // Token: 0x06009760 RID: 38752 RVA: 0x002B41C8 File Offset: 0x002B23C8
        public void PlayOnStageFx(GridPosition pos)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_PlayOnStageFxGridPosition_hotfix != null)
            {
                this.m_PlayOnStageFxGridPosition_hotfix.call(new object[]
                {
                    this,
                    pos
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            if (this.m_arenaDefendBattle == null)
            {
                return;
            }
            GenericGraphic genericGraphic = this.m_arenaDefendBattle.FxPlayer.Play("FX/Common_ABS/CommonFX/OnTouchMovePlaceInMan/OnTouchEnd_G.prefab");

            if (genericGraphic != null)
            {
                genericGraphic.AutoDelete(true);
                genericGraphic.SetPosition(this.StagePositionToWorldPosition(pos));
            }
        }
Esempio n. 13
0
 // Token: 0x0600D809 RID: 55305 RVA: 0x003AC368 File Offset: 0x003AA568
 public void Tick(float dt)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_TickSingle_hotfix != null)
     {
         this.m_TickSingle_hotfix.call(new object[]
         {
             this,
             dt
         });
         return;
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     if (this.m_camera == null)
     {
         return;
     }
     this.m_touchStates.Clear();
     for (int i = 0; i < Input.touchCount; i++)
     {
         Touch touch             = Input.GetTouch(i);
         TouchFx.TouchState item = default(TouchFx.TouchState);
         item.phase    = touch.phase;
         item.fingerId = touch.fingerId;
         item.position = touch.position;
         this.m_touchStates.Add(item);
     }
     if (this.m_touchStates.Count == 0)
     {
         for (int j = 0; j < 3; j++)
         {
             if (Input.GetMouseButtonDown(j))
             {
                 TouchFx.TouchState item2 = default(TouchFx.TouchState);
                 item2.phase    = TouchPhase.Began;
                 item2.fingerId = j;
                 item2.position = Input.mousePosition;
                 this.m_touchStates.Add(item2);
             }
             if (Input.GetMouseButtonUp(j))
             {
                 TouchFx.TouchState item3 = default(TouchFx.TouchState);
                 item3.phase    = TouchPhase.Ended;
                 item3.fingerId = j;
                 item3.position = Input.mousePosition;
                 this.m_touchStates.Add(item3);
             }
             if (Input.GetMouseButton(j))
             {
                 TouchFx.TouchState item4 = default(TouchFx.TouchState);
                 item4.phase    = TouchPhase.Moved;
                 item4.fingerId = j;
                 item4.position = Input.mousePosition;
                 this.m_touchStates.Add(item4);
             }
         }
     }
     foreach (TouchFx.TouchState touchState in this.m_touchStates)
     {
         if (touchState.fingerId < this.m_loopFxs.Length)
         {
             Vector3 position = this.m_camera.ScreenToWorldPoint(touchState.position);
             if (touchState.phase == TouchPhase.Began)
             {
                 if (!(this.m_disableInputGameObject != null) || !this.m_disableInputGameObject.activeSelf)
                 {
                     GenericGraphic genericGraphic = this.m_fxPlayer.Play(this.m_hitFxName);
                     if (genericGraphic != null)
                     {
                         genericGraphic.SetPosition(position);
                         genericGraphic.AutoDelete(true);
                     }
                     if (this.m_loopFxs[touchState.fingerId] == null)
                     {
                         this.m_loopFxs[touchState.fingerId] = this.m_fxPlayer.Play(this.m_loopFxName);
                         if (this.m_loopFxs[touchState.fingerId] != null)
                         {
                             this.m_loopFxs[touchState.fingerId].AutoDelete(false);
                         }
                     }
                     if (this.m_loopFxs[touchState.fingerId] != null)
                     {
                         this.m_loopFxs[touchState.fingerId].SetPosition(position);
                     }
                 }
             }
             else if (touchState.phase == TouchPhase.Ended || touchState.phase == TouchPhase.Canceled)
             {
                 if (this.m_loopFxs[touchState.fingerId] != null)
                 {
                     this.m_loopFxs[touchState.fingerId].FxStop(true);
                     this.m_loopFxs[touchState.fingerId] = null;
                 }
             }
             else if (touchState.phase == TouchPhase.Moved && this.m_loopFxs[touchState.fingerId] != null)
             {
                 this.m_loopFxs[touchState.fingerId].SetPosition(position);
             }
         }
     }
     this.m_fxPlayer.Tick(dt);
 }