示例#1
0
 public void SetResting(bool isResting)
 {
     if (isResting != this.IsResting() & isResting && this.CanMerge())
     {
         List <Collider> list = (List <Collider>)Pool.GetList <Collider>();
         Vis.Colliders <Collider>(((Component)this).get_transform().get_position(), 0.5f, list, 512, (QueryTriggerInteraction)2);
         using (List <Collider> .Enumerator enumerator = list.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 BaseEntity baseEntity = ((Component)enumerator.Current).get_gameObject().ToBaseEntity();
                 if (Object.op_Implicit((Object)baseEntity))
                 {
                     FireBall server = baseEntity.ToServer <FireBall>();
                     if (Object.op_Implicit((Object)server) && server.CanMerge() && Object.op_Inequality((Object)server, (Object)this))
                     {
                         server.Invoke(new Action(this.Extinguish), 1f);
                         server.canMerge = false;
                         this.AddLife(server.TimeLeft() * 0.25f);
                     }
                 }
             }
         }
         // ISSUE: cast to a reference type
         Pool.FreeList <Collider>((List <M0>&) ref list);
     }
     this.SetFlag(BaseEntity.Flags.OnFire, isResting, false, true);
 }
 public void SetResting(bool isResting)
 {
     if (isResting != this.IsResting() & isResting && this.CanMerge())
     {
         List <Collider> list = Pool.GetList <Collider>();
         Vis.Colliders <Collider>(base.transform.position, 0.5f, list, 512, QueryTriggerInteraction.Collide);
         foreach (Collider collider in list)
         {
             BaseEntity baseEntity = collider.gameObject.ToBaseEntity();
             if (!baseEntity)
             {
                 continue;
             }
             FireBall server = baseEntity.ToServer <FireBall>();
             if (!server || !server.CanMerge() || !(server != this))
             {
                 continue;
             }
             server.Invoke(new Action(this.Extinguish), 1f);
             server.canMerge = false;
             this.AddLife(server.TimeLeft() * 0.25f);
         }
         Pool.FreeList <Collider>(ref list);
     }
     base.SetFlag(BaseEntity.Flags.OnFire, isResting, false, true);
 }
示例#3
0
 public void SetResting(bool isResting)
 {
     if (isResting != IsResting() && isResting && TimeAlive() > 1f && CanMerge())
     {
         List <Collider> obj = Pool.GetList <Collider>();
         Vis.Colliders(base.transform.position, 0.5f, obj, 512);
         foreach (Collider item in obj)
         {
             BaseEntity baseEntity = GameObjectEx.ToBaseEntity(item.gameObject);
             if ((bool)baseEntity)
             {
                 FireBall fireBall = baseEntity.ToServer <FireBall>();
                 if ((bool)fireBall && fireBall.CanMerge() && fireBall != this)
                 {
                     fireBall.Invoke(Extinguish, 1f);
                     fireBall.canMerge = false;
                     AddLife(fireBall.TimeLeft() * 0.25f);
                 }
             }
         }
         Pool.FreeList(ref obj);
     }
     SetFlag(Flags.OnFire, isResting);
 }