private void UpdateStage()
 {
     if (this.stages.Count == 0)
     {
         return;
     }
     for (int index = 0; index < this.stages.Count; ++index)
     {
         this.stages[index].instance.SetActive(index == this.stage);
     }
     GroundWatch.PhysicsChanged(((Component)this).get_gameObject());
 }
Ejemplo n.º 2
0
 private void UpdateStage()
 {
     if (this.stages.Count == 0)
     {
         return;
     }
     for (int i = 0; i < this.stages.Count; i++)
     {
         this.stages[i].instance.SetActive(i == this.stage);
     }
     GroundWatch.PhysicsChanged(base.gameObject);
 }
Ejemplo n.º 3
0
        private BaseEntity SpawnSmallShelves(Vector3 pos, Quaternion rot, DecayEntity floor)
        {
            BaseEntity    ent       = GameManager.server.CreateEntity("assets/scripts/entity/misc/visualstoragecontainer/visualshelvestest.prefab", pos, rot);
            LootContainer container = ent.GetComponent <LootContainer>();

            container.destroyOnEmpty   = false;
            container.initialLootSpawn = false;
            ent.GetComponent <DecayEntity>().AttachToBuilding(floor);
            DestroyOnGroundMissing des   = ent.gameObject.AddComponent <DestroyOnGroundMissing>();
            GroundWatch            watch = ent.gameObject.AddComponent <GroundWatch>();

            watch.InvokeRepeating("OnPhysicsNeighbourChanged", 0f, 0.15f);
            ent.Spawn();
            return(ent);
        }
        bool OnShelves(BaseEntity entity)
        {
            GroundWatch     component = entity.gameObject.GetComponent <GroundWatch>();
            List <Collider> list      = Facepunch.Pool.GetList <Collider>();

            Vis.Colliders <Collider>(entity.transform.TransformPoint(component.groundPosition), component.radius, list, component.layers, QueryTriggerInteraction.Collide);
            foreach (Collider collider in list)
            {
                if (!((Object)collider.transform.root == (Object)entity.gameObject.transform.root))
                {
                    BaseEntity baseEntity = collider.gameObject.ToBaseEntity();
                    if ((!(bool)((Object)baseEntity) || !baseEntity.IsDestroyed && !baseEntity.isClient) && baseEntity.ShortPrefabName == "shelves")
                    {
                        Facepunch.Pool.FreeList <Collider>(ref list);
                        return(true);
                    }
                }
            }
            Facepunch.Pool.FreeList <Collider>(ref list);
            return(false);
        }