コード例 #1
0
 override public void SetBasement(Plane b, PixelPosByte pos)
 {
     if (b == null)
     {
         return;
     }
     SetBuildingData(b, pos);
     if (!subscribedToUpdate)
     {
         GameMaster.realMaster.everydayUpdate += EverydayUpdate;
         subscribedToUpdate = true;
         if (hotels != null)
         {
             hotels.Add(this);
         }
         else
         {
             hotels = new List <Hotel>()
             {
                 this
             }
         };
     }
     if (!GameMaster.loading)
     {
         IPlanableSupportClass.AddBlockRepresentation(this, basement, ref myBlock, true);
     }
 }
コード例 #2
0
    override public void SetBasement(Plane b, PixelPosByte pos)
    {
        if (b == null)
        {
            return;
        }
        SetBuildingData(b, pos);
        var master = GameMaster.realMaster;

        if (!subscribedToUpdate)
        {
            master.everydayUpdate += EverydayUpdate;
            subscribedToUpdate     = true;
        }
        if (hotels == null)
        {
            hotels = new List <Hotel>();
            hotels.Add(this);
        }
        else
        {
            if (!hotels.Contains(this))
            {
                hotels.Add(this);
            }
        }
        colony = master.colonyController;

        if (!GameMaster.loading)
        {
            IPlanableSupportClass.AddBlockRepresentation(this, basement, ref myBlock, true);
        }
    }
コード例 #3
0
    public void LoadPlanesData(System.IO.FileStream fs)
    {
        var b = fs.ReadByte();

        IPlanableSupportClass.AddBlockRepresentation(this, basement, ref myBlock, false);
        if (b == 1)
        {
            upperPlane = Plane.Load(fs, this);
        }
    }
コード例 #4
0
    override public void SetBasement(Plane p, PixelPosByte pos)
    {
        if (p == null)
        {
            return;
        }
        SetBuildingData(p, pos);

        if (!GameMaster.loading)
        {
            IPlanableSupportClass.AddBlockRepresentation(this, basement, ref myBlock, true);
        }
    }
コード例 #5
0
    public void LoadPlanesData(System.IO.Stream fs)
    {
        var count = fs.ReadByte();

        if (count > 0)
        {
            IPlanableSupportClass.AddBlockRepresentation(this, basement, ref myBlock, false);
            planes = new Dictionary <byte, Plane>();
            for (int i = 0; i < count; i++)
            {
                var p = Plane.Load(fs, this);
                planes.Add(p.faceIndex, p);
            }
        }
    }
コード例 #6
0
    override public void SetBasement(Plane p, PixelPosByte pos)
    {
        if (p == null)
        {
            return;
        }

        SetBuildingData(p, pos);
        GameMaster.realMaster.colonyController.storage.AddWarehouse(this);

        if (!GameMaster.loading)
        {
            IPlanableSupportClass.AddBlockRepresentation(this, basement, ref myBlock, true);
        }
    }
コード例 #7
0
    override public void SetBasement(Plane p, PixelPosByte pos)
    {
        if (p == null)
        {
            return;
        }
        //
        basement = p;
        if (transform.childCount == 0)
        {
            var fi = basement.faceIndex;
            if (fi == Block.SURFACE_FACE_INDEX || fi == Block.UP_FACE_INDEX || fi == Block.CEILING_FACE_INDEX || fi == Block.DOWN_FACE_INDEX)
            {
                model       = Instantiate(Resources.Load <GameObject>("Structures/Column"));
                surfaceRect = new SurfaceRect(0, 0, 4);
                surfaceRect = new SurfaceRect((byte)(PlaneExtension.INNER_RESOLUTION / 2 - surfaceRect.size / 2), (byte)(PlaneExtension.INNER_RESOLUTION / 2 - surfaceRect.size / 2), surfaceRect.size);
            }
            else
            {
                model = Instantiate(Resources.Load <GameObject>("Structures/ColumnEdge"));
                switch (fi)
                {
                case Block.FWD_FACE_INDEX: model.transform.rotation = Quaternion.Euler(0f, 180f, 0f); break;

                case Block.RIGHT_FACE_INDEX: model.transform.rotation = Quaternion.Euler(0f, -90f, 0f); break;

                case Block.LEFT_FACE_INDEX: model.transform.rotation = Quaternion.Euler(0f, 90f, 0f); break;

                case Block.BACK_FACE_INDEX: model.transform.rotation = Quaternion.Euler(Vector3.zero); break;
                }
                surfaceRect = SurfaceRect.full;
            }
            model.transform.parent        = transform;
            model.transform.localPosition = Vector3.zero;
            if (!PoolMaster.useDefaultMaterials)
            {
                PoolMaster.ReplaceMaterials(model);
            }
        }
        placeInCenter = true;
        basement.AddStructure(this);
        //
        if (!GameMaster.loading)
        {
            IPlanableSupportClass.AddBlockRepresentation(this, basement, ref myBlock, true);
        }
    }
コード例 #8
0
    override public void SetBasement(Plane b, PixelPosByte pos)
    {
        if (b == null)
        {
            return;
        }

        SetWorkbuildingData(b, pos);
        if (!subscribedToUpdate)
        {
            GameMaster.realMaster.labourUpdateEvent += LabourUpdate;
            subscribedToUpdate = true;
        }

        if (!GameMaster.loading)
        {
            IPlanableSupportClass.AddBlockRepresentation(this, basement, ref myBlock, true);
        }
    }