Пример #1
0
        public override void PlaceBuilding()
        {
            BaseBuilding.CallPack(currentBuilding);

            var evnt = CreateNetworkedBuilding.Create(Bolt.GlobalTargets.OnlyServer, Bolt.ReliabilityModes.Unreliable);
            evnt.pos = currentBuilding.transform.position;
            evnt.rot = currentBuilding.transform.rotation;

            evnt.placedOnID = ((BoltBuilding)(currentBuilding)).networkedPlacedOnID;
            evnt.prefabID = currentBuilding.prefabID;

            evnt.requester = entity;

            evnt.Send();

            DestroyCurrentBuilding();
            ResetBuildingInstance();
        }
Пример #2
0
        public override void SceneLoadRemoteDone(BoltConnection connection)
        {
            BoltBuilding building;

            for (int i = 0; i < entities.Count; i++)
            {
                building = entities[i];

                BaseBuilding.CallPack(building);

                var evnt = CreateNetworkedBuilding.Create(connection, Bolt.ReliabilityModes.ReliableOrdered);
                evnt.pos    = building.transform.position;
                evnt.rot    = building.transform.rotation;
                evnt.health = building.health;

                evnt.id         = building.networkedID;
                evnt.placedOnID = building.networkedPlacedOnID;
                evnt.prefabID   = building.prefabID;
                evnt.Send();
            }
        }