Ejemplo n.º 1
0
        private BuildingAsset GetRandom(BuildingAsset[] prefabs, string id)
        {
            int           index = 0;
            BuildingAsset asset;

            if (id == frontBalconyID)
            {
            }
            else if (id == botWallID)
            {
                index = uRandom.Range(0, prefabs.Length + 1);
                FrontWall frontWall = prefabs[index] as FrontWall;
                if (frontWall.hasDoor == false)
                {
                    while (frontWall.hasDoor == false)
                    {
                        index     = uRandom.Range(0, prefabs.Length + 1);
                        frontWall = prefabs[index] as FrontWall;
                    }
                }
            }
            else if (id == topWallID)
            {
            }
            else
            {
                index = uRandom.Range(0, prefabs.Length + 1);
            }


            var prefab = prefabs[index];

            return(prefab);
        }
        public override void Delete( )
        {
            if (Owner != null)
            {
                RemoveBodyMod(Owner);
            }
            if (FrontWall != null)
            {
                FrontWall.Delete();
            }
            if (BackWall != null)
            {
                BackWall.Delete();
            }

            base.Delete( );
        }